Hello,
My ultimate goal is to be able to browse a particular folder, select any file from that folder & send it via email to someone. With that in mind, this is what I've done so far. I hope I'm on the right track.
I've created a function to open & read all the files in a particular folder. This function is working properly. Now I want all the files to be displayed in a drop down menu so that I can select a particular file, click the Submit button & off it goes via email...
How do I display all the files in a drop down menu?
I will figure out the emailing part later if it is too troublesome for you to explain everything. Thanks a lot for your guidance.
My code is displayed below:-
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<?php
function hello()
{
if ($handle = opendir('/home/someone/domains/someone.com/file_emailer'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
echo "$file<br>";
}
}
}
}
hello();
?>
<form name="form1" method="post" action="">
<select size="1" name="D1">
<option value="<?php //how to insert the function hello() inside here??>">hello</option>
</select><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>