Re: Variables not working!
| From: | Ben Ramsey | Date: | Mon, 19 Jan 2004 15:52:46 +0000 |
| Subject: | Re: Variables not working! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175028@lists.php.net to get a copy of this message | ||
Try using $_POST['fname'] instead of $fname. This just means that register_globals is probably set to off in php.ini, which is the recommended setting. Take a look at the section on predefined variables in the PHP manual for more on this: http://www.php.net/manual/en/language.variables.predefined.php
-Ben
Kaushan wrote:
Hi, I am new to PHP scripting and struggling with the following problem. I have two files, an HTML file and a PHP file. HTML file contains a form with one text field and a submit button. When a user pressed the submit button, it calls the php file (<form action="test.php" ...>). What the php file does is just echo back the text received from html file to the user again. Name of the text field is 'fname'. When I used this variable in the php file (as $fname) it does not contain the value of the text field. Query-string appended to the url during the submission is also correct. I checked for all syntax errors, but the codings are perfect. Do I have to change php.ini file to fix this problem. Could anyone can help me to solve this problem. Kaushan