Log in

View Full Version : Visited Link



mesgs
12-03-2007, 05:22 AM
I am not sure where I should ask my question.

In my code I have a list of links. I coded colors for active links and hovering a link and another color for links visited.

My question is this. I have visited all the links so they are shown in black.
I want the links not to show as visited the next time I access the website. I only want the links to show visited for the one session.

Is this possible???

tech_support
12-03-2007, 08:47 AM
You can't do that with CSS alone. You'll need a server-side language like PHP to do it.

With PHP:

Put this on the very top of your page (even before <html>)


<?php
$id = sha1(time());
if (!isset($_COOKIE['links'])) {
setcookie('links',$id);
}
?>


And on every link, add this to the url: ?id=<?php echo $id; ?>

Example:
<a href="mypage.php?id=<?php echo $id; ?>">My Link!</a>
...and if you already have a ? in the URL, put &amp;id=<?php echo $id; ?>

Example:
<a href="mypage.php?subscribe=true&id=<?php echo $id; ?>">My Link with 2 variables!</a>

boogyman
12-03-2007, 02:32 PM
it can be done with a meta tag? just assign no cache and any requests to the server will be treated as an original request



<meta http-equiv="pragma" content="no-cache">

mesgs
12-03-2007, 11:42 PM
www.ncn.net/~bogg427

I put the meta tag in my index module

Is this what you meant? It didn't do anything but I might not have done as you instructed.

boogyman
12-04-2007, 01:53 PM
it would go in your <head> tag.. however you put it there is up to you, I don't know how you populate it



<head>
<meta http-equiv="pragma" content="no-cache">
</head>

mesgs
12-05-2007, 06:42 PM
Did you look at my website....I gave you the address.
I did put the code in the head section but it seems to have no effect.
That is why I wanted you to look at my code.
I put the code in my index module.