djfox Posted February 2, 2008 Share Posted February 2, 2008 I tried using php.net to look this up myself but it keeps saying it has an internal error. So! What I would like to do is have the script check what the current url is, like if the page is currently explore.php or today.php Quote Link to comment Share on other sites More sharing options...
Stooney Posted February 2, 2008 Share Posted February 2, 2008 $_SERVER['PHP_SELF'] Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted February 2, 2008 Share Posted February 2, 2008 $page = $_SERVER['PHP_SELF']; echo $page; Quote Link to comment Share on other sites More sharing options...
djfox Posted February 2, 2008 Author Share Posted February 2, 2008 It isn`t picking it up it seems, did I do it correctly? <?php if ($_SERVER['PHP_SELF'] == explore.php){ $whereloc = "Exploring"; } ?> Quote Link to comment Share on other sites More sharing options...
Stooney Posted February 2, 2008 Share Posted February 2, 2008 try <?php if ($_SERVER['PHP_SELF'] == "/explore.php"){ echo 'explorer.php'; } ?> Quote Link to comment Share on other sites More sharing options...
djfox Posted February 2, 2008 Author Share Posted February 2, 2008 Oh, all I needed was that slash? Ok, thanks a bunch! Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted February 2, 2008 Share Posted February 2, 2008 Oh, all I needed was that slash? Ok, thanks a bunch! You needed to wrap the "explor.php" in quotes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.