Advertisement
gitlez

Untitled

Nov 25th, 2011
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. $total1 = '';
  4. $qty1 = '';
  5. $price1 = '';
  6.  
  7. if($_SERVER['REQUEST_METHOD'] === 'POST'){
  8.     $qty1 = (int)$_POST['qty1'];
  9.     $price1 = (float)$_POST['price1'];
  10.     $total1 = $qty1 * $price1;
  11. }
  12.  
  13. echo <<<ECHO
  14. <form method="post">
  15.     <table>
  16.         <tr>
  17.             <th>Qty</th>
  18.             <th>Name</th>
  19.             <th>Description</th>
  20.             <th>Price</th>
  21.             <th>Total</th>
  22.         </tr>
  23.         <tr>
  24.             <td class="qty">
  25.                 <input type="text" name="qty1" class="qtybox" value="{$qty1}" />
  26.             </td>
  27.             <td class="items">
  28.                 Productname
  29.             </td>
  30.             <td class="descriptions">
  31.                 Item Descriptions
  32.             </td>
  33.             <td class="price">
  34.                 <input type="text" name="price1" class="pricebox" value="{$price1}" />
  35.             </td>
  36.             <td class="total">
  37.                 {$total1}
  38.             </td>
  39.         </tr>
  40.     </table>
  41.     <input type="submit" value="Calculate Totals">
  42. </form>
  43. ECHO;
  44.  
  45. ?>
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement