NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Order Form

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-03-2007, 09:40 AM THREAD STARTER               #1 (permalink)
Account Suspended
Join Date: Oct 2005
Location: India
Posts: 633
blackwizard is a jewel in the roughblackwizard is a jewel in the roughblackwizard is a jewel in the rough
 



Order Form


Hello,

Look At the Following Code Below ::

PHP Code:
<?php
// ------- three variables you MUST change below  -------------------------------------------------------
$valid_ref1="http://www.your-domain.com";// change "Your--domain" to your domain
$valid_ref2="http://www.your-domain.com";// change "Your--domain" to your domain
$replyemail="your email@your domain.com";//change to your email address
// ------------------------------------------------------------

//clean input in case of header injection attempts!
function clean_input_4email($value$check_all_patterns true)
{
 
$patterns[0] = '/content-type:/';
 
$patterns[1] = '/to:/';
 
$patterns[2] = '/cc:/';
 
$patterns[3] = '/bcc:/';
 if (
$check_all_patterns)
 {
  
$patterns[4] = '/\r/';
  
$patterns[5] = '/\n/';
  
$patterns[6] = '/%0a/';
  
$patterns[7] = '/%0d/';
 }
 return 
preg_replace($patterns""strtolower($value));
}

$name clean_input_4email($_POST["name"]);
$email clean_input_4email($_POST["email"]);
$thesubject clean_input_4email($_POST["thesubject"]);
$thetitle clean_input_4email($_POST["thetitle"]);
$thekeywords clean_input_4email($_POST["thekeywords"]);
$themessage clean_input_4email($_POST["themessage"], false);

$error_msg='ERROR - not sent. Try again.';

$success_sent_msg='<p align="center"><strong>&nbsp;</strong></p>
                   <p align="center"><strong>Your request has been successfully sent to us<br>
                   </strong> and we will reply as soon as possible.</p>
                   <p align="center">A copy of your query has been sent to you.</p>
                   <p align="center">Thank you.</p>'
;

$replymessage "Hi $name

Thank you for your email.

We will endeavour to responsed to your submission request shortly.

Please DO NOT reply to this email.

Below is a copy of the request you submitted:
--------------------------------------------------
$thesubject
$thetitle
$themessage
--------------------------------------------------

Thank you"
;

// email variable not set - load $valid_ref1 page
if (!isset($_POST['email']))
{
 echo 
"<script language=\"JavaScript\"><!--\n ";
 echo 
"top.location.href = \"$valid_ref1\"; \n// --></script>";
????: NamePros.com http://www.namepros.com/programming/323758-order-form.html
 exit;
}

$ref_page=$_SERVER["HTTP_REFERER"];
$valid_referrer=0;
if(
$ref_page==$valid_ref1$valid_referrer=1;
elseif(
$ref_page==$valid_ref2$valid_referrer=1;
if(!
$valid_referrer)
{
 echo 
"<script language=\"JavaScript\"><!--\n alert(\"$error_msg\");\n";
????: NamePros.com http://www.namepros.com/showthread.php?t=323758
 echo 
"top.location.href = \"$valid_ref1\"; \n// --></script>";
 exit;
}
$themessage "name: $name \nQuery: $themessage";
mail("$replyemail",
     
"$thesubject",
     
"$themessage",
     
"$thetitle",
//     "$thekeywords",     
     
"From: $email\nReply-To: $email");
mail("$email",
     
"Receipt: $thesubject",
     
"$replymessage",
     
"From: $replyemail\nReply-To: $replyemail");
echo 
$success_sent_msg;

?>
In the above code, I am having a few problems.

1. When I submit the form using this PHP, the reply Email address does not get any Email regarding the Order details, But a copy of Order has been sent to The Applicant.
Code:
$replyemail="your email@your domain.com";//change to your email address
The Email Address, that was specified in the above area, did not get Details of the order, But the Applicant(of the order) got a receipt of his order.

2. On Clicking Submit Button, In Contact Form, I want the Details Sent to Admin Email($replyemail) and simultaneously, redirected to Paypal Payment Page.

I would be greatful to anyone who helps me and provides me the corrected PHP code, with corrections I mentioned.

Thanks
blackwizard is offline  
Old 05-03-2007, 03:15 PM   #2 (permalink)
Eating Pie
 
iNod's Avatar
Join Date: Nov 2004
Location: Canada
Posts: 2,272
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
 


Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
For starters headers should be in the format of

PHP Code:
$headers 'From: webmaster@example.com' "\r\n" .
    
'Reply-To: webmaster@example.com'
Notice the \r\n not just \n
????: NamePros.com http://www.namepros.com/showthread.php?t=323758

The paypal part, just create a button and select Email link and than use header("location: $paypallink"); to redirect.

- Steve
__________________
I feel old.
iNod is offline  
Old 05-03-2007, 11:00 PM THREAD STARTER               #3 (permalink)
Account Suspended
Join Date: Oct 2005
Location: India
Posts: 633
blackwizard is a jewel in the roughblackwizard is a jewel in the roughblackwizard is a jewel in the rough
 



Ill try it out, Steve. Thanks. Will let you know, when they work.
blackwizard is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 06:59 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger