473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

PHP not getting variables in HTML forms

Hi,

Just installed PHP, and Apache. Am having problems with the PHP to
get form data from an HTML file. Specifically, I can not obtain the
variable "tireqty" in a PHP file called by an HTML file. The files'
contents are listed as follow:

-----------------------------
The following is the HTML file
-----------------------------
<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>Tires</td>
<td align=center><input type="text" name="tireqty" size=3
maxlength=3></td>
</tr>
<tr>
<td colspan=2 align=center><input type=submit value="Submit
Order"></td>
</tr>
</table>
</form>
-----------------------------
The following is the PHP file 'processorder.php'
-----------------------------
<html>
<head>
<title>abcd</title>
</head>
<body>
<?
echo $tireqty." tires<br>";
?>
</body>
</html>
-----------------------------
I know PHP and Apache are working becasue I am able to to have an HTML
page to load a PHP page to do a for loop and use the "echo" function
to print the loop iterations. So I'm not sure why PHP can't access
the variable "tireqty". Is there some settings in the PHP engine that
I need to check for this?

Thanks
Jul 17 '05 #1
1 2783
Titus wrote:
Specifically, I can not obtain the
variable "tireqty" in a PHP file called by an HTML file. -----------------------------
The following is the HTML file
-----------------------------
<form action="processorder.php" method=post>
<input type="text" name="tireqty" size=3
maxlength=3>
<input type=submit value="Submit
Order">
</form>
-----------------------------
The following is the PHP file 'processorder.php'
-----------------------------
<?
echo $tireqty." tires<br>";
?>
----------------------------- I'm not sure why PHP can't access
the variable "tireqty". Is there some settings in the PHP engine that
I need to check for this?


echo $_POST['tireqty']." tires<br>";

register_globals:
http://us3.php.net/register_globals

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jenkins | last post by:
I've loaded various thoughts I've collected into mysql. I want to write an app, all in one file, that has the following features: 1. On initial entry, selects and displays the thoughts ( might...
2
by: Ed | last post by:
I need to know how to pass variables because I want to use the same function to varify multiple data imput boxes. Please tell me what's wrong with this code. <head> <script...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
4
by: gimme_this_gimme_that | last post by:
Hi, This is sort of a : How to build a Yes/No dialog box qquestion. Or perhaps a question about getting javascript variables from a pop-up window and processing them on a submit. This is...
15
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
1
by: Paradox | last post by:
Hi everyone, kinda new to Javascript. Here is the issue, I have a form that sends to a different action based on the button pushed. But it also is sending variables to the server as well. Here...
3
by: misra.manisha | last post by:
Hi, I am using frames (I know that its not a good practice, but I have to). Each of these frames have separate form variables, all of which are needed in the parent frame. Now, the problem is...
3
by: JohnGos | last post by:
Since around 10th May (a couple of days after the recent IE autoupdate), a web application which has worked without problem for several years has developed intermittent problems with data posted from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.