Jump to content

Php Order Form


Slodge

Recommended Posts

Can u please help me out. I want to create contact form which send the copy of the form to me + the form submitter email address and display the submit form instead of redirecting to thankyou.php , like

If my contact form is :

contact.html [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
<form action="mail.php" method="post">
Name
<input type="text" name="name"><br/>
Email addess
<input type="text" name="email"><br/>
Message<br/>
<textarea name="message" cols="40" rows="5"></textarea><br/>
<input type="submit" value="send"><br/>
</form>
[/quote]
mail.php

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
<?php


$youremail = "[email protected]";


$subject = "Contact";


$thankyou = "thankyou.php";


;if($email == ""){
?>
No email address added. Please go back.<br/>
"<?php
;}elseif($name == ""){
"?>
No name added. Please go back.<br/>
<?php
;}elseif($message == ""){
"?>
No message added. Please go back.<br/>
"<?php
;}else{

$msg = ereg_replace("\\\'", "'", $message);
$msg = ereg_replace('\\\"', "\"", $msg);
$message1 = "from: $name\nemail: $email\nmessage:\n$msg1";

mail($youremail, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");
?>
<meta http-equiv="refresh" content="0; url=<?echo $thankyou;?>"">
"<?php
}
"?>

[/quote]
Link to comment
https://forums.phpfreaks.com/topic/10738-php-order-form/
Share on other sites

I am creating an order form for my website, i want user (form submitter) receive the copy of the form. eg.

Thank you for your order:

Here are the details you sent to us :
(here comes the order form send to us via the contact form like )
Name : Submitter Name
Email : Submitter Email Address
Ordered Items : Ordered Items

Hope i am making it clear ,
Link to comment
https://forums.phpfreaks.com/topic/10738-php-order-form/#findComment-40341
Share on other sites

I think this is what your asking for. You want it to send you their info and then take them to a thank you page? Then this is the second page that sends you the email. Is that all you needed? I understand now what you are doing but don't know exactlly what you want us to do so for now ill assume that this is what you where asking.

[code]<?php
$youremail = "[email protected]";
$subject = "Contact";
$thankyou = "thankyou.php";
$email = $_POST['email'];
$name = $_POST['name'];
$message = $_POST['message'];

if ($email == "")
{
    echo "No email address added. Please go back.<br/>";
}
else
{
if ($name == "")
{
    echo "No name added. Please go back.<br/>";
}
else
{
if ($message == "")
{
    echo "No message added. Please go back.<br/>";
}
else
{
$msg = ereg_replace("\\\'", "'", $message);
$msg = ereg_replace('\\\"', "\"", $msg);
$message1 = "from: $name\nemail: $email\nmessage:\n$msg1";

mail($youremail, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");

echo "<meta http-equiv='refresh' content='0; url='" . $thankyou; . "'>";

}
}
}[/code]
Link to comment
https://forums.phpfreaks.com/topic/10738-php-order-form/#findComment-40433
Share on other sites

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.