I can not read $_POST

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
8370
Forum Newbie
Posts: 1
Joined: Fri Jul 11, 2003 11:34 am

I can not read $_POST

Post by 8370 »

Hello!

I have a form with method post, action ="show.php" and a text field named "txt". But when i use

Code: Select all

print($_POSTї"txt"]);
in
show.php it doesn't display any thing. I have track_vars and
register_globals enabled in php.ini.

Thanks.
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

It would be a lot easier to help you if you posted the entire code of both pages.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

try ' instead of "
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

What version of PHP? If its older (4.1.x series I beleive) you'll need to use $HTTP_POST_VARS["txt"] instead of $_POST["txt"];
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

besides just the $_GET and $_POST issues, there's other reasons you should upgrade to 4.2 or higher
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Try $_REQUEST also.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

sami: $_request in the last part of the egpcs or whatever order to have something with that name.

it's also only available above 4.1
mikeb
Forum Commoner
Posts: 60
Joined: Tue Jul 08, 2003 4:37 pm
Location: Dublin, Ireland

Post by mikeb »

I've just spent a week working until after midnight trying to solve a similar issue. As a newbie I feel your pain. My $post would not work on a very simple form. With (AMAZING!) help from others on the forum I have managed to get it working only by upgrading to the very latest version of php and following the manual installation instructions. I'm using the php version 5 beta under apache 2 as a cgi installation all on win2k. This upgrade seems to have solved the issue and my forms are working fine. Hope that's of some help!
Post Reply