phxhtml
11-23-2005, 06:47 PM
I have this code that looks for the URI and if it is true, then imserts an image.
<html>
<body>
YOU ARE LOOKING FOR:<BR><BR>
<?php
switch ($theuri = $_SERVER['REQUEST_URI']):
case ( ($theuri =="/") or ($theuri =="/city/Case_Studies/mario.php") );
echo $itemis = "<img src=\"images/arrow.gif\" alt=\"arrow \">
<span class=\"note\"> MARIO </span>";
break;
case ( ($theuri =="/") or ($theuri =="/city/Case_Studies/camila.php") );
echo $itemis = "<img src=\"images/arrow.gif\" alt=\"arrow \">
<span class=\"note\"> CAMILA </span>";
break;
case ( ($theuri =="/") or ($theuri =="/city/Case_Studies/jack.php") );
echo $itemis = "<img src=\"images/arrow.gif\" alt=\"arrow \">
<span class=\"note\"> JACK </span>";
break;
default:
echo "NOBODY IS HOME";
endswitch;
?>
</body>
</html>
IT works great, but the for the statement to be true the jack, camila and mario php files must be in the case statement
I want it to be true if the Case_Studies directory is found in the URI, not the enitre URI, so that I dont have to write case statements for every file in the DIR Case_Studies.
Thanks
Mark
<html>
<body>
YOU ARE LOOKING FOR:<BR><BR>
<?php
switch ($theuri = $_SERVER['REQUEST_URI']):
case ( ($theuri =="/") or ($theuri =="/city/Case_Studies/mario.php") );
echo $itemis = "<img src=\"images/arrow.gif\" alt=\"arrow \">
<span class=\"note\"> MARIO </span>";
break;
case ( ($theuri =="/") or ($theuri =="/city/Case_Studies/camila.php") );
echo $itemis = "<img src=\"images/arrow.gif\" alt=\"arrow \">
<span class=\"note\"> CAMILA </span>";
break;
case ( ($theuri =="/") or ($theuri =="/city/Case_Studies/jack.php") );
echo $itemis = "<img src=\"images/arrow.gif\" alt=\"arrow \">
<span class=\"note\"> JACK </span>";
break;
default:
echo "NOBODY IS HOME";
endswitch;
?>
</body>
</html>
IT works great, but the for the statement to be true the jack, camila and mario php files must be in the case statement
I want it to be true if the Case_Studies directory is found in the URI, not the enitre URI, so that I dont have to write case statements for every file in the DIR Case_Studies.
Thanks
Mark
