Reply to How to disable link to current page?

Your name:

Reply:


Posted by H@C0 on 04/07/07 20:23

I tried menu.php but I get thefollowing warnings:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
E:\AppServ\www\test\menu-org.php on line 4

Parse error: parse error, unexpected '"', expecting '}' in
E:\AppServ\www\test\menu-org.php on line 4


On Sat, 07 Apr 2007 14:43:36 +0200, "J.O. Aho" <user@example.net> wrote:


>First of all, in case you haven't already done this, I would lift out the menu
>to it's own php file, then you have only one place to change things at,
>instead of X number of pages.
>
>--- menu.php ---
><?PHP
>function typeLink($page,$img,$title="",$alt="link image") {
> if(basename ($_SERVER['PHP_SELF']) == $page)
> return "<div class=\"nolnk\"><img src=\"{$img}\" alt=\"{$alt\"
>title=\"{$title}\"></div>";
> return "<div class=\"lnk\"><a href=\"{$page}\"><img src=\"{$text}\"
>alt=\"{$alt}\" title=\"{$title}\"></a>/div>";
>}
>
>echo typeLink('page1.php','someimage1.png','Page 1');
>echo typeLink('page2.php','someimage2.png','Page 2');
>echo typeLink('page3.php','someimage3.png','Page 3');
>?>
>--- eof ---
>
>and in the file where you want the menu, place the following where the menu is
>supposed to be placed
>
><?PHP include('menu.php'); ?>
>
>
>If you want to change the pointer, then edit the css classes nolnk and/or lnk,
>if you are using xhtml, then add a / at the end of the img tag.
>
>I'm not supplying any different alt values, as alt are just used to tell
>something about the image if it's not loaded, title is used if you want a
>small tool tips displayed when the pointer is placed over the image.

[Back to original 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

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