[KLUG Programming] variable not being posted?
Todd Pillars
programming@kalamazoolinux.org
Wed, 6 Aug 2003 22:46:45 -0400 (EDT)
>> I decided to work a little bit on my library project. Attempting to
>> get it working on a RH9 machine I have run in to a snag. For a url
>> like http://localhost/librarydb/title.php?title_id=46
>> the variable title_id is not being set. Most configuration parameters
>> are left unchanged from default.
>> if ($title_id != 0) {
>> do stuff here
>> }
>> else{ echo("no title_id"); }
>> with this as the url, the echo command occurs.
>> I'm confused. Is php only allowing session variables to work and not
>> posted variables?
>
> Yep, recent versions of PHP disable globals by default. It is a good
> idea.
You can read the variable by either
$_GET['var'] or $_POST['var']
OR if you feel like typing a bunch
$HTTP_POST_VAR['var'] or $HTTP_GET_VAR['var']
There are some $_SERVER stuff also
T