Running Script To Show A Different Index Every Wed/Fri - Cron Job?

Discussion in 'Programming' started by Swordfish, Oct 19, 2007.

  1. #1
    I have a site that has an index page that has information on it that needs to be taken down on wednesday and then reposted on friday.

    I created 2 different index files and just keep renaming them to show live on the days required.

    Is there a way to setup a cron job or such to do this automatically?

    Basically it would take index.php and change to index2.php on and load index3.php to the site default index.php.. then on fridays reverse that...

    Maybe an easier way?
     
    Swordfish, Oct 19, 2007 IP
    Silver89 likes this.
  2. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #2
    Would it not be easier to just use an if in php?

    
    <?
    
    if (date(D) == 'Wed' || date(D) == 'Fri')
    	{
    	include ('file1.php');
    	}
    
    else 
    	{
    	include ('file2.php');
    	}
    ?>
    
    PHP:
    Hope this helps :)
     
    Silver89, Jan 10, 2008 IP