473,383 Members | 1,837 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,383 software developers and data experts.

Problem reading the variables from HTML form using PHP

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
7 2141
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
> 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
*** 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
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
*** 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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Krista | last post by:
Hi everybody, I think my confi has some problems. Can you guys help me to see what is going on? i install Apache2.0.48 and Php4.3.4 in WinXP. I add some codes in httpd(inside apache...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
4
by: Martin Ho | last post by:
Hey Everyone, I really hope there is someone who can figure out this problem. Honestly, I spent 3 days now trying to find the solution, but nothing works. I'll try to explain the problem...
6
by: Joseph S. | last post by:
Hi, (1) I have about 8-9 .php files which are far from complex. I first used GET in all of them. Worked fine. Then I changed all method="get" to method="post" and $_GET to $_POST with...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
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...
9
by: Jerim79 | last post by:
Here it is: <?php if($_SERVER=='POST'){ $Number=$_POST; $Email=$_POST; $Number2=0; $error=0;
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
6
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.