Re: Somebody please help beginner with variable problem
| From: | Si Ming | Date: | Thu, 06 Jun 2002 17:32:25 +0000 |
| Subject: | Re: Somebody please help beginner with variable problem | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-14157@lists.php.net to get a copy of this message | ||
I have tried "<?php" it didn't help. I think Michael Davey was right in
that I have a problem with my config somewhere... But I have no idea what
the config problem is.
"Michael Davey" <mikey@splatted.net> wrote in message
news:20020530214411.378.qmail@pb1.pair.com...
> Hmm - I would check your config again as I have just run your code on my
> server and it works without any problems...
>
> regards,
>
> Mikey
>
> "Sim" <siming@sympatico.ca> wrote in message
> news:000001c2081c$ac9b7190$6401a8c0@athlon...
> > Hi,
> >
> > Please don't reply with RTFM. I just installed Apache 2.0.36 and PHP
> > 4.2 in Win XP Pro. Apache is running fine */localhost/ is working* and
> > <? phpinfo() ?> is showing the config. I have set register_globals =
> > On. So I practice following the source code from the book (and even
> > used the book's files), it seems that the form (in html) does not pass
> > the variable to the php file, all I can see is the html with the current
> > time (**echo date("H:i, jS F"); **). So if I can see the time output in
> > html that means PHP is working but why aren't the variables
> > passed/shown? I have been looking all over the mailing lists and I
> > can't find anybody with the exact same problem.
> >
> > --------------
> > HTML FILE:
> > --------------
> > <html>
> > <head>
> > <title>Bob's Auto Parts</title>
> > </head>
> > <body>
> > <h1>Bob's Auto Parts</h1>
> > <h2>Order Form</h2>
> >
> > <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>
> > </body>
> > </html>
> >
> > -------------------
> > PHP FILE:
> > -------------------
> > <html>
> > <head>
> > <title>Bob's Auto Parts - Order Results</title>
> > </head>
> > <body>
> > <h1>Bob's Auto Parts</h1>
> > <h2>Order Results</h2>
> > <?
> > echo "<p>Order processed at "; // Start printing order
> >
> > echo date("H:i, jS F");
> > echo "<br>";
> > echo "<p>Your order is as follows:";
> > echo "<br>";
> > echo $tyreqty." tyres<br>";
> > echo $oilqty." bottles of oil<br>";
> > echo $sparkqty." spark plugs<br>";
> >
> > $totalqty = 0;
> > $totalamount = 0.00;
> >
> > define("TYREPRICE", 100);
> > define("OILPRICE", 10);
> > define("SPARKPRICE", 4);
> >
> > $totalqty = $tyreqty + $oilqty + $sparkqty;
> > $totalamount = $tyreqty * TYREPRICE
> > + $oilqty * OILPRICE
> > + $sparkqty * SPARKPRICE;
> >
> > echo "<br>\n";
> > echo "Items ordered: ".$totalqty."<br>\n";
> > echo "Subtotal: $";
> > echo number_format($totalamount, 2);
> > echo "<br>\n";
> >
> > $taxrate = 0.10; // local sales tax is 10%
> > $totalamount = $totalamount * (1 + $taxrate);
> > $totalamount = number_format($totalamount, 2);
> > echo "Total including tax: $".$totalamount."<br>\n";
> >
> > ?>
> > </body>
> > </html>
> > -----------------
> > Result:
> > -----------------
> >
> >
> > Bob's Auto Parts
> >
> >
> > Order Results
> >
> > Order processed at 16:54, 30th May
> > Your order is as follows:
> > tyres
> > bottles of oil
> > spark plugs
> >
> > Items ordered: 0
> > Subtotal: $0.00
> > Total including tax: $0.00
> >
> > Sim
> >
> >
>
>