Results 1 to 7 of 7

Thread: display the site in particular days

  1. #1
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default display the site in particular days

    Hi

    can I use JS in order to show my site in particular days?

    for example if I want that on every Sunday my site will print such a message as : "This is Sunday. The site will be back on Monday"

    how can I do it?

    Thank you very much

  2. #2
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    I think it is able with php. Like:

    Code:
    <?php
    if(date("D") == "Sun"){
    echo"Today is Sunday. The site will be back on Monday";
    }
    else{
    ?>
    Here goes your site.
    <?php
    }
    ?>
    I know that is it possible with JS and i don't know, if my way will work. But try

  3. The Following User Says Thank You to allahverdi For This Useful Post:

    d-machine (07-01-2008)

  4. #3
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default

    first of all thank you very much!
    but my site is working with ASP..

  5. #4
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    Ok. Try this:

    Code:
    <script type="text/javascript">
    var mytime = new Date();
    var myday = mytime.getDay();
    if(myday == 0){
    document.write("Here you go...");
    }
    </script>

  6. The Following User Says Thank You to allahverdi For This Useful Post:

    d-machine (07-01-2008)

  7. #5
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default

    THANK YOU SO MUCH !!!!
    You're genius

  8. #6
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    LOL, never thought boy 12 years old can be genius...

  9. #7
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by allahverdi View Post
    LOL, never thought boy 12 years old can be genius...
    especially if you're only 12 years old !!

Bookmarks

Posting Permissions

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