Hi MrPhil, thanks for your reply.
Yes I tried the -q as well (sorry. I should have mentioned that to begin with) It didn't make any difference though.
I saw the php path info in the wiki lunarpages area but I didn't get how that would apply to my script..
Anyway, here is the code I am using.
<?php
function copyFile($url,$dirname){
@$file = fopen ($url, "rb");
if (!$file) {
return false;
}else {
$filename = basename($url);
$fc = fopen($dirname."$filename", "wb");
while (!feof ($file)) {
$line = fread ($file, 1028);
fwrite($fc,$line);
}
fclose($fc);
return true;
}
}
$filename = 'pathcopy2/file.ext';
if (file_exists($filename)) {
$command_msg = "The file exists...";
} else {
copyFile("pathcopyfrom/file.ext","pathcopy2/");
}
$to = "me@me.com";
$from_header = "From: me@me.com";
$subject = "Cron Job Ran..";
$body = "Cron details:";
$body .= "\n";
$body .= "....";
if (mail($to, $subject, $body, $from_header)) {
//echo("<p>Message successfully sent.</p>");
} else {
//echo("<p>Message delivery failed...</p>");
// }
?>
Thanks!