• Simple Email form + 2checkout

    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”);
    ?>

    Β