doubledee Posted November 12, 2011 Share Posted November 12, 2011 What does this mean in English? 'REQUEST_URI' The URI which was given in order to access this page; for instance, '/index.html'. Debbie Quote Link to comment https://forums.phpfreaks.com/topic/251027-request_uir/ Share on other sites More sharing options...
trq Posted November 12, 2011 Share Posted November 12, 2011 Exactly what is says. Quote Link to comment https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287690 Share on other sites More sharing options...
doubledee Posted November 12, 2011 Author Share Posted November 12, 2011 Exactly what is says. That's really helpful... Debbie Quote Link to comment https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287692 Share on other sites More sharing options...
trq Posted November 12, 2011 Share Posted November 12, 2011 I'm not sure it could be dumbed down much further. REQUEST_URI returns the uri that was used to access the page. Quote Link to comment https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287695 Share on other sites More sharing options...
doubledee Posted November 13, 2011 Author Share Posted November 13, 2011 I'm not sure it could be dumbed down much further. REQUEST_URI returns the uri that was used to access the page. If I am on index.php and I click on the "Articles" tab (in the header) which has a hyperlink to "articles.php" then what would SERVER['REQUEST_URI'] hold? index.php? articles.php? Debbie Quote Link to comment https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287736 Share on other sites More sharing options...
Philip Posted November 13, 2011 Share Posted November 13, 2011 Whatever page you're currently on. At first it'd be index.php and then it'd be articles.php Quote Link to comment https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287746 Share on other sites More sharing options...
doubledee Posted November 13, 2011 Author Share Posted November 13, 2011 Whatever page you're currently on. At first it'd be index.php and then it'd be articles.php I'm trying to get my hands around this code... <?php $page = basename($_SERVER['REQUEST_URI']); if ($page == '/') { $page = "index.php"; } ?> <div id="pageHeader"> <!-- Logo --> <a href="index.php"> <img id="logo" src="images/debbie_160x45.png" width="160" alt="Debbie" /> </a> <!-- Top Menu --> <ul id="topMenu"> <li <?php if($page=="index.php") echo 'class="current"'; ?>> <a href="index.php">Home</a> </li> <li <?php if($page=="article_index.php") echo 'class="current"'; ?>> <a href="pages/article_index.php">Articles</a> </li> <li <?php if($page=="howto_index.php") echo 'class="current"'; ?>> <a href="pages/howto_index.php">How-To Guides</a> </li> <li <?php if($page=="news_index.php") echo 'class="current"'; ?>> <a href="pages/news_index.php">In the News</a> </li> <li <?php if($page=="interview_index.php") echo 'class="current"'; ?>> <a href="pages/interview_index.php">Interviews</a> </li> </ul><!-- End of #TOPMENU --> </div><!-- End of #HEADER --> Debbie Quote Link to comment https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287752 Share on other sites More sharing options...
trq Posted November 13, 2011 Share Posted November 13, 2011 Why don't you echo out $page so you can actually see what it contains. Quote Link to comment https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287754 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.