Jump to content

Can not pass form variables


Kimp

Recommended Posts

Hi,

 

Am just starting out with PHP.  Have a small HTML form that collects user data, then calls a php file to print the form variable.  Problem is that the variable is always blank.  (Have tried GET, POST, REQUEST).  Is there some setting in my php ini that I need to change, perhaps?  Belos is the code:

 

HTML:

 

<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>Tyres</td>

    <td align="center"> <input type="text" name="tyreqty" 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 colspan="2" align="center"><input type="submit" value="Submit Order"/></td> </tr>

  </table>

  </form>

 

PHP:

 

<html>

<head>

  <title>Order Results</title>

</head>

<body>

  <h1>Order Results</h1>

  <?php

$tyreqty = $_POST[‘tyreqty’];

echo $tyreqty;

  ?>

</body>

</html>

 

Link to comment
https://forums.phpfreaks.com/topic/199459-can-not-pass-form-variables/
Share on other sites

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.