Hello All..! It would be awesome if I could get a little help here...! I'm trying to create a contact form with HTML code that has Name, Email and Cell#. The issue that I'm running into is the "Send" button. I would like the code to allow the "Send" button to be able to send there information to me...as well as take them to the "next page" in my website. So once they click the send button it will serve two purposes...to email me there info. and to send them to the next page that want them to go to. Any help with the actual coding would be very much appreciated..! Thank you in advance, Adrien
You can use following codes: <?php $myemail = "[COLOR="red"]your email[/COLOR]"; $nextpage = "[COLOR="red"]nextpage.php[/COLOR]"; if (isset($_POST['Submit'])) { $message = "Name: $_POST[Name]\r\nEmail: $_POST[Email]\r\nCell: $_POST[Cell]\r\nComment: $_POST[Comment]"; @mail($myemail, "New contact added", $message); header("Location: $nextpage"); } else { ?> <html> <body> <form method="post" action="contact.php"> <table> <tr> <td>Name</td> <td><input type="text" name="Name" /></td> </tr> <tr> <td>Email</td> <td><input type="text" name="Email" /></td> </tr> <tr> <td>Cell#</td> <td><input type="text" name="Cell" /></td> </tr> <tr> <td>Comment</td> <td><textarea name="Comment" cols="50" rows="20"></textarea></td> </tr> <tr> <td></td> <td><input type="submit" name="Submit" value="Send" /></td> </tr> </table> </form> </body> </html> <?php } ?> Code (markup):
<form method="post" action="contact.php"> <table> <tr> <td>Name</td> <td><input type="text" name="Name" /></td> </tr> <tr> <td>Email</td> <td><input type="text" name="Email" /></td> </tr> <tr> <td>Cell#</td> <td><input type="text" name="Cell" /></td> </tr> <tr> <td>Comment</td> <td><textarea name="Comment" cols="50" rows="20"></textarea></td> </tr> <tr> <td></td> <td><input type="submit" name="Submit" value="Send" /></td> </tr> </table> </form> </body> </html>