Jump to content


Photo

Php Order Form


  • Please log in to reply
3 replies to this topic

#1 Slodge

Slodge
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 29 May 2006 - 10:48 PM

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]

#2 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 29 May 2006 - 11:03 PM

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.
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#3 Slodge

Slodge
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 30 May 2006 - 07:08 PM

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 ,

#4 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 31 May 2006 - 03:23 AM

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.

<?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; . "'>";

}
}
}

-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users