View Single Post
Old 08-24-2011, 02:41 PM  
crazyvipa
Confirmed User
 
Industry Role:
Join Date: Aug 2011
Posts: 73
Something along those lines. You'll need to include a variable. How are you getting the DATE aspect? Is it today's date? Is it always going to be there?

In any case, I'll use today's date for an example.

<?php
$_today = date("Y-m-d");
include('./[' . $_today . ']/mysupercoolfile.html');
?>


By no means is the above code safe in any way. You should always add checks to see if files exist or php will fire off errors. Use php.net to find out functions and what they do, but is_file() is the function you'd want to use to make sure the file is actually there.

Remember that PHP runs in an environment, and usually based on absolute paths (on *nix systems) -- so you may have to use absolute directory structure.

Example: "./myw-ww.html" becomes "/var/www/superduper/httpdocs/myw-ww.html"


MOST hosting servers use mods that only allow you to access your home www directory, so the above example doesn't matter -- but not all.

Hope this helps,
__________________
----
celebnuditywebsites AT gmail.com

Last edited by crazyvipa; 08-24-2011 at 02:44 PM..
crazyvipa is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook