Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $total1 = '';
- $qty1 = '';
- $price1 = '';
- if($_SERVER['REQUEST_METHOD'] === 'POST'){
- $qty1 = (int)$_POST['qty1'];
- $price1 = (float)$_POST['price1'];
- $total1 = $qty1 * $price1;
- }
- echo <<<ECHO
- <form method="post">
- <table>
- <tr>
- <th>Qty</th>
- <th>Name</th>
- <th>Description</th>
- <th>Price</th>
- <th>Total</th>
- </tr>
- <tr>
- <td class="qty">
- <input type="text" name="qty1" class="qtybox" value="{$qty1}" />
- </td>
- <td class="items">
- Productname
- </td>
- <td class="descriptions">
- Item Descriptions
- </td>
- <td class="price">
- <input type="text" name="price1" class="pricebox" value="{$price1}" />
- </td>
- <td class="total">
- {$total1}
- </td>
- </tr>
- </table>
- <input type="submit" value="Calculate Totals">
- </form>
- ECHO;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement