1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

script + cookie

Discussion in 'Software Development' started by PeterJS, May 25, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. PeterJS

    PeterJS Thread Starter

    Joined:
    Dec 14, 2002
    Messages:
    41
    Hi,

    How would I use cookies to run a script just once?

    Thanks

    Peter :)
     
  2. cassamine

    cassamine

    Joined:
    Nov 22, 2002
    Messages:
    186
    Your question is incomplete. elaborate.

    cassamine
     
  3. PeterJS

    PeterJS Thread Starter

    Joined:
    Dec 14, 2002
    Messages:
    41
    sorry, lol......

    I have a script that redirects guests to the register page on our forum, but at the moment it's one of those annoying scripts as it will just keep redirecting the guest that if he/she attempts to view the index page of the forum. So I would like the script just to be run once for the guest, so next time he/she visits he/she won't be redirected.

    Peter :)
     
  4. cassamine

    cassamine

    Joined:
    Nov 22, 2002
    Messages:
    186
    DO THIS ONCE THE USER HAS COMPLETED REGISTERATION
    Use a cookie to store the username of the person visiting the main page.

    Do this evertime
    When the browser request a page it also send all cookies assosiated with it. So check for incomming cookies on serverside and compare with database, if the the user exists. then redirect to login page or add the login input box to main page itself, as you may please.

    If still in some doubts, send me a link to your website and give details about what you want to do as still i have made some assumptions.

    Hope all goes well

    cassamine
     
  5. PeterJS

    PeterJS Thread Starter

    Joined:
    Dec 14, 2002
    Messages:
    41
    Appreciate the help, but still don't understand.

    I'm still new to javascript, but will reading other scripts I made the script that is in my test board for redirecting guests.

    Here's my test board, it will redirect you to the register page.....

    Test Board

    Peter :)
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/135661

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice