You are here: Extracting the File Name????? « All PHP « IT news, forums, messages
Extracting the File Name?????

Posted by Ian Rutgers on 06/09/06 22:59

I am trying to extract the file name from a URL in order to serve up the
correct navigation ... 'cept it ain't working ... would someone please
advise me as to where I am going wrong ... thanks in advance! (The code
below is contained in an include file)

<h2>philosophy</h2>
<?
$path= $_SERVER('PHP_SELF');
$file = basename($path, ".php");
print $file;
switch($file){
case "index":
print "<a href="index.php" title="studio philosophy"
id="selectedTopic">studio philosophy</a>";
print "<a href="expectations.php" title="student expectations">student
expectations</a>";
print "<a href="goal.php" title="what is the main goal of martial
arts">what is the main goal of martial arts</a>";
print "<a href="selfdefense.php" title="what is self defense">what is self
defense</a>";
print "<a href="blackbelt.php" title="what a black belt means to me">what
a black belt means to me</a>";
break;
case "expectations":
print "<a href="index.php" title="studio philosophy">studio
philosophy</a>";
print "<a href="expectations.php" title="student expectations"
id="selectedTopic">student expectations</a>";
print "<a href="goal.php" title="what is the main goal of martial
arts">what is the main goal of martial arts</a>";
print "<a href="selfdefense.php" title="what is self defense">what is self
defense</a>";
print "<a href="blackbelt.php" title="what a black belt means to me">what
a black belt means to me</a>";
break;
case "goal":
print "<a href="index.php" title="studio philosophy">studio
philosophy</a>";
print "<a href="expectations.php" title="student expectations">student
expectations</a>";
print "<a href="goal.php" title="what is the main goal of martial arts"
id="selectedTopic">what is the main goal of martial arts</a>";
print "<a href="selfdefense.php" title="what is self defense">what is self
defense</a>";
print "<a href="blackbelt.php" title="what a black belt means to me">what
a black belt means to me</a>";
break;
case "selfdefense":
print "<a href="index.php" title="studio philosophy">studio
philosophy</a>";
print "<a href="expectations.php" title="student expectations">student
expectations</a>";
print "<a href="goal.php" title="what is the main goal of martial
arts">what is the main goal of martial arts</a>";
print "<a href="selfdefense.php" title="what is self defense"
id="selectedTopic">what is self defense</a>";
print "<a href="blackbelt.php" title="what a black belt means to me">what
a black belt means to me</a>";
break;
case "blackbelt":
print "<a href="index.php" title="studio philosophy">studio
philosophy</a>";
print "<a href="expectations.php" title="student expectations">student
expectations</a>";
print "<a href="goal.php" title="what is the main goal of martial
arts">what is the main goal of martial arts</a>";
print "<a href="selfdefense.php" title="what is self defense">what is self
defense</a>";
print "<a href="blackbelt.php" title="what a black belt means to me"
id="selectedTopic">what a black belt means to me</a>";
break;
default:
print "there is an error";
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация