473,407 Members | 2,315 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,407 software developers and data experts.

Something wrong with $_POST

HI, everyone.

I don't seem to be able to access the keys in an associative array.

I have a script that dynamically generates a form. The form element
names are generated based on image filenames, so I can't just access
them the normal way in the form handler script. I tried looping through
the $_POST array like this:

foreach ($_POST as $key=>$value)
{

echo $key.'=>'.$value.'<br>';
}

and i get this output:

0=>Pay
1=>Pay
2=>on
3=>on
4=>tn__DSC2602.jpg
5=>tn__DSC2603.jpg

Thos numbers are where I expected to see the form element names. Can
anyond advise me on why this is happening?

Derek

Sep 16 '06 #1
2 1024
jd****@gmail.com wrote:
HI, everyone.

I don't seem to be able to access the keys in an associative array.

I have a script that dynamically generates a form. The form element
names are generated based on image filenames, so I can't just access
them the normal way in the form handler script. I tried looping through
the $_POST array like this:

foreach ($_POST as $key=>$value)
{

echo $key.'=>'.$value.'<br>';
}

and i get this output:

0=>Pay
1=>Pay
2=>on
3=>on
4=>tn__DSC2602.jpg
5=>tn__DSC2603.jpg

Thos numbers are where I expected to see the form element names. Can
anyond advise me on why this is happening?

Derek
try this and see what you get from the server, should give you a clue:

print '<pre>';
print_r( $_POST );
print '</pre>';
Sep 16 '06 #2
On 16 Sep 2006 16:44:20 -0700, jd****@gmail.com wrote:
>I don't seem to be able to access the keys in an associative array.

I have a script that dynamically generates a form. The form element
names are generated based on image filenames, so I can't just access
them the normal way in the form handler script. I tried looping through
the $_POST array like this:

foreach ($_POST as $key=>$value)
{

echo $key.'=>'.$value.'<br>';
}

and i get this output:

0=>Pay
1=>Pay
2=>on
3=>on
4=>tn__DSC2602.jpg
5=>tn__DSC2603.jpg

Thos numbers are where I expected to see the form element names. Can
anyond advise me on why this is happening?
What does your form look like?

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 16 '06 #3

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

Similar topics

0
by: Spud | last post by:
<?php // pullpage function by Nick bouton http://www.nickbouton.com/. $CustomerID = "IDHERE"; $method = "POST"; $host = "xml.mydata.com"; $usepath = "/xml.asp"; //print all vars in an...
9
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php';...
3
by: snowweb | last post by:
I'm creating my first web application in PHP/MySQL, however, when I go to view the database contents, the data has been stored in the wrong columns. I've gone through my insertion code with a fine...
1
by: Leszek | last post by:
Hi. I'm using <pre><?php print_r($_POST); ?> </pre> and i'm getting this: Array (
13
by: comp.lang.php | last post by:
Other: <input name="school_type_other" size="30" maxlength="75" value="<?php if ($_POST) echo $_POST; else echo str_replace('"', '&quot;', str_replace('\\', '', $result->school_type_other)); ...
3
by: JaRudzik | last post by:
Hello Try to add some blank text field and refresh window in IE it is ok but in firefox input hide_show works wrong , why ? Somebody can help me ? I'm not good in JS beacause I'm PHP coder ...
17
by: so many sites so little time | last post by:
all right so the script is pretty simple it goes it retrives what the id of the post is and it lets you edit it well no it doesnt. now if you go to www.kirewire.com/pp2/index/php you will see a...
1
by: ghimiremanu | last post by:
hello i am just getting into php coding ! i want to have one astromatch form and the details filled should be sended to particular email ! i tried but emailing is not working ! means i am not able...
3
by: Siong.Ong | last post by:
Dear all, my PHP aims to update a MySQL database by selecting record one by one and modify then save. Here are my PHP, but I found that it doesnt work as it supposed to be, for example, when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.