Jump to content

Php E-Mail Form *please Help*


Recommended Posts

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.

Edited by Guest
Link to comment
https://forums.phpfreaks.com/topic/270238-php-e-mail-form-please-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.