Jump to content

fsockopen header help!


wilkesy1

Recommended Posts

Hi All,

 

Wonderign if you can help me, im venturing into the realms of using the fsockopen() function to call scripts between 2 servers. I have got it working perfectly aprt from 1 bit. Whenever the report finishes running it always displays the header info at the top of the page as follows,

 

HTTP/1.1 200 OK Date: Mon, 21 Jul 2008 13:21:24 GMT Server: Apache/2.0.54 (Linux/SUSE) X-Powered-By: PHP/5.0.4 Set-Cookie: PHPSESSID=ujk21puagv6k3jscbe6k0p7jb6; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Length: 3465 Connection: close Content-Type: text/html

 

How do i stop this being displayed? i understand that this info is required but i dont want to display it to screen. Ive been searching around everywhere and thought i had better ask the question before i go completely insane!!

 

Many thanks

 

Paul

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/
Share on other sites

BLIMEY!!!! Super quick replies,

 

Im using very very basic code

 

$fp = fsockopen("www.example.com",80);

fputs($fp, "GET /testing.php HTTP/1.0\r\n\r\n");

$data="";
while (!feof($fp)) $data.=fgets($fp,64000);
fclose($fp);

print $data;

 

ive removed the IP address as its sensitive data and not fully secured yet. Sorry.

 

Paul

Hi All,

 

Ive tried some of the suggested code changes from the slides and other websites but i still cant seem to get this sorted? How does everyone else use the fsockopen() function and hot get the header displayed on the page?

 

Any more suggestions would be greatfully received as im going insane trying to sort this out.

 

Many thanks

 

Paul

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.