Jump to content

Archived

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

Slodge

Php Order Form

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 = "name@domain.com";


$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]

Share this post


Link to post
Share on other sites
You need to define $email $name and $message

In addition what exactlly is your question? Im baffled as to what you what us to answer.

Share this post


Link to post
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 ,

Share this post


Link to post
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 = "name@domain.com";
$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]

Share this post


Link to post
Share on other sites

×

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.