Jump to content

Email attachment from Read Directory


MHayes

Recommended Posts

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

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.