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
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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.