note 18722 deleted from language.types.array by didou
| From: | didou@php.net | Date: | Sun, 01 Jun 2003 12:09:34 +0000 |
| Subject: | note 18722 deleted from language.types.array by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49528@lists.php.net to get a copy of this message | ||
Note Submitter: firewire@itsyourdomain.com
----
Watch out when passing associative arrays through forms. Don't put quotes in the html to
distinguish a string php will pick them up as a literal part of the string. Just use single quotes
in the actual php when referencing the value. Please comment on this as im not 100% sure its right.
form action=t.php method=post>
<input type=hidden name=test[0][test1] value=moo1>
<input type=hidden name=test[0][test2] value=moo2>
<input type=hidden name=test[0][test3] value=moo3>
<input type=submit value=go>
</form>
<pre>
<?
print_r($test);
print "Test: " . $test[0]['test1'] . "<br>";
print "Test: " . $test[0]['test2'] . "<br>";
print "Test: " . $test[1]['test3'] . "<br>";
?>