Newbie error question about variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
blindleaf
Forum Newbie
Posts: 6
Joined: Thu Jun 16, 2005 9:36 am

Newbie error question about variables

Post by blindleaf »

ok i'm going through sams tutorial for mysql and php, and i'm going through one of the practice scripts right now. This script is trying to teach me how forms can work with php and how you can transfer data between pages. I'm getting the following errors on my page once i submit it:


Notice: Undefined variable: tireqty in C:\Server\Apache2\htdocs\sams\processorder.php on line 15
tires

Notice: Undefined variable: oilqty in C:\Server\Apache2\htdocs\sams\processorder.php on line 16
bottles of oil

Notice: Undefined variable: sparkqty in C:\Server\Apache2\htdocs\sams\processorder.php on line 17
spark plugs

can someone take a look at the code i have for my two files: orderform.html and processorder.php and see what i am doing wrong? thanks,

here's links to code for the two files:

orderform.html
processorder.php

hope to get a response, thank you,

Ryan
Revan
Forum Commoner
Posts: 83
Joined: Fri Jul 02, 2004 12:37 am
Location: New Mexico, USA
Contact:

Post by Revan »

Try $_POST["variable"]

Don't get used to using super-global variables, please.
blindleaf
Forum Newbie
Posts: 6
Joined: Thu Jun 16, 2005 9:36 am

Post by blindleaf »

where do i put that code?
Revan
Forum Commoner
Posts: 83
Joined: Fri Jul 02, 2004 12:37 am
Location: New Mexico, USA
Contact:

Post by Revan »

blindleaf wrote:where do i put that code?
Replace it with your super-global variables.

Code: Select all

<?
  echo "<p>Order processed.";
  echo date("H:i, jS F");
  echo "<br>";
  echo "<p>Your order is as follows:";
  echo "<br>";
  echo $_POST["tireqty"]." tires<br>";
  echo $_POST["oilqty"]." bottles of oil<br>";
  echo $_POST["sparkqty"]." spark plugs<br>";
?>
Post Reply