0

I've created a three step order form and I need help with the third step. 1. form is filled out by the business and clicks on "preview order" 2. business views their order and clicks "confirm" (should be on "bizform.php" but I haven't tried it because I have no clue on how to do it.) 3. by clicking "confirm" the "Web page" or data from "bizform.php" is sent to the business and myself.

Questions: Is it possible? If so, can you point me in the right direction? TYVM

My form:

    <div class="span4 diff">
    <h3>Business Information</h3>
    <br/>
    <form action="bizform.php" method="post">
    <label for="bizName" class="control-label">
    Business:</label>
    <input type="text" id="bizName" name="bizName" class="input-large">

    <label for="bizAddress" class="control-label">
    Business Address:</label>
    <input type="text" id="bizAddress" name="bizAddress" class="input-large">

    <label for="bizCity" class="control-label">
    City:</label>
    <input type="text" id="bizCity" name="bizCity" class="input-large">

    <label for="bizState" class="control-label">
    State:</label>
    <input type="text" id="bizState" name="bizState" class="input-large">

    <label for="bizZip" class="control-label">
    Zip code:</label>
    <input type="text" id="bizZip" name="bizZip" class="input-large">

    <label for="fullName" class="control-label">
    Full Name:</label>
    <input type="text" id="fullName" name="fullName" class="input-large">

    <label for="bizEmail" class="control-label">
    E-mail:</label>
    <input type="text" id="bizEmail" name="bizEmail" class="input-large">
    </div>
    <div class="span7">
    <h3>Choose Products</h3>
    <br/>
    <table class="table table-bordered table-striped">
    <thead>
    <tr class="diffhead">
    <th>Product</th>
    <th>Price</th>
    <th>Training</th>
    <th>Total</th>
    <th>Qty</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>Product One</td>
    <td>$1000.00</td>
    <td>$100.00</td>
    <td>$1100.00</td>
    <td>
    <label class="input" for="productOne"></label>
    <input type="text" class="input-mini" value="0" id="productOne" name="productOne">
    </td>
    </tr>
    <tr>
    <td>Product Two</td>
    <td>$1000.00</td>
    <td>$100.00</td>
    <td>$1100.00</td>
    <td>
    <label class="input" for="productTwo"></label>
    <input type="text" class="input-mini" value="0" id="productTwo" name="productTwo">
    </td>
    </tr>
    <tr>
    <td>Product Three</td>
    <td>$1000.00</td>
    <td>$100.00</td>
    <td>$1100.00</td>
    <td>
    <label class="input" for="productThree"></label>
    <input type="text" class="input-mini" value="0" id="productThree" name="productThree">
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    </div>
    <div class="form-actions">
    <button class="btn btn-danger" type="reset" style="float:left">
    <i class="icon-remove-sign icon-white"></i> Cancel Order</button>
    <button class="btn btn-primary" type="submit" style="float:right">Preview Order 
    <i class="icon-circle-arrow-right icon-white"></i></button>
    </form>
    <?php
    include '_inc/footer.html';
    ?>

