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
    Nov 2013
    Location
    Mishawaka, Indiana, USA
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Redirecting given time and location of visitor and sunset

    On my website, if someone visits the website between Sunset Friday and Sunset Saturday in their time, how can I redirect them to a page that says "Thank you for visiting our website. However, it is the Sabbath and we are closed. Please visit at a later time."

    So if it is the Sabbath in New York City, for example, it may not be the Sabbath and say, Tokyo. Therefore, the website would redirect a visitor in New York City between Sunset Friday and Sunset Saturday, but it would be "open" in Tokyo.

    What coding requirements would be necessary in order to make this dynamic happen? Thank you very much for your assistance.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,472
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    There is a way to get a person's location, but it requires using javascripting, which isn't always reliable. They can have javascripting turned off, or change the date/time on their computer. Easy to bypass, easy to lie about the time ... so they could easily access your site.

    The best way is to ask the person to pick the major city in their timezone. That is an extra step that they may not wish to take. Google has the "location" app, but it pops up a box asking the user if they wish to let Google find their location, so they may just say "no" to that.

    So the answer is, you can get their location, but they can pretty much give you any location they want ... and then they can access your site. No way to make it 100% effective.

    The origination of the Sabbath wasn't meant for something like the world-wide-web?

    And ... what if I live in Northern Alaska and there is no sunset during the summer months, nor sunrise during the winter.


    .
    Last edited by mlseim; 11-25-2013 at 05:47 PM.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,634
    Thanks
    0
    Thanked 649 Times in 639 Posts
    The time for sunset is going to vary a lot depending on exactly where the person lives and you have no way of finding out where they live unless they tell you and no easy way of determining when sunset is there.

    You would be more successful if you decided to base it on sunset where you are.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,472
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Felgall is right. You'll never get it right based on several factors, and there are several sunset and sunrise times, which does the Sabbath recognize?

    Astronomical Twilight Starts/Ends
    Nautical Twilight Starts/Ends
    Civil Twilight Starts/Ends

  • #5
    Regular Coder Nerevarine's Avatar
    Join Date
    Jan 2013
    Location
    Phendrana Drifts, Tallon IV, W-Class
    Posts
    285
    Thanks
    0
    Thanked 17 Times in 17 Posts
    Blog Entries
    3
    I've never heard of a website closing on a certain day. Interesting, though it makes it difficult, because I've never seen it implemented before.
    Time kills us in our sleep and we watch it happen in our dreams. -K.K.
    THE END-ALL PROGRAMMING REFERENCE: CLICK HERE (Courtesy of Major Payne)
    My username was previously L0adOpt1c. :: Please read this before posting in the HTML/CSS forum.
    Validate your HTML here and your CSS here. :: Need basic HTML/CSS tutorials? Click here, don't post about it.


  •  

    Posting Permissions

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