PHP Form with PayPal
<p>Looking for a bit of direction to build a PHP form that will be split into 2 parts and ends with a user purchasing a product using PayPal.</p>

<p>The first stage asks a series of questions such as name, address, email etc. It will also ask a simple question with a series of radio buttons, if they choose none then the user will be told that someone will be in touch and end there, if they choose one of the other options then they will be taken to stage two.</p>

<p>Regardless of the options chosen at this point all info from stage 1 will be sent via email.</p>

<p>The second stage basically gets the users PayPal info.</p>

<p>thanks</p>

<p>UPDATE:</p>

<p>I've simplified this considerably, so now there is just one form which will grab the data and send it to an email, and then depending on there choice of radio button either show the message or send them to PayPal.</p>

<p>I need help with checking the radio option and showing the message/redirecting to PayPal, and sending the info to an email address. And also sending the info to PayPal.</p>

<p>The code is as follows:</p>

<pre><code>&lt;?php if(isset($_POST['submit']))

    {

        $to = "info@solidcamxpress.co.uk";
        $subject = "SolidCAM Xpress";

        $name_field = $_POST['name'];
        $email_field = $_POST['email'];
        $phone_field = $_POST['message'];
        $company_field = $_POST['company'];
        $reseller_field = $_POST['reseller'];

        $body = "From: $name_field\n E-Mail: $email_field\n Phone:\n $phone_field\n Company:\n $company_field\n Reseller:\n $reseller_field";

        mail($to, $subject, $body);

    }

    else {

    ?&gt;

    &lt;form method="POST" action=""&gt;

        &lt;fieldset&gt;
            &lt;legend&gt;Purchase SolidCAM Xpress&lt;/legend&gt;

            &lt;ul&gt;
                &lt;li&gt;&lt;label for="name"&gt;Name &lt;input type="text" name="name" /&gt;&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for="email"&gt;Email &lt;input type="text" name="email" /&gt;&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for="phone"&gt;Phone &lt;input type="text" name="phone" /&gt;&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for="company"&gt;Company &lt;input type="text" name="company" /&gt;&lt;/label&gt;&lt;/li&gt;
            &lt;/ul&gt;

            &lt;p&gt;Do you currently have SolidWorks, if yes who is your reseller?&lt;/p&gt;
            &lt;ul&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="None" /&gt; Don't have SolidWorks&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="Cad Connect" /&gt; Cad Connect&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="Cadtek" /&gt; Cadtek&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="CCSL" /&gt; CCSL&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="Innova" /&gt; Innova&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="NT CAD/CAM" /&gt; NT CAD/CAM&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="Solid Engineer" /&gt; Solid Engineer&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="Solid Solutions Ireland" /&gt; Solid Solutions Ireland&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="Solid Solutions Management" /&gt; Solid Solutions Management&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label for=""&gt;&lt;input type="radio" name="reseller" value="TMS Scotland" /&gt; TMS Scotland&lt;/label&gt;&lt;/li&gt;
            &lt;/ul&gt;

            &lt;p&gt;&lt;input type="submit" name="continue" value="Continue" /&gt;&lt;/p&gt;

        &lt;/fieldset&gt;

    &lt;/form&gt;

    &lt;?php

    }

    // When user clicks continue send all data to info@solidcamxpress.co.uk

    // Then check if user has selected None from the last question then show the following and prevent them from proceeding

    if() {

    ?&gt;

    &lt;p&gt;SolidCAM Xpress requires a valid copy of SolidWorks, we will be in touch shortly to discuss pricing!&lt;/p&gt;

    &lt;?php

    } else {

        // User has selected something other than None, send them off to PayPal

    }

    ?&gt;
</code></pre>
