Forum Moderators: coopster

Message Too Old, No Replies

Post Data in php

         

kindacheezy

12:07 am on May 14, 2003 (gmt 0)

10+ Year Member



I admin 2 phpbb boards and my whole webpage is in PHP and my question is in what order are variables assigned in PHP pages. Does it assign post data first then go on with the code of is it different? Why is date =10 in my example?

Test.php?date=100
<?
$date=10;
echo($date);
?>

ruserious

12:32 am on May 14, 2003 (gmt 0)

10+ Year Member



See [php.net...] if you want a special order in which to have them assigned.
Since you mentioned phpBB, it does it "all manually", by checking isset() and assining accordingly, where POST has higher prio than GET
When register_globals is off (which is default in newwer versions of PHP) those variables will not be assigned at all, you'll have to either import or access them manually.

In your example however $data is 10, because that is the value you are assigning to it. ;) Such variables are, well, variable, not constant. When you assign a new value like in your example, then the old one will be "lost".