Guest Posted November 3, 2012 Share Posted November 3, 2012 Hello, I am trying to use PHP to send me an E-Mail to an E-Mail account with my domain. It currently works, but is flawed. I have "First Name:," "Last Name:," and "E-Mail:" fields in HTML, a submit button, which works, and I have some checkboxes. What I want is whatever is checked by a user to be E-Mailed to me as the message of the E-Mail, along with the first/last names & gender ("sex"). I also want real E-Mail addresses to work also. Here is the HTML and PHP codes I have below: <form method="post" action="sendmail.php"> First name: <input name="firstname" type="text" /><br /> Last name: <input name="lastname" type="text" /><br /> E-Mail: <input name="email" type="text" /><br /> <input type="radio" name="sex" value="male" />Male<br /> <input type="radio" name="sex" value="female" />Female<br /> <input type="checkbox" name="shirt1" value="Short sleeve: Black ("BVK" front & back)" />Short sleeve: Black ("BVK" front & back)<br /> <input type="checkbox" name="shirt2" value="Long sleeve: Red ("Haters Keep Me Cool" front & "BVK" back)" />Long sleeve: Red ("Haters Keep Me Cool" front & "BVK" back)<br /> <input type="checkbox" name="shirt3" value="Long sleeve: Blue ("Haters Keep Me Cool" front & "BVK" back)" />Long sleeve: Blue ("Haters Keep Me Cool" front & "BVK" back)<br /> <input type="checkbox" name="shirt4" value="Long sleeve: Purple ("BVK" front & "scRAPS" back)" />Long sleeve: Purple ("BVK" front & "scRAPS" back)<br /> <input type="checkbox" name="shirt5" value="Long sleeve: Black ("BVK" front & "scRAPS" back)" />Long sleeve: Black ("BVK" front & "scRAPS" back)<br /> <input type="checkbox" name="shirt6" value="Long sleeve: White ("BVK" front & "scRAPS" back)" />Long sleeve: White ("BVK" front & "scRAPS" back)<br /> <input type="submit" value="Send Request" /></form> <?php $email = $_REQUEST['email'] ; $shirt1 = $_REQUEST['shirt1'] ; $firstname = $_REQUEST['firstname'] ; $lastname = $_REQUEST['lastname'] ; mail( "(E-MAIL IT SENDS TO)", "Shirt Order", $email, "From: $email" ); $firstname = $_REQUEST['firstname'] ; $lastname = $_REQUEST['lastname'] ; header( "Location: (MY WEB URL)" ); ?> Currently, it does send an E-Mail to the E-Mail I have it set to, but nothing else is sent to me. The message of the E-Mail is whatever is entered in the "E-Mail" field, or first/last name fields. Link to comment https://forums.phpfreaks.com/topic/270238-php-e-mail-form-please-help/ Share on other sites More sharing options...
Guest Posted November 3, 2012 Share Posted November 3, 2012 Nevermind, fixed it myself. Link to comment https://forums.phpfreaks.com/topic/270238-php-e-mail-form-please-help/#findComment-1389889 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.