You are here: Re: Where would I put this markup and script « HTML « IT news, forums, messages
Re: Where would I put this markup and script

Posted by Mark Parnell on 02/06/06 02:52

Deciding to do something for the good of humanity, John Salerno
<johnjsal@NOSPAMgmail.com> declared in alt.html:

> The goal: to have a navigation bar on all my pages that consists of
> several buttons that link to other pages on my site. For example,
> "Home", "Blog" and "Contact".

That's pretty standard. :-)

> I'd also like to use some JavaScript to get this functionality: when you
> mouseover a button, it changes (and mouseout changes it back). When you
> click on it it changes,

Why use Javascript?
http://www.designmeme.com/articles/cssrollovers/
http://www.projectseven.com/tutorials/css_menus/list_01/

> and once you are on the new page, it is
> different from the rest to show that you are on that page.

Ah, now that's the tricky[1] bit.

> I assume that for the navigation bar, I could use a PHP include
> statement.

Assuming your web server supports PHP, yes.

> But since each page will have a slightly different nav bar
> (since the current button will be different), I don't know what to do
> from there.
<snip>
> Is there a way
> for a PHP script to figure out which page you are on,

Look into the $_SERVER variable, e.g. $_SERVER['PHP_SELF'].

> Would I be able to have just a single
> file with all these options, and this would be the file I include on
> each page?

Yep. brucie had a nice example of this at one stage, but it's no longer
around.

[1] Well, not really. Trickier, maybe. The trickiest part of what you
are trying to do, anyway. But still not that tricky. :-)

--
Mark Parnell

I give up:
http://blinkynet.net/comp/uip5.html

 

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

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