convert php to html .. Is it possible?

06/10/2015 09:31 Eslam Galull#1
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
06/10/2015 10:13 alexhun#2
its not possible since html is static describing language and clientsided, while php is serverside programming langugage
06/10/2015 11:46 Eslam Galull#3
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 ?
06/10/2015 13:25 Devsome#4
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
06/10/2015 16:45 blapanda#5
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.
06/10/2015 17:11 qqdev#6
You could do that with JavaScript.
06/11/2015 10:15 gigola123#7
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.
06/11/2015 12:06 Eslam Galull#8
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
07/05/2015 22:39 Vocs#9
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.
07/15/2015 02:26 ►™SuperE™◄#10
You don't necessarily have to use Blogspot.
07/16/2015 10:52 ​Goofie​#11
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 shit in pure HTML.
07/30/2015 20:09 B1Q B0SS#12
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
07/30/2015 20:39 Devsome#13
Can we close this thread ?
It is not possible, answer was given and question is done, isn't it ?