Posted: Sat Dec 30, 2006 3:36 pm Post subject: Use getdate() to rename file
Can somebody help me with an example of php script?
I want to use getdate(mday) to rename a specific file according to the day of the month
Example; filename=datedfile.php
$dates = getdate();
if($dates['mday']=="30") /30th day of month
---THEN I need to do this--
$do = unlink("daily.html"); /daily.html is a specific file for that day
$file = 'daily30.html';
$newfile = 'daily.html';
if (copy($file, $newfile))
--I have 31 files---1 for each day of the month
When a browser requests daily.html---the php code in datedfile.php
will check for the day of the month and then copy the correct file.
OR if somebody has a better way to get this accomplished
THEN Please help me, PLEASE?
Then, if your files are called 01.html, 02.html, 03.html .... 30.html, 31.html, then you will be setting the variable $file to be whatever the day is eg 10.html
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum