RE: [PHP] array question
| From: | Martin Towell | Date: | Thu, 30 May 2002 23:13:01 +0000 |
| Subject: | RE: [PHP] array question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-100018@lists.php.net to get a copy of this message | ||
$_POST["product"][0]
$_POST["product"][1]
etc.
-----Original Message-----
From: Michelle [mailto:michelle@4ualso.com]
Sent: Friday, May 31, 2002 9:25 AM
To: php-general@lists.php.net
Subject: [PHP] array question
I'm a newbie at php and I'm sure you will be able to tell by my question.
I'm just doing a simple form but my head is hurting from trying to figure
out the correct syntax.
I'm posting the form to $PHP_SELF
an example from my $form_block =
<p><b>*</b>Your Name:<br />
<INPUT type=\"text\" name=\"sender_name\"
value=\"$_POST[sender_name]\"
size=30></p>
<p><b>*</b>Your E-Mail Address:<br />
<INPUT type=\"text\" name=\"sender_email\"
value=\"$_POST[sender_email]\"
size=30></p>
<p>Phone Number:<br />
<INPUT type=\"text\" name=\"phone\" value=\"$_POST[phone]\"
size=30></p>
which finally leads to my question how do I do the $_POST[var] when it's an
array(checkbox or radio button)?
ex: <input type=\"checkbox\" name=\"product[]\"
value=\"red\">red<br />
Am I making sense? If not please let me know :-) and I will try to remedy
it.
Michelle