Forum Moderators: coopster

Message Too Old, No Replies

Disabling link

         

Kysmiley

6:38 pm on Feb 20, 2005 (gmt 0)

10+ Year Member



how would i about starting or finding a function or nscript that would let me disable an active link. So when Im on lets say contact the link on that page to the contact page would not show. I am doing my links in text so i would also hope that I could get the other links to move up one place in line so there would not appear any gaps. I have read and can do it if there is an image to replace the active image with another as indicated in the book I have but im not sure how to do it with text and get the results im looking for.
Pat

hakre

6:43 pm on Feb 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



let's say, when you're online the the variable $online in your script is true, otherwise it's false. within your html:

<a href="link1">Link1</a> <a href="contact">Contact</a> <a href="link2">Link2</a>

you can put a simple if condition to only output the 2nd link (contact) when you're online:

<a href="link1">Link1</a> <? if($online) {?><a href="contact">Contact</a> <? }?><a href="link2">Link2</a>

that's all you need to do. you don't even have to worry about additional chars or linebreaks. that should not be a problem at all.