Post uploaded file URL in form results e-mail

I have a form that collects information from the user and also allows them to upload a image, the form then sends the results to a handler on a separate PHP page, that page then sends the information I want to my e-mail address. Everything works great and the uploads to my server with no problems, but the only thing I would like to know is how do I get the link to the uploaded image sent in the e-mail results so I could just click it and see the image uploaded. My handler is attached, if you need any other code let me know. Thanks.

[code] <?php
if (sizeof($_POST)==0)
{
header(“Location:quote.php”);
}
else
{

$where_form_is=“http://”.$_SERVER[‘SERVER_NAME’].strrev(strstr(strrev($_SERVER[‘PHP_SELF’]),"/"));

mail("[email protected]",“Price Quote Request”,"Form data:

First Name: " . $_POST[‘field_1’] . "
Last Name: " . $_POST[‘field_2’] . "
E-Mail Address: " . $_POST[‘field_3’] . "
Phone Number: " . $_POST[‘field_4’] . "
Type of Shirt: " . $_POST[‘field_5’] . "
Shirt Color: " . $_POST[‘field_6’] . "
Front Colors: " . $_POST[‘field_16’] . "
Back Colors: " . $_POST[‘field_17’] . "
X Small: " . $_POST[‘field_7’] . "
Small: " . $_POST[‘field_8’] . "
Medium: " . $_POST[‘field_9’] . "
Large: " . $_POST[‘field_10’] . "
X Large: " . $_POST[‘field_11’] . "
XX Large: " . $_POST[‘field_12’] . "
3XL: " . $_POST[‘field_13’] . "
4XL: " . $_POST[‘field_14’] . "
5XL: " . $_POST[‘field_15’] . "
How did you hear about us?: " . $_POST[‘field_18’] . "
If other, type here: " . $_POST[‘field_19’] . "
Comments/Description: " . $_POST[‘field_20’] . "

",“From: [email protected]”);
}

?>

<?php $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); // File upload handling if($_FILES['field_21']['name']!=''){ $field_21_filename = "file_21_".date("sihdmY").substr($_FILES['field_21']['name'],strlen($_FILES['field_21']['name'])-4); if(!move_uploaded_file($_FILES['field_21']['tmp_name'], "./php_uploads/".$field_21_filename)){ die("File " . $_FILES['field_21']['name'] . " was not uploaded."); } } ?>[/code]

just use "http://urdomain/php_uploads/".$field_21_filename in ur massage.

if u wanna make sure that the upload succeded, u need to change the order of sending the mail and uploading the file.

Sponsor our Newsletter | Privacy Policy | Terms of Service