tags:

views:

47

answers:

2

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.

+2  A: 

Like this:

<a href='http://www.home.html/uploaded/".  $value . "'>"
SLaks
I thought that would work..but it's just adding the url to the text I get back: href='http://home.com/uploaded/gallery_grannylovesthis_l.jpg'><img border = '0' It seams like the header needs to change also so It comes through as html instead of text. Ideas?
Michael Robinson
I have no idea what you mean.
SLaks
@ Michael: Do you mean your email viewer isn't parsing the HTML? That's probably a settings issue on your end, I know a lot have the option to turn it off for security.
peachykeen
@peachykeen: You shouldn't put a space between the `@` and the username.
SLaks
A: 

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)

webdestroya