Jump to content

PHP not displaying in browser


johne281

Recommended Posts

Hi I am learning php and i have a problem. The code i have written so far is not displaying. The title is visible at the top of the page so i know it is reading the file but nothing displays on the page itself. Here is my code:

 

<html>
    <head>
        <title>Bob's Auto Parts - Order Results</title>
    </head>
    <?php
    //create short variable names
    $tireqty = $_POST('tireqty');
    $oilqty = $_POST('oilqty');
    $sparkqty = $_POST('sparkqty')
    ?>
    <body>
        <h1>Bob's Auto Parts</h1>
        <h2>Order Results</h2>
        <?php
        echo "<p>Order processed at ".date('H:i, js FY')."</p>";
        echo '<p>Your order is as follows: </p>';
        echo $tireqty.' tires<br/>';
        echo $oilqty.' bottles of oil<br/>';
        echo $sparkqty. ' spark plugs<br/>'
        ?>
    </body>
</html>

 

It is linked to an order form and everything was working fine earlier. But i dont know whats going on now,

Link to comment
https://forums.phpfreaks.com/topic/165293-php-not-displaying-in-browser/
Share on other sites

Here is the code for the order form.

 

<html>
<head><title>Bob's Auto Parts</title></head>
<body>
<form action="processorder.php" method="post">
<table border="0">
<tr bgcolor="#cccccc">
  <td width="150">Item</td>
  <td width="15">Quantity</td>
</tr>
<tr>
  <td>Tires</td>
  <td align="center"><input type="text" name="tireqty" size="3"
     maxlength="3" /></td>
</tr>
<tr>
  <td>Oil</td>
  <td align="center"><input type="text" name="oilqty" size="3" 
     maxlength="3" /></td>
</tr>
<tr>
  <td>Spark Plugs</td>
  <td align="center"><input type="text" name="sparkqty" size="3"
     maxlength="3" /></td>
</tr>
<tr>
  <td>How did you find Bob's?</td>
  <td><select name="find">
        <option value = "a">I'm a regular customer</option>
        <option value = "b">TV advertising</option>
        <option value = "c">Phone directory</option>
        <option value = "d">Word of mouth</option>
      </select>
  </td>
</tr>
<tr>
  <td colspan="2" align="center"><input type="submit" value="Submit Order" /></td>
</tr>
</table>
</form>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.