Hi I have a script that shows all the images that have uploaded it shows a link to view the images and i want to have another link that will be able to mail the picture and i have to enter a new email address how can i do this pls help
<?php
$banners = array();
$bannerDir = '../photos/';
$i = 0;
$d = dir($bannerDir);
$fileArray = array();
$fileTimeArray = array();
while (false !== ($entry = $d->read()))
{
if (strlen($entry) > 2)
{
list($imageName,$imageExtension) = split('[.]',$entry);
if (eregi('jpg|jpeg',$imageExtension))
{
$file = $bannerDir.$entry;
$fileArray[$entry] = date('U', filemtime($file));
$fileTimeArray[$entry] = date('j F Y H:i', filemtime($file));
}
$banners[$i] = $entry;
$i++;
}
}
$d->close();
arsort($fileArray);
echo '<table cellpadding="3" cellspacing="1" border="0" style="width:100%; margin-top: 10px" style="position:relative; ">'."\n";
echo '<tr class="tableHeading"><td>Image name</td><td>View image</td><td>Date uploaded</td><td>Use image</td></tr>'."\n";
foreach ($fileArray as $key => $value) {
$class = ($class == "adminRow1") ? "adminRow2" : "adminRow1";
echo '<tr class="'.$class.'"><td>'.$key.'</td><td><a target="_blank" href="../photos/'.$key.'">View image</a></td><td>'.$fileTimeArray[$key].'</td><td><a onclick="opener.document.getElementById(\''.$whatField.'\').value=\'../photos/'.$key.'\'; mailto:">Use image</a></td></tr>'."\n";
}
echo '</table>'."\n";
?>