Page 2 of 2

Re: PHP Daily Schedule Rotation

Posted: Fri Sep 25, 2009 9:41 am
by jackpf

Code: Select all

$page = 'dirname/'.strtolower(date('l')).'.html';
maybe?

Re: PHP Daily Schedule Rotation

Posted: Fri Sep 25, 2009 9:54 am
by CONFUSIONUK
Will try this and get back to you asap :wink:

Re: PHP Daily Schedule Rotation

Posted: Fri Sep 25, 2009 10:06 am
by CONFUSIONUK

Code: Select all

<?php
$date = date('l');
  //Let's concatenating the day of the week and '.html' into one variable for ease of use
$page = 'schedule/'.strtolower(date('l')).'.html';
 
  //This checks to see if the filename exists in the current directory.
  //If it does, it pulls the page up.  If not, it pulls up a default page.
if (file_exists($page)){ 
    include($page);
} else {
    include('default.html');
}
?>
http://www.shedbass.net/confusion/sb2/
http://www.shedbass.net/confusion/sb2/schedule/

have a look over that, we are completely puzzled :?

Re: PHP Daily Schedule Rotation

Posted: Fri Sep 25, 2009 12:06 pm
by jackpf
What's your file structure?

You can check the files exist with

Code: Select all

var_dump(file_exixts($file));

Re: PHP Daily Schedule Rotation

Posted: Fri Sep 25, 2009 1:23 pm
by JePS
jackpf wrote:What's your file structure?

You can check the files exist with

Code: Select all

var_dump(file_exixts($file));
Hi

I'm working with Confusion on this project - Basically we have a file called Schedule.php - This file contains the lump of code that calls the daily html files up and is located in the public_html folder. Coming off that folder we have a directory called /Schedule/ which contains all the daily html files.

We would like to edit the php script to call from the /schedule/ folder instead of the folder that houses schedule.php


Any ideas?

Re: PHP Daily Schedule Rotation

Posted: Fri Sep 25, 2009 1:54 pm
by jackpf
*nix has case sensitive directory/file names. Try using the correct case ;)

If that doesn't work, try something like this:

Code: Select all

$file = $_SERVER['DOCUMENT_ROOT'].'/Schedules/'.strtolower(date('l')).'.html';