PDA

View Full Version : display the site in particular days



d-machine
07-01-2008, 02:27 PM
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 :)

allahverdi
07-01-2008, 02:31 PM
I think it is able with php. Like:



<?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 ;)

d-machine
07-01-2008, 03:05 PM
first of all thank you very much!
but my site is working with ASP.. :(

allahverdi
07-01-2008, 03:18 PM
Ok. Try this:



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

d-machine
07-01-2008, 06:29 PM
THANK YOU SO MUCH !!!!
You're genius ;)

allahverdi
07-02-2008, 08:58 AM
LOL, never thought boy 12 years old can be genius...

d-machine
07-02-2008, 09:11 AM
LOL, never thought boy 12 years old can be genius...

especially if you're only 12 years old !! ;)