title: How to get output, when using fsockopen to open a php page?
body: <p>when I use fsockopen to open a php page, the code works fine, but there are some other problems. For Example: if I open b.php in a.php, "echo" won't work in b.php, error message neither(these 2 things works fine on common page). This makes debug very difficult. How to get output in page b? </p>
  
  <p>Thanks a lot! here is my code. I use main.php to call main_single_block.php.PS: all things work fine except the 2 things I mentiond above.</p>
  
  <p>main.php:</p>
  
  <pre><code>$template_url_arr_s = serialize($template_url_arr);
  $fp = fsockopen($sochost, intval($socportno), $errno, $errstr, intval($soctimeout));
  if (!$fp) {
      echo "$errstr ($errno) ,open sock erro.&lt;br/&gt;\n";
  }
  $typename=  urlencode($typename);//do url encode (if not, ' 'can not be handled right)
  $template_url_arr_s=  urlencode($template_url_arr_s);
  *$out = "GET /main/main_single_block.php?typename=" . $typename . "&amp;templateurlarr=" . $template_url_arr_s . "\r\n";*
  fputs($fp, $out);
  fclose($fp);
  </code></pre>