Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Warning: Undefined variable: _POST !!!

Status
Not open for further replies.

vbkris

Programmer
Joined
Jan 20, 2003
Messages
5,994
Location
IN
i have PHP 4.3.2
when i used the followring code it gives me the above error:
<?
include &quot;connect.php&quot;;
$name=$_POST['name'];
$pwd=$_POST[&quot;pwd&quot;];
?>

and hints?

Known is handfull, Unknown is worldfull
 
Code:
# wrong:
$pwd=$_POST&quot;pwd&quot;;
# right:
$pwd=$_POST
Code:
[
Code:
'pwd'
Code:
]
Code:
;

Or did something get lost in TGML?
 
DRJ478:
Some thing got lost in TGML.

The string &quot;[ignore][&quot;foo&quot;][/ignore]&quot; will cause TGML to drop the brackets I had to use ignore tags to get it to show them at all. Single quotes TGML leaves alone. Go figure.


vbkris:
Always put code snippets inside of TGML [ignore]
Code:
...
[/ignore] tags to prevent your typography from getting messed up.

Is that the exact error message you're getting?

Want the best answers? Ask the best questions: TANSTAAFL!!
 
o.k:
Code:
<?
include &quot;connect.php&quot;;
$name=$_POST['name'];
?>

i have removed the pwd line as the error points to line number 3...

Known is handfull, Unknown is worldfull
 
Again, what is the exact error message you are getting?

Also, what is your PHP version?

It's possible that $_POST does not exist. The superglobal variables were introduced in PHP version 4.1.0, so if your version is older than that, you'll have to use $HTTP_POST_VARS instead.



Want the best answers? Ask the best questions: TANSTAAFL!!
 
i have PHP4.3.2 and the strange thing is that even $HTTP_POST_VARS doesnt work!!! no global variables are working. another strange thing is that when i start my apache a dos console opens with the title apache. but the minute i run a php file the console's title changes to &quot;php&quot;. and my system free resources dropws from 72% to 54%...

Known is handfull, Unknown is worldfull
 
by a simple form submit. i have a html file that asks for username(the form code is correct, its method is post and it submits to this PHP file).

my connect.php has info to connect to the database(access - using COM). after that i use the $_POST to retrieve the username. i am absoluetly stumped...

Known is handfull, Unknown is worldfull
 
hi,
sorry for the late response. i will try that...

Known is handfull, Unknown is worldfull
 
o.k, sorry for the late response again. i couldnt get to it.

even ur line gives me the error.(print_r($_POST))...

Known is handfull, Unknown is worldfull
 
yup...

Known is handfull, Unknown is worldfull
 
maybe a Problem with the php.ini try
changing &quot;register_globals = off&quot; to &quot;register_globals = on&quot; in php.ini
 
njost:
According to the manual, in versions of PHP 4.1.0 and newer $_POST and the other superglobals are always supposed to exist.


vbkris:
What's you PHP run environment? What was your source for the install?

Want the best answers? Ask the best questions: TANSTAAFL!!
 
i am using Windows98, apache server. i got the exe file via a floppy from my office...

Known is handfull, Unknown is worldfull
 
Dude, I have searched Google a bunch of different ways and can find no one reporting a problem similar to yours.

I recommend that you uninstall PHP and reinstall from some other source. It's drastic, but I can't think of anything else to suggest.



Want the best answers? Ask the best questions: TANSTAAFL!!
 
yup, its the pits for me, the strange problem is that even ASP (PWS) is acting that way. i have installed PWS but there it wont run...

thanks a lot...

Known is handfull, Unknown is worldfull
 
ah,
thanks for finding that thread for me (how do u do it? i had to go page by page of my threads..), i reinstalled PHP and now it is working, but the strange problem is that the first time i instlled PHP it was in my D:\, it was that php.exe file that apache was accessing, the new one i installed in C:\, retained the old php.ini file, guess what happened? the $HTTP_POST_VARS was working but not $_POST, i got bugged, then i found out the D:\, C:\ problem, i unistalled the entire thing again and changed my apache config file, it now works like magic.

and one more thing in my version register_globals is off by default. so without declaring the variable it must throw an error, in the prior installation it did not do it.

thats it, whew...


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top