Results 1 to 6 of 6

Thread: Visited Link

  1. #1
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Visited Link

    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???

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    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 Code:
    <?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:
    HTML Code:
    <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:
    HTML Code:
    <a href="mypage.php?subscribe=true&id=<?php echo $id; ?>">My Link with 2 variables!</a>
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    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

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

  4. #4
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please check out my code as I am not sure

    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.

  5. #5
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    it would go in your <head> tag.. however you put it there is up to you, I don't know how you populate it

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

  6. #6
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default It doesn't work

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •