Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problems running PHP.
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


Report this thread to moderator Post Follow-up to this message
Old Post
Jose Arguello
11-22-04 08:57 AM


Re: Problems running PHP.
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
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Gabor Hojtsy
11-22-04 01:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Mirrors archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:23 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.