wilkesy1 Posted July 21, 2008 Share Posted July 21, 2008 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 More sharing options...
DarkWater Posted July 21, 2008 Share Posted July 21, 2008 Show us the code. Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595533 Share on other sites More sharing options...
kenrbnsn Posted July 21, 2008 Share Posted July 21, 2008 Please post the code you're using between tags. Ken Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595536 Share on other sites More sharing options...
wilkesy1 Posted July 21, 2008 Author Share Posted July 21, 2008 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 Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595542 Share on other sites More sharing options...
wilkesy1 Posted July 21, 2008 Author Share Posted July 21, 2008 ARRRRGGGGHHHH!!!!! > Thought i nearly had it then but nope! hehe! this is driving me mad, surely this is a simple thing that im overlooking? Cheers Paul Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595607 Share on other sites More sharing options...
kenrbnsn Posted July 21, 2008 Share Posted July 21, 2008 Take a look at this presentation on streams & PHP. It might help you with your problem. Ken Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595611 Share on other sites More sharing options...
wilkesy1 Posted July 21, 2008 Author Share Posted July 21, 2008 hi Kenrbnsn Thanks, ill have a good look through this shortly and see what i can come up with. Imust be doing something wrong otherwise everyone woul dbe having this problem? Many thanks Paul Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595668 Share on other sites More sharing options...
wilkesy1 Posted July 21, 2008 Author Share Posted July 21, 2008 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 Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595855 Share on other sites More sharing options...
kenrbnsn Posted July 21, 2008 Share Posted July 21, 2008 Using the curl functions might work better for you. Ken Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595858 Share on other sites More sharing options...
wilkesy1 Posted July 21, 2008 Author Share Posted July 21, 2008 hmmm ok ill give them a go, many thanks Paul Link to comment https://forums.phpfreaks.com/topic/115845-fsockopen-header-help/#findComment-595950 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.