Jump to content

Form to email php script nightmare


tribeka

Recommended Posts

Ok try this!

 

<?php
$message = 
"Name: ".$_REQUEST['name']."<br>
<br>
Email: ".$_REQUEST['email']."<br>
<br>
Contact Number: ".$_REQUEST['contact']."<br>
<br>
Address: ".$_REQUEST['address']."<br>
<br>
Town: ".$_REQUEST['town']."<br>
<br>
Postal Code: ".$_REQUEST['postalcode']."<br>
<br>
Message: ".$_REQUEST['message']."<br>
<br>
";
     
    mail("[email protected]", "Feedback Form results", $message, "From: $_REQUEST",       "[email][email protected]".$_REQUEST[email]);
     
    header( "Location: http://www.scavengers-uk.com/thanks.php" );
     
   ?>

 

It isn't the pettiest thing in the world but it should work.  Remember you need to change the $_REQUEST[name of variable] for each textbox to what ever you have named it on your form.

 

@ Poster,

 

What about trying this;

 

<?php
$msg = "Sender's Name:\t$_POST[name]\n";
$msg .= "Sender's E-Mail:\t$_POST[email]\n";
$msg .= "Sender's Comment:\t$_POST[comment]\n\n";

$mailheaders = "From: Message From My Website <[email protected]>\n";
$mailheaders .= "Reply-To: $email\n\n";

mail("[email protected]", "Contact Form", $msg, $mailheaders);

echo "<H3 align=center>Thank you, $_POST[name] </H1>";
echo "<P align=center>One of our consultants will get back to you shortly</P>";

?>

Thanks Nitation

 

That didn't work either. I suspect I'm missing something really obvious as I have tried about 5 scripts kindly volunteered by forum users and none seem to work, although I think I'm copying them verbatim and making the appropriate changes (email address etc)

 

My site is uploaded to a Linux server. I'm putting the PHP files in the same directory (htdocs) as the html files.

 

Any ideas as to what I might be doing wrong would be appreciated.

 

Many thanks

 

James

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.