php - Show server status using user input -


you have excuse php innocence have never formally studied launguge , been along time since html class.

i have written

<form> <input type="text" name='address' /> <input type="text" name='port' /> </form>  <?php // script akensai  $ip = $_post['address']; $port = $_post['port'];  if (!$socket = @fsockopen($ip, $port, $errno, $errstr, 30)) {   echo "<font color='red'><strong>offline!</strong></font>"; } else  {   echo "<font color='green'><strong>online!/strong></font>";      fclose($socket); }  ?> 

i trying achieve user input address , port compare values if statement determine if address ping-able if echo statements accordingly.

if of fine programs tell me if work or if not fix errors accordingly.

my site using word press , trying add php , html php widget, widget wont load code ether 1. widgets got issue or 2. code of.

thanks time ben

you should write -

<form method="post" action=""> <input type="text" name='address' /> <input type="text" name='port' /> <input type="submit" name='submit' value = 'submit' /> </form> 

for html.

thanks


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -