Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi, I've created an email form on my website by following a guide. I now have two files:
contact.htm...
[syntax="html"]<form method=post action="sendmail.php">
<table width="691" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="185" class="white">
<p align="left">your name:</p> </td>
<td width="29"> </td>
<td width="447"><input name="name" type="text" size="40" /> </td>
</tr>
<tr>
<td class="white">
<p align="left">your email address:</p> </td>
<td> </td>
<td><input name="email" type="text" size="40" /> </td>
</tr>
<tr>
<tr>
<td class="white">
<p align="left">your phone number:</p> </td>
<td> </td>
<td><input name="phoneNumber" type="text" size="40" /> </td>
</tr>
<tr>
<td valign="top" class="white"><p align="left">best time to contact you?</p> </td>
<td valign="top"> </td>
<td valign="top">
<select name="bestTime">
<option value="none" selected="selected">please select...</option>
<option value="Weekday morning">weekday morning</option>
<option value="Weekday afternoon">weekday afternoon</option>
<option value="Weekend">weekend</option>
<option value="Any time">any time</option>
</select> </td>
</tr>
<tr>
<td valign="top" class="white"><p align="left">preferred method of contact?</p> </td>
<td valign="top"> </td>
<td valign="top">
<select name="contactMethod">
<option value="none">please select...</option>
<option value="email">by email</option>
<option value="phone">by phone</option>
</select> </td>
</tr>
<tr>
<td valign="top" class="white">
<p align="left">please enter your questions<br />
or comments below:</p> </td>
<td> </td>
<td><textarea name="message" rows="5" cols="50"></textarea> </td>
</tr>
<tr>
<td> </td>
<td></td>
<td><input name="submit" type="submit" value="Click to Send" /></td>
</tr>
</table>
<div align="right"></div>
</form>Code: Select all
<?php
mail("info@mydomainname.co.uk", "From your Contact Form...", $_REQUEST[message], "From: $_REQUEST[email]", "-f".$_REQUEST[email]);
header( "Location: http://www.mydomainname.co.uk/thankyou.htm" );
?>Kind regards,
Alistair
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]