NameSilo

[Resolved] PHP Question

Spaceship Spaceship
Watch
Impact
1
PHP Question

Ok, I haven't done PHP in a couple years, so I'm a bit rusty.

Now, when you have domain.com/index.php?page=whatever, to see what the page is in your code (to check to see what page needs to be displayed), don't you just use
PHP:
if($page=="whatever")
{
print 'this shows up';
}

But it doesn't seem to work... I found one of my old scripts I wrote a while back and it wont work properly.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Try replacing $page with $_GET['page']
 
0
•••
Yay, that worked :) Thanks!
 
0
•••
Just thought I would give an quick explanation on why it does not work.

$page would work if register_globals was enabled. Your current server must have it disabled (it has been disabled by default for some time but a lot of hosts change that to enabled)
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back