Jump to content

Superfluous lines using fsockopen/fread


Debbie-Leigh

Recommended Posts

Hi,

 

I have a page that sends a post request to another page, which generates some data and echos it back to the first page. It works perfectly on my own machine (windows), but when I put it on the live machine (unix), the request page seems to be having superfluous lines being returned.

 

From my logging records, I know that the data is fine before it is sent back, but after it is received by the request page, there is a line with the number 2000 on it after every 242 lines of the data, each line being 32 bytes long. However the last one of these lines is almost always letters. I'm assuming this is a data length in hex, but it doesn't seem to tie up with the calculated length based on 32 (length of each line) * 242.

 

I'm using fsockopen/fread or fgets/fclose to send the request and retrieve the data. Both fread and fgets seem to have the same problem.

 

I've spent several days trying to figure out how to stop this happening, but I've run out of ideas. Has anyone experienced this before and solved it?

 

Debbie

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.