PDA

View Full Version : Reading & Posting HTML form values in PHP



jrobin747
03-11-2005, 09:02 AM
I really need some help with this.

The form is here:
http://www.g-dassociates.com/contact.html

The PHP page is here:
http://www.g-dassociates.com/sendsimpleform.php

I have check boxes and a short list in form. I don't know the best way to label them in the html or what to put in the PHP I tried someting for the first three questions.
For ex: with the name I have sendername and in the php script i have $msg.= "Sender's Name: $_POST[sendername]\n";
to post I have this


Your Name:

<?php echo "$_POST[sendername]";?>
</p>

for the list and check box I tried this
$msg.= "Sender's Question01: $_POST[senderquestion01]\n
$msg.= "Sender's Question02: $_POST[senderquestion02]\n
$msg.= "Sender's Question03: $_POST[senderquestion01]\n
to post I have this


Your Answer to Question #1:

<?php echo "$_POST[senderquestion01]";?>
</p>


Your Answer to Question #2:

<?php echo "$_POST[senderquestion02]";?>
</p>


Your Answer to Question #3:

<?php echo "$_POST[senderquestion03]";?>
</p>

As for now everything (entered text) works except the check boxes and the list box, I just need to know how to code the PHP file so that it reads and post what was selected.

Thanks for any help