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 derfloh 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
Joined
Aug 24, 2004
Messages
76
Location
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.
 
there is a </form> in there, yes.

I don't get an error, just a blank screen with in the address bar

as for the "print_r($_POST);, I'll try it....

Cheers
Calum
 
when I put in the print line nothing changes
 
I posted a reply in the XHTML forum,

I think you have overlapping quotes/joins in your mail output string.

"I'm making time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top