My form processor:

        <?php
    include '_inc/header.html';
    ?>
    <?php 

    $bizName = $_POST['bizName'];
    $bizAddress = $_POST['bizAddress'];
    $bizCity = $_POST['bizCity'];
    $bizState = $_POST['bizState'];
    $bizZip = $_POST['bizZip'];
    $fullName = $_POST['fullName'];
    $bizEmail = $_POST['bizEmail'];

    $productOne = $_POST['productOne'];
    $productTwo = $_POST['productTwo'];
    $productThree = $_POST['productThree'];


    $moneyOff = '';

    $totalPro = $productOne + $productTwo + $productThree;

    define('PRODPRICE', 1100);

    $totalMoney = $productOne * PRODPRICE
    + $productTwo * PRODPRICE
    + $productThree * PRODPRICE;

    if ( $totalMoney == 2200 )
    {
    echo '<div class="alert alert-success">Go Back! You can get a product for free!</div>';
    }

    if ( $totalMoney == 3300 )
    {
    $moneyOff = 1100;
    }
    else
    {
    $moneyOff = 0;
    }


    define('STOCKFEE', 10);
    $stockFee = $productOne * STOCKFEE
    + $productTwo * STOCKFEE
    + $productThree * STOCKFEE;

    ?>
    <h1 align="center">Order Agreement</h1>
    <br/>
    <?php 
    echo '<strong>' .$bizName. '</strong> is purchasing the following products and services from CBE:</p>';
    echo '<div class="well">
    <table cellspacing="0" cellpadding="0" width="800px">
    <thead>
    <th>Qty</th>
    <th>Product</th>
    <th>Price</th>
    </thead>
    <tbody>
    <tr>
    <td align="center">'. $productOne .'</td>
    <td align="center">Product One</td>
    <td align="center">$1,100.00</td>
    </tr>
    <tr>
    <td align="center">'. $productTwo .'</td>
    <td align="center">Product Two</td>
    <td align="center">$1,100.00</td>
    </tr>
    <tr>
    <td align="center">'. $productThree .'</td>
    <td align="center">Product Three</td>
    <td align="center">$1,100.00</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td align="right">Sub Total:</td>
    <td align="center">'.number_format($totalMoney,2).'</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td align="right">Discount:</td>
    <td align="center">'.number_format($moneyOff,2).'</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td align="right">Grand Total:</td>
    <td align="center">'.number_format($totalMoney - $moneyOff,2).'</td>
    </tr>
    </tbody>
    </table>
    </div>';
    echo '<p>Business agrees to pay <strong> '.number_format($totalMoney - $moneyOff,2).' </strong>for these products and services. In addition, Business will pay an additional <strong> '.number_format($stockFee,2).' </strong>to cover stock fee.</p>';
    ?>
    <div class="row">&nbsp;</div>
    <div class="row">
    <div align="left">
    <table cellspacing="10" cellpadding="10" width="850px">
    <tbody>
    <tr><td>&nbsp;</td></tr>
    <tr>
    <td valign="top">
    <?php 
    echo '<strong>' .$bizName. '</strong> <br/>';
    echo $bizAddress.'<br/>';
    echo $bizCity.', ';
    echo $bizState.' ';
    echo $bizZip.'';
    ?>
    </td>
    <td valign="top">
    <strong>CBE</strong><br/>
    Corporate Headquarters<br/>
    555 Main Street<br/>
    PHPLAND, DB 78987-3849<br/>
    888-098-3049
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    </div>
    <?php
    include '_inc/footer.html';
    ?>
4

3 に答える 3

0

複数のフォームにまたがってデータを保存するには:

<?php
  session_start(); // Initiates the session, and loads the _SESSION variable

  var_dump($_SESSION); // Show the data in the _SESSION variable

  // Load data into the sessions
  $_SESSION['a'] = 1;
  $_SESSION['b'] = 'hello world';

  if (!isset($_SESSION['c'])) $_SESSION['c'] = 0;
  else $_SESSION['c'] += 2;

最初は、空の配列が表示されます。次に、更新すると、セッションデータが表示されます。

http://php.net/manual/en/features.sessions.php-参照およびさらなる教育のために...

于 2012-06-18T19:58:33.313 に答える
0

フォームを bizform.php に送信するときは、ポスト変数を非表示の入力フィールドに保存し、ステップ 3 でフォーム プロセッサに送信します。

編集:

つまり、Confirm プロセスで、非表示フィールドを別のプロセッサにポストして、POST から電子メール コンテンツを作成し、CC または BCC ヘッダーとしてビジネスに送信し、自分自身に送信します。

<input name="AID" type="hidden" id="AID" value="<?php echo $_POST['AID']; ?>" size="32" />
于 2012-06-18T19:54:25.277 に答える
0

$_POST 配列を介してデータに簡単にアクセスできるため、このすべての情報をそれぞれの受信者に送信するにmail()は、php の関数を使用して電子メールを作成し、必要な人に送信します。

于 2012-06-18T19:55:49.003 に答える