Jump to content

Sendmail questions on noob stab in the dark coding...


qozmiq

Recommended Posts

I have a simple contact form using sendmail.php to process.  I have six fields in the form, three text entry, and three radio boxes.  Page http://kc-foto.com/form1.php.  In the sendmail file, I have them listed as this:

 

$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$golf = $_REQUEST['golf'] ;
$three = $_REQUEST['360'] ;
$realest = $_REQUEST['realest'] ;
$message = $_REQUEST['message'] ;

 

but in the actual mail function:

 

mail( "[email protected]", "KC-Foto Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://www.kc-foto.com/thankyou.html" );

 

Only $message is listed...I tried to add the other five, seperated by commas...which resulted in this"

 

  mail( "[email protected]", "KC-Foto Feedback Form Results",
    $message, $name, $golf, $three, $realest, "From: $email" );
  header( "Location: http://www.kc-foto.com/thankyou.html" );

 

And when I did this, the message showed up blank.  Now, I am a PHP noob, and  was taking a stab in the dark at the coding.  How should it look?

 

ANY help or guidance would be greatly appreciated.

Have a good read of this.

www.php.net/function.mail

 

mail('addess to send to','subject of the message','message you want to send', 'some headers');

 

My opinion would be to make a string of all the information you want in your message

 

Also if you only want users to make an enquiry about ONE of the radio buttons give the 3 radio buttons just 1 name with differing values like..

Which Pizza?

<input type="radio" name="pizza" value="Mexican" />

<input type="radio" name="pizza" value="Meaty One" />

<input type="radio" name="pizza" value="Vegitarian" />

 

then you can access which 'pizza' the user wants with $_POST['pizza']

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.