Web Designer

April 13, 2006

Simple Email form + 2checkout

Filed under: Web Design Tips and Tricks — Zaur @ 2:02 am

I was given the task to create an online form, after the form submission details to be emailed to website owner, additionally, as soon as the email form submitted visitor directed to 2checkout payment page.

After several endeavours I modeled simple php code what processes this deal.
Just basic php email function and header redirect to 2checkout at the end. see the code:

Â

Â

@extract($_POST);
$name = stripslashes($first_name);
$email = stripslashes($email);
$subject = “Application from Spinnaker College”;
$text .=Â “Course Name: $coursename\n”;
$text .=Â “Weeks: $courseweeks\n”;
$text .=Â “Fisrts name: $first_name\n”;
$text .=Â “Last Name: $last_name\n”;
$text .=Â “Day_Phone_Code: $Day_Phone_Code\n”;
$text .=Â “Day_Phone_Number: $Day_Phone_Number\n”;
$text .=Â “Evening_Phone_Code:$Evening_Phone_Code\n”;
$text .=Â “Evening_Phone_Number:$Evening_Phone_Number\n”;
$text .=Â “Fax_Code:$Fax_Code\n”;
$text .=Â “Fax_Number:$Fax_Number\n”;
$text .=Â “Birthdate:$Birthdate\n”;
$text .=Â “Male_or_female:$Male_or_female\n”;
$text .=Â “Nationality:$Nationality\n”;
// you can add multiple lines with the same $text. = ….
mail(‘zaur@pdesigner.net’,$subject,$text,”From: $name <$email>“);
$location = ‘https://www.2checkout.com/2co/buyer/purchase?sid=471203&cart_order_id=1234592&total=’.$total;
header(”location:$location”);
?>

Â

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

2006 © Web Designers Blog at web.pdesigner.net