Jump to content

Recommended Posts

else
      {
      $view = @fsockopen($_POST['ip'],$_POST['port'],$errorNumber,$errorMessage,1);
      if($view){
      mysql_query("INSERT INTO `servers` (`name`, `port`, `desc`, `pass`, `ip`, `ip2`) VALUES ('". htmlentities(mysql_real_escape_string($_POST['name'])) ."', '". htmlentities(mysql_real_escape_string($_POST['port'])) ."', '". htmlentities(mysql_real_escape_string($_POST['desc'])) ."', '". htmlentities(mysql_real_escape_string($_POST['pass'])) ."', '". htmlentities(mysql_real_escape_string($_POST['ip'])) ."', '". $_SERVER['REMOTE_ADDR'] ."')") or die('Could not connect: ' . mysql_error());
      echo "The server Has been added to the database";
      echo "<meta http-equiv=Refresh content=2;url='index.php'>";
      }
      else
      {
      echo "The server is offline or does not exist";
      echo "<meta http-equiv=Refresh content=2;url='index.php'>";
      }
      }
  }
}

 

 

i try to add a server to my site thats online.

it comes up offline.

 

is there anything wrong with my fsock???

Link to comment
https://forums.phpfreaks.com/topic/161058-fsock/
Share on other sites

Well, obviously you should remove the error suppression and perhaps try to check the values of $errorNumber and $errorMessage variables you are defining.

 

How about trying to help yourself? I believe numerous people already told you so. Did you read that document about how to ask questions I referred you to? If you haven't, do that and don't post here before you've read it completely.

Link to comment
https://forums.phpfreaks.com/topic/161058-fsock/#findComment-850439
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.