visit a page max 2 times

Discussion in 'Javascript' started by bb, Apr 21, 2004.

  1. bb

    bb Guest

    hello,
    I'm really not an expert in javascript, so i ask if anyone over here
    is able to make a small script which does the following:

    -a visitor click a link to my page
    -he can look this page as long as he wants
    -he clicks the link to my page a second time, still ok
    -he tries it a third time, and then he should be redirected to an
    other page.

    Is this possible. Maybe need a cookie? And i really don;t know how to
    work with cookies.

    Thank you so much already! Bas
    bb, Apr 21, 2004
    #1
    1. Advertising

  2. bb

    kaeli Guest

    In article <>,
    enlightened us with...
    > hello,
    > I'm really not an expert in javascript, so i ask if anyone over here
    > is able to make a small script which does the following:
    >
    > -a visitor click a link to my page
    > -he can look this page as long as he wants
    > -he clicks the link to my page a second time, still ok
    > -he tries it a third time, and then he should be redirected to an
    > other page.
    >
    > Is this possible. Maybe need a cookie? And i really don;t know how to
    > work with cookies.
    >


    Sure. When I clear the cookie, I can revisit again. Cool. I clear my
    cookies daily.

    IOW, you really can't do this without some server-side stuff and an IP
    addy. And even that won't work all the time, since people use proxy
    servers and stuff.
    You want to limit visits, you need to make them have a REAL username and
    password (Database and secure server-side) and you update the DB with
    each visit, etc.


    --
    --
    ~kaeli~
    Murphy's Law #2030: If at first you don't succeed, destroy
    all evidence that you tried.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Apr 21, 2004
    #2
    1. Advertising

  3. bb

    bb Guest

    kaeli <> wrote in message news:<>...
    > In article <>,
    > enlightened us with...
    > > hello,
    > > I'm really not an expert in javascript, so i ask if anyone over here
    > > is able to make a small script which does the following:
    > >
    > > -a visitor click a link to my page
    > > -he can look this page as long as he wants
    > > -he clicks the link to my page a second time, still ok
    > > -he tries it a third time, and then he should be redirected to an
    > > other page.
    > >
    > > Is this possible. Maybe need a cookie? And i really don;t know how to
    > > work with cookies.
    > >

    >
    > Sure. When I clear the cookie, I can revisit again. Cool. I clear my
    > cookies daily.
    >
    > IOW, you really can't do this without some server-side stuff and an IP
    > addy. And even that won't work all the time, since people use proxy
    > servers and stuff.
    > You want to limit visits, you need to make them have a REAL username and
    > password (Database and secure server-side) and you update the DB with
    > each visit, etc.
    >
    >
    > --



    how can i do this with an serverside script as well? It's not really a
    problem that it's not in 100% of the cases working.
    bb, Apr 23, 2004
    #3
  4. bb

    bb Guest

    kaeli <> wrote in message news:<>...
    > In article <>,
    > enlightened us with...
    > > hello,
    > > I'm really not an expert in javascript, so i ask if anyone over here
    > > is able to make a small script which does the following:
    > >
    > > -a visitor click a link to my page
    > > -he can look this page as long as he wants
    > > -he clicks the link to my page a second time, still ok
    > > -he tries it a third time, and then he should be redirected to an
    > > other page.
    > >
    > > Is this possible. Maybe need a cookie? And i really don;t know how to
    > > work with cookies.
    > >

    >
    > Sure. When I clear the cookie, I can revisit again. Cool. I clear my
    > cookies daily.
    >
    > IOW, you really can't do this without some server-side stuff and an IP
    > addy. And even that won't work all the time, since people use proxy
    > servers and stuff.
    > You want to limit visits, you need to make them have a REAL username and
    > password (Database and secure server-side) and you update the DB with
    > each visit, etc.
    >
    >
    > --



    how can i do this with an serverside script as well? It's not really a
    problem that it's not in 100% of the cases working.
    bb, Apr 23, 2004
    #4
  5. bb

    Markus Ernst Guest

    "bb" <> schrieb im Newsbeitrag
    news:...
    > kaeli <> wrote in message

    news:<>...
    > > In article <>,
    > > enlightened us with...
    > > > hello,
    > > > I'm really not an expert in javascript, so i ask if anyone over here
    > > > is able to make a small script which does the following:
    > > >
    > > > -a visitor click a link to my page
    > > > -he can look this page as long as he wants
    > > > -he clicks the link to my page a second time, still ok
    > > > -he tries it a third time, and then he should be redirected to an
    > > > other page.
    > > >
    > > > Is this possible. Maybe need a cookie? And i really don;t know how to
    > > > work with cookies.
    > > >

    > >
    > > Sure. When I clear the cookie, I can revisit again. Cool. I clear my
    > > cookies daily.
    > >
    > > IOW, you really can't do this without some server-side stuff and an IP
    > > addy. And even that won't work all the time, since people use proxy
    > > servers and stuff.
    > > You want to limit visits, you need to make them have a REAL username and
    > > password (Database and secure server-side) and you update the DB with
    > > each visit, etc.
    > >
    > >
    > > --

    >
    >
    > how can i do this with an serverside script as well? It's not really a
    > problem that it's not in 100% of the cases working.


    You have to get the information what serverside script languages are running
    on your server and then ask in the related newsgroups.

    --
    Markus
    Markus Ernst, Apr 23, 2004
    #5
  6. bb

    kaeli Guest

    OT: Re: visit a page max 2 times

    In article <>,
    enlightened us with...
    >
    >
    > how can i do this with an serverside script as well? It's not really a
    > problem that it's not in 100% of the cases working.
    >


    Depends. Check with your host on what languages they support. Get a
    database or at the least a flat file.

    I could help you with ASP, JSP, or PHP. I suck at Perl (CGI), so you'd
    need to ask in a Perl group. Unfortunately, most hosts only support Perl
    (free). More and more are doing PHP, though, so if they have that, use
    it.

    Also, find out if your server uses Apache as the web server. It's
    easiest to do file protection with.
    If your server is Microsoft, they probably use IIS and have ASP
    available. Then you'd have to talk to the admin to protect your stuff
    unless your server has a tool for it (many do).

    --
    --
    ~kaeli~
    Bakers trade bread recipes on a knead-to-know basis.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Apr 23, 2004
    #6
  7. kaeli wrote:

    > In article <>,
    > enlightened us with...
    >> hello,
    >> I'm really not an expert in javascript, so i ask if anyone over here
    >> is able to make a small script which does the following:
    >>
    >> -a visitor click a link to my page
    >> -he can look this page as long as he wants
    >> -he clicks the link to my page a second time, still ok
    >> -he tries it a third time, and then he should be redirected to an
    >> other page.
    >> [...]

    >
    > [...]
    > IOW, you really can't do this without some server-side stuff and an IP
    > addy. [...]


    Again: IP(v4) addresses are usually either dynamic or are static and refer
    to a proxy server, so evaluating them does not help in such cases.

    BTW: Your "From:" header violates Internet standards since there is no valid
    domain NOSPAM.comcast.net within DNS, according to the comcast.net primary
    MX. So cannot be a mailbox since "A mailbox
    receives mail."


    PointedEars
    Thomas 'PointedEars' Lahn, May 1, 2004
    #7
  8. JRS: In article <>, seen in
    news:comp.lang.javascript, Thomas 'PointedEars' Lahn
    <> posted at Sat, 1 May 2004 07:28:30 :
    >
    >BTW: Your "From:" header violates Internet standards since there is no valid
    >domain NOSPAM.comcast.net within DNS, according to the comcast.net primary
    >MX. So cannot be a mailbox since "A mailbox
    >receives mail."


    Your manners violate common decency.

    You have been repeatedly told that quoting elderly standards
    inappropriate to the present situation is arrogantly non-constructive.

    When can we expect you to show signs of imminent adulthood?

    --
    © John Stockton, Surrey, UK. ???@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Check boilerplate spelling -- error is a public sign of incompetence.
    Never fully trust an article from a poster who gives no full real name.
    Dr John Stockton, May 1, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. xerj
    Replies:
    4
    Views:
    346
  2. aurora

    Go visit Xah Lee's home page

    aurora, Feb 1, 2005, in forum: Python
    Replies:
    3
    Views:
    329
    Daniel Bickett
    Feb 2, 2005
  3. Nitin Verma
    Replies:
    1
    Views:
    301
    Patrick.O.Ige
    Aug 8, 2006
  4. K.
    Replies:
    4
    Views:
    359
  5. Jan C. Faerber
    Replies:
    7
    Views:
    514
    .._..
    Dec 8, 2009
Loading...

Share This Page