new to php ... POST variables?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

    I am trying to send a bunch of data via a single POST message, from a
wireless device to a PHP script on my server.  Some of this data is
base64_encoded binary image data.  Basically, I want to send a series of
small icons, and each has a width, height, and the pixel data. So I am
sending the following strings via a Socket connection:

"POST HTTP/1.0\n"
"User-Agent: HTTPTool/1.0\n";
"Content-Type: application/x-www-form-urlencoded\n"

following this I send the base64 encoded data for the image.  Then "\n\n" to
end the POST.

This works for a single image, but if I want to send multiple images in the
same post, it doesn't work.  What I tried is just incrementing my variable
names and adding for example "&width2=32&height2=32&data2=blahblahblah" over
and over again for all the images I want to send, eventually followed by the
'\n\n'.  However, in my php script I tried printing out all of the _POST
variables it receives, and it seems like everything after that first 'data'
variable is just being lost, or maybe included in the image data?  I don't

I thought that the '&' symbol should tell the script that a new variable has
come along.  And the base64encode doesn't use that symbol, I don't think.
Maybe it does and that it my problem?

Thanks for any suggestions


Re: new to php ... POST variables?

grande news wrote:
Quoted text here. Click to load it

The problem might have something to do with the appearance of '=' at
the end of base64ed data stream. You might need to replace that with
the urlencoded equivalence.

Site Timeline