Submit twice in jquery ot php?
<p>Hi I have a form  in php which has a action and it goes to itself thus produces the results to the user which is what I want, however I want the user to have the option to click a button which will then go to the thank-you.php page which sends the information off to a admin.</p>

<p>I have been thinking about it but perhaps im over complicating it by having one form in another?</p>

<p>This is my form so far:</p>

<pre><code>&lt;?php
$data = array("Benalmadena"=&gt;10,"Fuengirola"=&gt;20,"Mijas"=&gt;30,"La Cala"=&gt;10,"Calahonda"=&gt;15,
"Marbella"=&gt;20,"Puerto Banus"=&gt;25,"San Pedro"=&gt;30,"Estepona"=&gt;40, "Nerja"=&gt;12);


error_reporting(E_ALL);

if(isset($_POST['name']) &amp;&amp; isset($_POST['to'])){

ini_set('date.timezone', 'Europe/Madrid');
$now = date("H:i");

$cutoff = "06:00";
$higherthan = "22:00";


$name = $_REQUEST['name'];
$telephone = $_REQUEST['telephone'];
$from = $_REQUEST['from'];
$to = $_REQUEST['to'];
$date = $_REQUEST['date'];
$returndate = $_REQUEST['returndate'];
$people = $_REQUEST['people'];
$return = $_REQUEST['return'];
$myemail = $_REQUEST['myemail'];

include_once('includes/config.php');

$settingsSql = mysql_query("SELECT * FROM transfers_in WHERE location='$to' AND no_passengers='$people'");
$settings        = mysql_fetch_assoc($settingsSql);

echo "From: ".$from." To: ".$settings['location']."&lt;br /&gt;";
echo "Number of passengers: ".$settings['no_passengers']."&lt;br /&gt;";

ini_set('date.timezone', 'Europe/Madrid');
$now = date("H:i");

$cutoff = "06:00";
$higherthan = "22:00";

echo "Time cost: ".$settings['price']." euros&lt;br /&gt;&lt;hr /&gt;Total: ";



    function timeCost() {

        $to = $_REQUEST['to'];
        $people = $_REQUEST['people'];
        $return = $_REQUEST['return'];

        include_once('includes/config.php');

        $settingsSql = mysql_query("SELECT * FROM transfers_in WHERE location='$to' AND no_passengers='$people'");
        $settings        = mysql_fetch_assoc($settingsSql);

        //echo $return;

        if ($return == "No"){
            if ((strtotime($now) &lt; strtotime($cutoff)) || (strtotime($now) &gt; strtotime($higherthan))){
                return number_format($settings['price']) + 1.40;
            } else {
                return number_format($settings['price']) + 0.00;
            }
        } elseif ($return == "Yes") {
            if ((strtotime($now) &lt; strtotime($cutoff)) || (strtotime($now) &gt; strtotime($higherthan))){
                return number_format($settings['price']) * 2 + 1.40;
            } else {
                return number_format($settings['price']) * 2 + 0.00;
            }
        }   

    }


    session_start();

    $_SESSION['timeCost'] = timeCost();

    echo timeCost()." in euros&lt;br /&gt;&lt;br /&gt;";

    echo "&lt;div class='fauxButton' id='sendInfo'&gt;&lt;/div&gt;";


} else {
?&gt;

&lt;form method="POST" action="#" name="chooseDateForm" id="chooseDateForm"&gt;
            &lt;label&gt;Name:&lt;/label&gt;
            &lt;input type="text" value="" name="name" /&gt;

            &lt;label&gt;Telephone:&lt;/label&gt;
            &lt;input type="text" value="" name="telephone" /&gt;

            &lt;label&gt;Email:&lt;/label&gt;
            &lt;input type="text" value="" name="myemail" /&gt;

            &lt;label&gt;From:&lt;/label&gt;
            &lt;select name="from"&gt;
                &lt;option selected="selected"&gt;Malaga&lt;/option&gt;
            &lt;/select&gt;
            &lt;div class="clr"&gt;&lt;/div&gt;

            &lt;label&gt;To:&lt;/label&gt;
            &lt;select name="to"&gt;

&lt;?php foreach ($data as $place =&gt; $price){
    echo "&lt;option&gt;{$place}&lt;/option&gt;\n";
}
echo '&lt;/select&gt;
            &lt;div class="clr"&gt;&lt;/div&gt;

            &lt;label&gt;Date:&lt;/label&gt;
            &lt;input type="text" value="dd/mm/yyyy" id="date" name="date" class="date-pick" /&gt;
            &lt;span id="calendar"&gt;&lt;/span&gt;

            &lt;div id="return-journey"&gt;
                &lt;label&gt;Return Date:&lt;/label&gt;
                &lt;input type="text" value="dd/mm/yyyy" id="returndate" name="returndate" class="date-pick" /&gt;
                &lt;span id="calendar"&gt;&lt;/span&gt;
            &lt;/div&gt;

            &lt;label&gt;Number of people:&lt;/label&gt;
            &lt;select id="people" name="people"&gt;
                &lt;option value="4"&gt;4&lt;/option&gt;
                &lt;option value="6"&gt;6&lt;/option&gt;
                &lt;option value="8"&gt;8&lt;/option&gt;
            &lt;/select&gt;
            &lt;div class="clr"&gt;&lt;/div&gt;

            &lt;div id="return"&gt;
                &lt;label&gt;Is this a return&lt;br /&gt;journey?&lt;/label&gt;
                &lt;div class="clr"&gt;&lt;/div&gt;
                &lt;div id="radio-buttons"&gt;
                    &lt;input type="radio" name="return" value="Yes" class="radio returning" /&gt;Yes&lt;br /&gt;
                    &lt;input type="radio" name="return" value="No" class="radio" checked /&gt;No
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="clr"&gt;&lt;/div&gt;


            &lt;input type="submit" name="submit" class="fauxButton" /&gt;            

        &lt;/form&gt;';
}
?&gt;
</code></pre>

<p>I added this:</p>

<pre><code>&lt;div class='fauxButton' id='sendInfo'&gt;&lt;/div&gt;
</code></pre>

<p>but as the form has already been sent I cannot change the action in jQuery, I don't know much about jQuery or PHP so if anyone could advise/help please do.</p>

<p>thanks</p>
