Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Accessing HTTP post vars after submit

General discussions related to php

Moderators: macek, egami, gesf

Accessing HTTP post vars after submit

Postby jflyhigh » Tue Jul 22, 2003 9:17 am

Just about every tutorial I've seen says that PHP creates vars submitted from a form automatically.

ex: form has a hidden var <input type=hidden name=var1 value=value1>
when you hit submit, it's my understanding that this code should output to the screen "value1"
echo $var1;

neither of these seem to work... I get this error:
Notice: Undefined variable: var1 in C:\_MyProjects\www\phpTest\upload3\script.php on line 11

however this does output the correct value:
echo $_REQUEST['var1'];
outputs "value1"

what's the deal? is it something in PHP.ini that needs to be set?

I'm new to PHP and can't seem to find this anywhere on the net. Also it's on an XP/IIS running PHP.

Thanks
jflyhigh
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Jul 22, 2003 8:22 am

Postby pootergeist » Tue Jul 22, 2003 9:38 am

see the nice sticky thread just above this one?

"Sticky: My Form does not work. Here's why."

read that ;)
pootergeist
New php-forum User
New php-forum User
 
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Postby jflyhigh » Tue Jul 22, 2003 9:41 am

Thanks.........
jflyhigh
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Jul 22, 2003 8:22 am


Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron