Adding a web address to a <a href="value">
I have an upload script that write a index.html file, I modified it to mail me the results, however the point to the root, since the email isn't in the root, the image doesn't load.
How do I append the code to add "http://www.home.html/uploaded" prior to the ". $value ." so that the images show up in 开发者_开发百科the email.
Here is portion of PHP that assigns the images to a $result:
// Process value of Imagedata field, this is JPEG-files array
foreach ($_FILES[Imagedata][name] as $key => $value)
{
$uploadfile = $destination_dir . basename($_FILES[Imagedata][name][$key]);
if (move_uploaded_file($_FILES['Imagedata']['tmp_name'][$key], $uploadfile))
{
$result .= "File uploaded: <a href='". $value . "'>" . $value . "</a><br>";
}
}
//
$result .= "<br>";
Here is what I'm now receiving in the email, :
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Upload results</title>
</head>
<body>
AdditionalStringVariable: pass additional data here<br><a>
href='gallery_grannylovesthis_l.jpg'><img border = '0'
src='QIU_thumb_gallery_grannylovesthis_l.jpg'/></a><br><br><br>File uploaded: <a
href='gallery_grannylovesthis_l.jpg'>gallery_grannylovesthis_l.jpg</a><br><br>
GlobalControlData:
PHOTO_VISIBILITY : 2<br>
GlobalControlData:
PHOTO_DESCR : Requiredtest<br>
GlobalControlData:
PHOTO_TITLE : Requiredtest<br><br>gallery_grannylovesthis_l.png<br> control: , value: <br>
</body>
</html>
Thanks in advance for any guidance...I have a feeling it's something simple.
Like this:
<a href='http://www.home.html/uploaded/". $value . "'>"
Your code has a malformed tag:
<a>
href='gallery_grannylovesthis_l.jpg'><img border = '0'
It should be like this:
<a href='gallery_grannylovesthis_l.jpg'><img border = '0'
Notice on yours you have href (you added a > when there should not be one)
精彩评论