473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

new to php ... POST variables?

Hello,

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://www.mydomain.com/processicons.php HTTP/1.0\n"
"From: me@mydomain.com\n"
"User-Agent: HTTPTool/1.0\n";
"Content-Type: application/x-www-form-urlencoded\n"
"width=32&height=32d&data="

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
know.

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

Bint


May 7 '06 #1
1 1605
grande news wrote:
Hello,

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:


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.

May 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert | last post by:
Hello, Can anyone help with this? On my online order form, I need to send a few variables to my credit-card processor. These variables are for non-secure customer comments, and will be sent...
2
by: Robert | last post by:
Can anyone do this? Using PHP, I want to POST or GET some variables to a second php page. This, I already know how to do. However, on the second php page, I want to use a simple, standard HTML...
5
by: Michael Foord | last post by:
I'm receiving POST data to a CGI, which I'd like to forward to another CGI using urllib2. I have two options - 1) Parse the data using cgi.FieldStorage() and then rebuild the POST request...
2
by: Asp Help | last post by:
I'm working on a ASP applicatition to create Windows 2000 users. Because I don't want everybody to have access to the site I've changed te security in IIS 5.0 which runs on a windows 2000 Sp4...
5
by: Kit | last post by:
Hi there, I am recoding a website, and I want to add a generic footer to each page, using an included file with PHP snippets. Part of that footer would be a link to validate the page using the...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
24
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button...
4
by: dac | last post by:
I am quietly going insane on this project. I've never worked on a project like this one before. All my previous sticky forms were for data entry, not editing. I don't know how to display the form...
3
by: Vic Spainhower | last post by:
Hello, I have an HTML table that is being constructed from a MySQL table and displays a form that includes a check box on 1 of the fields on the form for each record. I have included in this PHP...
5
Atli
by: Atli | last post by:
Hi everybody. After years of C# and PHP, I'm finally returning to Java. My goal is to create a Java program capable of sending images to a PHP Photo Album on my web server. Right now, however,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.