Jump to content

Request_UIR ???


doubledee

Recommended Posts

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287736
Share on other sites

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/251027-request_uir/#findComment-1287752
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.