faqts : Computers : Programming : Languages : JavaScript : Images

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

34 of 61 people (56%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How can I disable an image link if the user is not logged on?

Feb 10th, 2003 02:33
Klaus Bolwin, Kelvin Chan,


You can use SSI to look for a certain user, which must be logged on:
<script type="text/javascript">
anchors = document.getElementsByTagName("a");
user = <!--#echo var="REMOTE_USER" -->;
// insert code to determine the index for the array "anchors"
if (user != "Kelvin Chan") anchors[i].href = "#";
else anchors[i].href = "./kelvin.html";
</script>