I'll be honest: I'm a senior in an ITP program and I don't know much about PHP. (Hell, the shop instructor knows less than I do!) But I decided to try it on a website I need to make. And since I'm posting here, I think you can guess how well it went. I can get the email to send, but it doesn't take information - specifically, from a drop-down menu.
So, let's see if we can go over the code and find out the right's and wrongs. Please? (And yes, it is a Harry Potter website. It had to be themed. )
HTML Form:
<form method="post" action="../askmarauders.php">
Your Name: <input type="text" name="yourname"></textarea>
<br />
Email: <input name="email" type="text" />
<br />
For:
<select name="for">
<option value="Remus">Remus Lupin</option>
<option value="Peter">Peter Pettigrew</option>
<option value="Sirius">Sirius Black</option>
<option value="James">James Potter</option>
<option value="Severus">Severus Snape</option>
<option value="Lily">Lily Evans</option>
<option value="Group">A group (speficy in message)</option>
<option value="Anyone">Anyone can answer</option>
<option value="all">My question is for everyone!</option>
</select>
<br />
Message:
<br />
<textarea name="txt" rows="15" cols="40">
</textarea>
<br />
<input type="submit" name="submit" value="Submit"/>
</form>
PHP Code:
<?php
$to = "
[email protected]";
$email = $_REQUEST['email'];
$subject = "Ask the Marauders";
$for = $_REQUEST['for']
$txt = $_REQUEST['txt'];
$headers = "From: $email" . "For: $for" . "\r\n" .
"Location: thankyou.htm";
mail($to,$subject,$txt,$headers);
?>
Quote clearly, I'm a PHP loser n00b very bad beginner. Can anyone help me figure this out?