# Socket connection to show account info help needed

**URL:** <https://forum.kirupa.com/t/socket-connection-to-show-account-info-help-needed/219010>\
**Category:** Uncategorized\
**Created:** [March 13, 2007, 4:09am UTC](https://forum.kirupa.com/t/socket-connection-to-show-account-info-help-needed/219010 "2007-03-13T04:09:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BetaWar](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@BetaWar](https://forum.kirupa.com/u/BetaWar)\
**Post date:** [March 13, 2007, 4:09am UTC](https://forum.kirupa.com/t/socket-connection-to-show-account-info-help-needed/219010/1 "2007-03-13T04:09:06Z")

</div>

Well, if the title wasn’t clear enough, I need help with a script I am creating. I am new to socket aspects of life, expecially for PHP, but need to edit my already working application to use a post method instead of a get. It will eventually be used to show account information from an offsite database when queried, and as it may be sending secure material between the 2 I don’t want to have it using the URL to store its information.

Here is the script at the moment  
[COLOR=#000000][http://www.reigninggames.com/tests/socketTest.php[/COLOR]](http://www.reigninggames.com/tests/socketTest.php%5B/COLOR%5D)

And if you wish to see the source code here you can do that:  
[http://www.reigninggames.com/tests/socketTest.php?hl](http://www.reigninggames.com/tests/socketTest.php?hl)

Basically I have this code:

```auto
<?php
if(count($_GET)) {
highlight_file( __FILE__ );
echo"<br><br>";
}

$SendVar = "now";
function getVersion($Send) {

   $host = 'threeskulls.th.funpic.org';
   $fp = fsockopen($host, 80, &$errno, &$errstr, 8);
   if (!$fp) {
      return "Unable to connect to {$host}";
   }
   else {
      $request = "GET /tv2.php?find=$Send HTTP/1.0
"
         ."Host: $host
"
         ."Connection: close

";
      fputs($fp, $request);

      while (!feof($fp)){
          $response .= fgets($fp, 1024);
      }

      fclose($fp);

      if(strstr($response, ':')){
// $response = explode("time:", $response);
// return 'Testing: ' . $response['1'];
          return $response;
      }

      return "Unable to find output on {$host}";
   }
}

  echo getVersion($SendVar);
?>

```

and I need to change the communication method to POST, but can’t get it to work with what I have tried.

It will be making queries on the offsite page to a mysql database so I can’t just have the contents of the file included, but need them to finsih their functions and send back the results.

Any help would be great.
