Problem with fopen() when php is in safe_mode

From: Date: Thu, 01 Nov 2001 15:57:06 +0000
Subject: Problem with fopen() when php is in safe_mode
Groups: php.general 
Request: Send a blank email to php-general+get-73163@lists.php.net to get a copy of this message
Hi! I'm having trouble with a script who should attach files to a mail. The script looks like this: <? include "inc/mime_mail.inc"; $mail = new mime_mail; $mail -> from = $email; $mail -> to = $to_email; $mail -> subject = "Testing"; $mail -> body = "Testing"; if($dir = @opendir("/home/d5051/public_html/test")){ while ($file = readdir($dir)) { $content_type = "text/txt"; if ($file != "." && $file != ".."){ $fd = fopen($file,"r"); $data = fread($fd,filesize($file)); fclose($fd); $mail->add_attachement($data,$file,$content_type); } } closedir($dir); } $mail->send(); ?> And a get error messages like thoose below: Warning: Unable to access testar.txt in /home/d5051/public_html/mail.php on line 17 Warning: fopen("testar.txt","r") - No such file or directory in /home/d5051/public_html/mail.php on line 17 I know that the path to the file is correct and the file is set to -rwxrwxrwx. Also my ISP is running php in safe_mode Anyone who has any idea what might be wrong?? Cheers /daniel

« previous php.general (#73163) next »