NameSilo

[Resolved] PHP Question

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
Watch

Wesley

Established Member
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Try replacing $page with $_GET['page']
 
0
Close
Yay, that worked :) Thanks!
 
0
Close
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
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back