Slodge Posted May 29, 2006 Share Posted May 29, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/10738-php-order-form/ Share on other sites More sharing options...
bobleny Posted May 29, 2006 Share Posted May 29, 2006 You need to define $email $name and $messageIn addition what exactlly is your question? Im baffled as to what you what us to answer. Quote Link to comment https://forums.phpfreaks.com/topic/10738-php-order-form/#findComment-40111 Share on other sites More sharing options...
Slodge Posted May 30, 2006 Author Share Posted May 30, 2006 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 NameEmail : Submitter Email AddressOrdered Items : Ordered ItemsHope i am making it clear , Quote Link to comment https://forums.phpfreaks.com/topic/10738-php-order-form/#findComment-40341 Share on other sites More sharing options...
bobleny Posted May 31, 2006 Share Posted May 31, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/10738-php-order-form/#findComment-40433 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.