Results 1 to 2 of 2

Thread: Anyone Know If Its Possible To Do This?

  1. #1
    You do realize by 'gay' I mean a man who has sex with other men?
    Join Date
    Oct 2003
    Location
    New Orleans, Louisiana.
    Posts
    21,635

    Anyone Know If Its Possible To Do This?

    When someone hits their 'back' button to get to a previous page in a site, display a different image on the page to the one they saw previously WITHOUT randomizing the image itself?

    For example, lets say the site had index.php and index1.php.

    I visit the site and the first page i see is index.php.

    Now i click a link which takes me to newpage.php.

    I hit my browsers back button and get served index1.php.

    Anyone know if this is possible to do?

    Regards,

    Lee


  2. #2
    JustMe
    Guest
    Greetings:

    Sure, I can think of two easy ways to do this:

    1. Use a cookie. Index.php sets the cookie when a user visits it, and in the cookie, you set a variable for number of visits to 1. They visit newpage.php, hit the back button, and the cookie is updated to read 2 visits. Then have javascript that says if visits is less than 1 display image a, if visits is greater than 1 display image b.

    2. Use php sessions. This would work the same way as above, except you'd use sessions instead of cookies. The advantage of course, is that it doesn't rely on the client end to have cookies turned on.

    Either way, be sure to have a meta tag set at the top of the page for no-cache, to guarantee that the page is pulled from your server fresh, and not just out of the user's cache..

    hope that helps...


Posting Permissions

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