Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.


    • CommentAuthorashmi
    • CommentTimeNov 1st 2006
     
    I have a webstore for local community which operates at certain hours, let's say from 8pm to 2am
    I want my website during non working hours display a message, or customized webpage, that the store is not working now. and then during the working hours to change back to normal page. Is there any code or program that will do that automatically?
    How can I do that?
    or should i upload another index file everytime the webstore is not working?
    thanks
    • CommentAuthorgilray
    • CommentTimeNov 1st 2006
     
    There is many ways you can do it, but if your webserver has PHP or another SSL (Server Side Language), then you can use that.

    This is an example of a PHP script that shows 2 different HTML pages depending on the time. It assumes the server time is correct for the stores specific area though.



    <?php
    $hour = date('G'); //This outputs the current hour in 0 - 23 (24 hour format)
    if($hour >= 20 || $hour <= 2)
    {
    ?>
    <html>
    <body>
    This HTML is displayed from 8pm to 2am.
    </body>
    </html>
    <?php
    }
    else
    {
    ?>
    <html>
    <body>
    This HTML is displayed before 8pm and after 2am.
    </body>
    </html>
    <?php
    }
    ?>
    • CommentAuthorashmi
    • CommentTimeNov 1st 2006
     
    thank you for the reply,
    i tried the scrpit,
    it displays only the first message, however i also tried to change the operating hours in the script, according to local time, and it still shows the first message, while it should display second, what is wrong?
    is there any website that has information on this topic
    thanks
    • CommentAuthorjustnajm
    • CommentTimeNov 16th 2006
     
    Hi,

    The script is correct you should check the script by changing the time on your system to see the second message.