MHayes Posted October 27, 2009 Share Posted October 27, 2009 I have some PHP code that easily reads pdfs from a directory and displays them. The problem is that I need to be able to then select one of the pdfs and attach to an email. The directory is constantly changing and updating so I need the flexibility. <?php $dir=opendir("."); $files=array(); while (($file=readdir($dir)) !== false) { if ($file != "." and $file != ".." and $file != "index.php") { array_push($files, $file); } } closedir($dir); sort($files); foreach ($files as $file) print "<A href='$file'>$file</a> <B.R>"; ?> Link to comment https://forums.phpfreaks.com/topic/179244-email-attachment-from-read-directory/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.