Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 19:43

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



convert php to html .. Is it possible?

Discussion on convert php to html .. Is it possible? within the SRO Coding Corner forum part of the Silkroad Online category.

Closed Thread
 
Old   #1
 
Eslam Galull's Avatar
 
elite*gold: 85
Join Date: Aug 2010
Posts: 1,278
Received Thanks: 524
convert php to html .. Is it possible?

Is it possible to convert that code

Code:
<?php


 
    $ip = '178.63.59.165'; //Server ip adress 
    $port = '15779'; //Server port 
     
    function server_status($ip, $port) 
    { 
    $status = array("<strong>Server is:</strong><span style='color:#F00;'>Offline</span>", "<strong>Server is:</strong><span style='color:#0F0;'>Online </span> 
"); 
    $fp = @fsockopen($ip, $port, $errno, $errstr, 2); 
    if (!$fp) { 
        return $status[0]; 
    }  
    else 
       
      {  
      return $status[1]; 
      } 
    }  
	
	
	
	echo server_status($ip, $port); 
 ?>

From Php To Html ?

i know it maybe the wrong place but i couldent find a right section for it special that a server state check for sro
Eslam Galull is offline  
Old 06/10/2015, 10:13   #2
 
elite*gold: 0
Join Date: Mar 2009
Posts: 537
Received Thanks: 156
its not possible since html is static describing language and clientsided, while php is serverside programming langugage
alexhun is offline  
Old 06/10/2015, 11:46   #3
 
Eslam Galull's Avatar
 
elite*gold: 85
Join Date: Aug 2010
Posts: 1,278
Received Thanks: 524
Quote:
Originally Posted by alexhun View Post
its not possible since html is static describing language and clientsided, while php is serverside programming langugage
i got that to while searching .. but

there is any same Java or html script do the same ?
Eslam Galull is offline  
Old 06/10/2015, 13:25   #4
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,841
Received Thanks: 4,675
Quote:
Originally Posted by its.soul View Post
i got that to while searching .. but

there is any same Java or html script do the same ?
No
Devsome is offline  
Old 06/10/2015, 16:45   #5
 
blapanda's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 1,860
Received Thanks: 760
Sadly not.
You have to think about this: Your php codes are some handsome little cute kitties.
If you put them into a html/htm/js/any, you will uncover their cage, and bully ugly beasty dogs will rip them apart.

PHP codes need to be secured, which is only possible doing a simple .php document file for it.

No one can ever read your php codes, if you do so. Anything else, who ever has said/going to say, might be insecure.
blapanda is offline  
Old 06/10/2015, 17:11   #6
 
elite*gold: 8
Join Date: Sep 2014
Posts: 625
Received Thanks: 178
You could do that with JavaScript.
qqdev is offline  
Old 06/11/2015, 10:15   #7
 
gigola123's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 722
Received Thanks: 390
What is your purpose ?

Because I don't see the point to convert this php code into html O.o

I mean php and html is just totaly different.
gigola123 is offline  
Old 06/11/2015, 12:06   #8
 
Eslam Galull's Avatar
 
elite*gold: 85
Join Date: Aug 2010
Posts: 1,278
Received Thanks: 524
sure i know ,

i mean if i got an html page , and i cant import any php & like using google service ( blogspot ) with a paid design then i just met that i cant import or using ifram or objects to included Any php code & functions

so there is anyway & script to check if the ip : port is Online or No
Eslam Galull is offline  
Old 07/05/2015, 22:39   #9
 
Vocs's Avatar
 
elite*gold: 0
Join Date: Jun 2015
Posts: 28
Received Thanks: 2
It might be possible with java script

Code:
function testWebSocket() { 
     websocket = new WebSocket("Server IP");
     websocket.onopen = function(evt) { onOpen(evt) };
     websocket.onclose = function(evt) { onClose(evt) };
     websocket.onmessage = function(evt) { onMessage(evt) };
     websocket.onerror = function(evt) { onError(evt) };
}
If the websocket is made your server would be online. Although I don't know too much about java script.

But like others have mentioned, this is insecure, although since it's only your server IP showing, it shouldn't be too bad. I wouldn't recommend doing much else outside of PHP though.
Vocs is offline  
Thanks
1 User
Old 07/15/2015, 02:26   #10
 
►™SuperE™◄'s Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 350
Received Thanks: 421
You don't necessarily have to use Blogspot.
►™SuperE™◄ is offline  
Old 07/16/2015, 10:52   #11
 
elite*gold: 0
Join Date: Apr 2015
Posts: 1,444
Received Thanks: 1,373
Really.........

No you can't convert PHP's functions in HTML, maybe there is something in HTML 5 that can create a "new" function, but, main question. NO you can't create a PING server **** in pure HTML.
​Goofie​ is offline  
Old 07/30/2015, 20:09   #12
 
elite*gold: 1
Join Date: Jul 2015
Posts: 207
Received Thanks: 60
woah it's possible to convert forms inside of php to html but you cant convert the actual php code to html because html is client side scripting language and php is server side
B1Q B0SS is offline  
Old 07/30/2015, 20:39   #13
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,841
Received Thanks: 4,675
Can we close this thread ?
It is not possible, answer was given and question is done, isn't it ?
Devsome is offline  
Thanks
1 User
Closed Thread


Similar Threads Similar Threads
Kick to convert: easy and fast way to convert your item_proto/mob_proto to txt files!
09/07/2016 - Metin2 PServer Guides & Strategies - 21 Replies
Hi all, this is my first release :) This "kick converter" will allow you to generate txt files (item_names, item_proto, mob_proto, mob_names) for the rev-34k game. The script was written in python by me, so you need python 2.7 and MySQLDB (python extension) installed on your server. If you found any error, please report it to me and I'll fix it as soon as possibile. PS: If you get errors while converting the item_proto, please remove items that have type 29 or type 31.
[Joomla][HTML] modul in einer html datei verlinken?
11/11/2011 - Web Development - 1 Replies
ich hab vorher im joomla forum schon ein thread geöffnet aber da antwortet mir niemand und ich ich langsam keine gedult mehr.. will heute noch weiter probieren und so. ---------------------------------------- Bei den Modulen gibt es ein leeres, wo man ein editor hat. Ist es möglich eine verlinkung zum modul in der html zu machen? Hier ein beispiel vom aufbau meiner website: Vorstellung wie die website ungefähr sein soll, wo ich welche div container gemacht habe, wie das ganze zur zeit...



All times are GMT +1. The time now is 19:44.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.