Posted by Martin Jay on 06/10/06 02:11
In message <A3nig.4392$Mn5.3652@pd7tw3no>, Ian Rutgers
<irutgers@otima.ca> writes
>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');
This should be:
$path= $_SERVER['PHP_SELF'];
Note the square brackets.
>$file = basename($path, ".php");
>print $file;
>switch($file){
> case "index":
> print "<a href="index.php" title="studio philosophy"
>id="selectedTopic">studio philosophy</a>";
You'll also need to escape " in the HTML:
print "<a href=\"index.php\" title=\"studio philosophy\"
>id=\"selectedTopic\">studio philosophy</a>";
or:
print '<a href="index.php" title="studio philosophy"
>id="selectedTopic">studio philosophy</a>';
[snip]
> default:
> print "there is an error";
There should be a } here.
>?>
--
Martin Jay
Phone/SMS: +44 7740 191877
Fax: +44 870 915 2124
Navigation:
[Reply to this message]
|