Home > Archive > PHP Mirrors > November 2004 > Problems running PHP.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problems running PHP.
|
|
| Jose Arguello 2004-11-22, 3:57 am |
| I just install in my computer PHP 5.0.2, I followed
the instruction on the book PHP and MySql Web
Development by Luke Welling and Laura Thomson.
But, it is not working. I have tried to use this
codes, one is just a html form and the other is a php
code. I tried to pass the values from the form to the
php code but it is not getting the values.
HTML Form:
<form action="proccessorder.php" method="GET">
<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"
maxlenght="3" /></td>
</tr>
<tr>
<td>Oil</td>
<td aling="center"><div align="center">
<input type="text" name="oilqty" size="3"
maxlenght="3" />
</div></td>
</tr>
<tr>
<td>Spark Plugs</td>
<td aling="center"><div align="center">
<input type="text" name="sparkqty" size="3"
maxlenght="3" />
</div></td>
</tr>
<tr>
<td colspan="2" align="center"><input
type="submit" value="Submit Order" /></td>
</tr>
</table>
</form>
Php Code:
<?php
// variables para capturar desde la orderform
$tireqty = $HTTP_GET_VARS['tireqty'];
$oilqty = $HTTP_GET_VARS['oilqty'];
$sparkqty = $HTTP_GET_VARS['sparkqty'];
?>
<html>
<head>
<title>Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<?php
echo '<p>Order pordessed at ';
echo date('H:i, jS F');
echo '</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>
I am sure that this code works because I tried it on a
server who is running php 4.0, I know that in php
5.0.2, I can use $_POST and $_GET instead of
$HTTP_GET_VARS or $HTTP_POST_VARS. But, I have tried
them and they are not working.
So, I hope you can help me to fix it, because I really
want to learn how to program with PHP.
Best Regards,
Jose
__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com
| |
| Gabor Hojtsy 2004-11-22, 8:56 am |
| Hi Jose,
Since your report is not about the php.net website, this is not the
right address to send it. Please consult php-general@lists.php.net for
support questions.
Regards,
Gabor Hojtsy
Jose Arguello írta:
> I just install in my computer PHP 5.0.2, I followed
> the instruction on the book PHP and MySql Web
> Development by Luke Welling and Laura Thomson.
> But, it is not working. I have tried to use this
> codes, one is just a html form and the other is a php
> code. I tried to pass the values from the form to the
> php code but it is not getting the values.
>
> HTML Form:
>
> <form action="proccessorder.php" method="GET">
> <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"
> maxlenght="3" /></td>
> </tr>
> <tr>
> <td>Oil</td>
> <td aling="center"><div align="center">
> <input type="text" name="oilqty" size="3"
> maxlenght="3" />
> </div></td>
> </tr>
> <tr>
> <td>Spark Plugs</td>
> <td aling="center"><div align="center">
> <input type="text" name="sparkqty" size="3"
> maxlenght="3" />
> </div></td>
> </tr>
> <tr>
> <td colspan="2" align="center"><input
> type="submit" value="Submit Order" /></td>
> </tr>
> </table>
> </form>
>
> Php Code:
>
> <?php
> // variables para capturar desde la orderform
> $tireqty = $HTTP_GET_VARS['tireqty'];
> $oilqty = $HTTP_GET_VARS['oilqty'];
> $sparkqty = $HTTP_GET_VARS['sparkqty'];
> ?>
>
> <html>
> <head>
> <title>Bob's Auto Parts - Order Results</title>
> </head>
> <body>
> <h1>Bob's Auto Parts</h1>
> <h2>Order Results</h2>
> <?php
> echo '<p>Order pordessed at ';
> echo date('H:i, jS F');
> echo '</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>
>
>
> I am sure that this code works because I tried it on a
> server who is running php 4.0, I know that in php
> 5.0.2, I can use $_POST and $_GET instead of
> $HTTP_GET_VARS or $HTTP_POST_VARS. But, I have tried
> them and they are not working.
> So, I hope you can help me to fix it, because I really
> want to learn how to program with PHP.
>
> Best Regards,
> Jose
>
>
>
> __________________________________
> Do you Yahoo!?
> Meet the all-new My Yahoo! - Try it today!
> http://my.yahoo.com
>
>
|
|
|
|
|