Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    One Url Multiple Pages

    Hello there,
    i am trying to make a script in which opened new pages when i refresh the address bar.
    For Example:
    http://namesmile.info/control/
    please go here two times ..
    when you open this its shows url
    when you open second time its shows different url from first url
    please help me how i can do this.
    thanks

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    I don't think this is possible for security reasons. If the page is refreshed it reverts to the original link. Please explain why you want to do this.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    I don't see how that is hard, Philip.

    You could use a cookie to remember that the person has been to the page and then show different content or even do a redirect (or, on the server side, do a Server.Transfer so that the URL change is invisible to the user).
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by Old Pedant View Post
    I don't see how that is hard, Philip.

    You could use a cookie to remember that the person has been to the page and then show different content or even do a redirect (or, on the server side, do a Server.Transfer so that the URL change is invisible to the user).
    Yes, I thought of a cookie. But I am always leery about requests from first-post newcomers who want to do something "strange" or unconventional with no good reason, and which seem to me to have security implications. I would be happier if the OP gave us a convincing reason for his request.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,184
    Thanks
    10
    Thanked 569 Times in 550 Posts
    i don't see what this has to do with security, servers, or re-directs...


    you can set the url bar to whatever you want using pushState.

    you can display whatever content from anywhere on your site using ajax.

    with those two, you can set content and url independently.

    use localStrorage to track history activity that's forgotten by History's API, and respond accordingly.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5


  •  

    Tags for this Thread

    Posting Permissions

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