Hi,
Thanks, but when testing locally with my php/mySQL server, a blank page appears in the browser. What did I goof?
<div id="nav">
<?php
$menu = <<<MENU
<ul id="navList">
<li><a href="/" title="Where the heart is">Home</a></li>
<li><a href="/archives/" title="Things that have passed.">Archives</a></li>
<li><a href="/about/" title="All about Matt">About</a></li>
<li><a href="/photos/" title="It's the 'photo' in Matt">Photos</a></li>
<li><a href="/music/" title="The food of love">Music</a></li>
</ul>
MENU;
$lines = split("\n", $menu);
foreach ($lines as $line) {
$current = false;
preg_match('/href="([^"]+)"/', $line, $url);
if (substr($_SERVER["REQUEST_URI"], 0, 5) == substr($url[1], 0, 5)) {
$line = str_replace('<a h', '<a id="current" h', $line);
}
echo $line."\n";
}
?>
</div>
On Sunday, November 28, 2004, at 10:00 AM, Rob Mientjes wrote:
Afraid you don't have to: http://photomatt.net/scripts/intellimenu
On Sun, 28 Nov 2004 09:55:15 -0800, Chris Kennon <[EMAIL PROTECTED]> wrote:Hi,
The goal is including the navigation <ul> as a php include on each
page, my question is how to control the "your here" selection, for each
page with possibly a php variable, coding an <a href="#" id="current">
dynamically based upon the page being viewed.
_______________________________ "Knowing is not enough, you must apply; willing is not enough, you must do." ---Bruce Lee
****************************************************** The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************
-- Cheers, Rob. » http://www.zooibaai.nl/b/ ****************************************************** The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************
_______________________________ "Knowing is not enough, you must apply; willing is not enough, you must do." ---Bruce Lee
****************************************************** The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************