By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,149 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

Problem reading the variables from HTML form using PHP

P: n/a
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);
?>
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On 6 Jun 2004 01:11:16 -0700, th************@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:ma****@heddesheimer.de
Jul 17 '05 #2

P: n/a
> 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..
Jul 17 '05 #3

P: n/a
*** 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
--
Jul 17 '05 #4

P: n/a
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.
Jul 17 '05 #5

P: n/a
*** 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
--
Jul 17 '05 #6

P: n/a
ugh... It's off by default for a reason.
you should explicitly use the $_GET and $_POST arrays

th************@hotmail.com (Manav Sharma) wrote in message news:<1e**************************@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.

Jul 17 '05 #7

P: n/a
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
Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.