i've got a form in which the user can fill out consisting of 2 text boxes to enter information in, a drop down box of choices and of course a submit button. when they fill it out, it sends the email of information to me fine. everything comes through apart from the option they've chosen from the drop down box.
the code i have is the following;
Expand|Select|Wrap|Line Numbers
- <form action="mail.php" method="post">
- <input onfocus="this.select()" name="name" id="name" type="text" tabindex="1" value="name">
- <input onfocus="this.select()" name="phone" id="phone" type="text" tabindex="2" value="phone number" >
- <br />
- <select name="time" id="time" value="time" size="1" tabindex="3">
- <option value="9">09:00</option>
- <option value="930">09:30</option>
- <option value="9">10:00</option>
- <option value="930">10:30</option>
- <option value="9">11:00</option>
- <option value="930">11:30</option>
- <option value="9">12:00</option>
- <option value="930">12:30</option>
- <option value="9">13:00</option>
- <option value="930">13:30</option>
- <option value="9">14:00</option>
- <option value="930">14:30</option>
- <option value="9">15:00</option>
- <option value="930">15:30</option>
- <option value="9">16:00</option>
- <option value="930">16:30</option>
- <option value="930">17:00</option>
- </select>
- <input name="submit" id="submit" type="submit" value="call me" tabindex="4">
- </form>
Expand|Select|Wrap|Line Numbers
- <?
- header("Location: thankyou.php");
- function checkOK($field)
- {
- if (eregi("\r",$field) || eregi("\n",$field)){
- die("Invalid Input!");
- }
- }
- $name=$_POST['name'];
- checkOK($name);
- $phone=$_POST['phone'];
- checkOK($phone);
- $time=$_POST['time'];
- checkOK($time);
- mail("my email address is here", 'Online Form: ', "\n\n Name -"."$name" ."\n\n Phone - "."$phone" "\n\n Time -"."$time");
- ?>
Its obviously having troubles picking setting the variable for the drop down box, anyone know what im doing wrong?
Thanks