This is a discussion on Problem reading the variables from HTML form using PHP within the PHP Language forums, part of the PHP Programming Forums category; Hello friends. I am using PHP(standalone program and not as Apache module) with Apache Server. My Problem is that ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello friends.
I am using PHP(standalone program and not as Apache module) with Apache Server. My Problem is that i am not able to read the HTML form's variable.. Form' Code Snippet ================== <B>Name:</B> <INPUT TYPE="text" SIZE="40" NAME=name> <BR> PHP Script's code snippet ========================== <?php echo ($name); ?> |
|
|||
|
On 6 Jun 2004 01:11:16 -0700, themanavsharma@hotmail.com (Manav
Sharma) wrote: >PHP Script's code snippet >========================== > <?php > echo ($name); > ?> try echo $_POST['name']; Regards Marian -- Internet-Dienstleistungen - von der Webseite bis zum Online-Shop http://www.heddesheimer.de mailto:marian@heddesheimer.de |
|
|||
|
> echo $_POST['name'];
> > the above code isnt working either... the problem is one sided. PHP script can send date and time stuff to the client but ... it is not able to read <FORM> data coming from the client.. |
|
|||
|
*** Manav Sharma wrote/escribió (7 Jun 2004 08:28:21 -0700):
>> echo $_POST['name']; >> >> the above code isnt working either... > > the problem is one sided. PHP script can send date and time stuff to > the client but ... > > > it is not able to read <FORM> data coming from the client.. Then try: echo $_GET['name']; -- -- -- Álvaro G. Vicario - Burgos, Spain -- |
|
|||
|
HELLO FRIENDS.....
THE PROBLEM HAS BEEN SORTED OUT. THERE WAS THIS TYPICAL CONFIGURATION PROBLEM WITH PHP..... I HAVE FIXED IT AND NOW IT IS WORKING PERFECTLY! THANKS FOR YOUR HELP... THE COMMUNITY FEELING IS AMAZING :)..... BELOW IS THE PROBLEM WHICH I FIXED...... ================================================== ================ There is a word called 'register_globals' in the php.ini file. By default this word has been assigned a value of 'off' ie. register_globals= off Change the above line to 'register_globals = on' and save the file. |
|
|||
|
*** Manav Sharma wrote/escribió (8 Jun 2004 07:42:30 -0700):
> Change the above line to 'register_globals = on' and save the file. Bad idea. There is a reason why register_globals is set to off by default. You'd better fix you scripts instead so they don't depend on running in an insecure server. Use $_GET, $_POST and $_SESSION. -- -- -- Álvaro G. Vicario - Burgos, Spain -- |
|
|||
|
ugh... It's off by default for a reason.
you should explicitly use the $_GET and $_POST arrays themanavsharma@hotmail.com (Manav Sharma) wrote in message news:<1e2c8fef.0406080642.30573f0f@posting.google. com>... > HELLO FRIENDS..... > THE PROBLEM HAS BEEN SORTED OUT. > > THERE WAS THIS TYPICAL CONFIGURATION PROBLEM WITH PHP..... I HAVE > FIXED IT AND NOW IT IS WORKING PERFECTLY! THANKS FOR YOUR HELP... THE > COMMUNITY FEELING IS AMAZING :)..... BELOW IS THE PROBLEM WHICH I > FIXED...... > > ================================================== ================ > > There is a word called 'register_globals' in the php.ini file. > By default this word has been assigned a value of 'off' > ie. register_globals= off > > Change the above line to 'register_globals = on' and save the file. |
|
|||
|
Thanks Mr. Brad for the advice.
Now i understand , why the register_globals is set to off by default. But there is a terrible problem here. For beginners, all these contraints does not matter in the initial stage of the learning curve and thus only because of this, novice users cant even take few steps in the direction of learning. So i think , this feature can be turned on for the time being. Details can follow :) But thanks a lot for your advice. Take Care :) Regards... Manav |