Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"select forms and php"

Status
Not open for further replies.

Halcrow

Programmer
Aug 24, 2004
76
GB
Hi there, I put this post in the HTML, XHTML & CSS forum but I think it might be more relevant here...

I'm trying to create a form with "select" inputs which is processed by a php file and then sent to me via email. When I submit the form the browser doesn't display my "thankyou" page (like it should) and I don't receive my email.

In my code I have: (for example)
<form method="post" action="contact.php">
...
<select name="year">
<option value="2004">2004</option>
<option value="2005">2005</option>
</select>

In my php file I have:
$year = $_POST['year'] ;
...
$messageproper =
...
"\n\nYear: " . $year . "


The idea is that it should tell me what year was selected in the email I recieve. What am I doing wrong?
 
can you put a </form> in.
do you get an error ?
can you put prinr_r($_POST); at the top of contact.php to see if it's even getting there.
 
when I put in the print line nothing changes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top