title: PHP - TCP client using fgets to get data/chat from the server doesnt work
body: <p>to begin with the fputs works for sending chat from the PHP site to this gaming server. But when I use fgets to get all the chatlogs from the server it doesnt return it, bascially for example when I write something in the textfield and send it using the button in the following code, it sends message to the server, I want it to return that value back from the server, or get all the chatlogs from the server and put it into the client which is a php website, here is the code: </p>
  
  <pre><code> &lt;?php
  
   $host="192.168.0.6";
   $port = 7777;
   // open a client connection
   $fp = fsockopen ($host, $port, $errno, $timeout);
   if (!$fp){
   $result = "Error: could not open socket connection";
   }
   else
   {
  
    echo '&lt;center&gt;&lt;form action="tcpclient.php "method="POST" /&gt;&lt;/center&gt;';
    echo '&lt;center&gt;'."Nickname: ".'&lt;input type="text" name="nick" size="31" /&gt;&lt;/center&gt;';
    echo '&lt;center&gt;'." Text: ".'&lt;input type="text" name="chat" size="150" /&gt; &lt;input type="submit" name="send" value="Send"  /&gt;&lt;/center&gt;';
  
    if (isSet($_POST['send'])) $formvalue =$_POST['chat'];
    //$name = $_POST['nick'];
    //if (isSet($_POST['send'])) $formvalue + $_POST['chat']; 
    fputs ($fp, $formvalue);
  
    }
    $result = fgets ($fp, 7777);
    echo $result;
  
    ?&gt;
  </code></pre>