Jump to content

[SOLVED] email from $handle


Bricktop

Recommended Posts

Hi all,

 

I have the following bit of code which writes a file to a particular folder based on the folder variable.  I then attach that file to an email and have working code in place to do that.  However, I don't think I'm doing it the best possible way, basically my code is:

 

$handle = fopen($backupfolder.'/'.$subfolder.'/'.mktime().'-'.$file.'-backup.txt','w+');
$filename = ''.$backupfolder.'/'.$subfolder.'/'.mktime().'-'.$file.'-backup.txt';

sendfile($filename);

 

I just wondered if I could achieve the above by just using the $handle variable or if there is any better/more efficient way of doing the above?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/173429-solved-email-from-handle/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.