Link to home
Start Free TrialLog in
Avatar of catonthecouchproductions
catonthecouchproductionsFlag for United States of America

asked on

Not sending file upload URL to email

Hey, I have an email form that someone here at EE helped me out with.

The form:

Sends the form
Includes all data BUT the uploaded files URL
I get no errors.
Image gets uploaded

Link: http://critterclassifieds.net/?a=ad-signup

Any suggestions? So the only thing is the:

$fileHTTPURL

Is not getting printed.

CODE:

<?php

$subject = $_POST['subject'];
$name    = $_POST['name'];
$company = $_POST['company'];
$phone   = $_POST['phone'];;

// Mail of sender
$email   = "$email";
// From
$header  = "from: $name <$email>";

// Enter your email address
$to      = 'glanceatx@gmail.com';
$message = "$name sent you an ad request on your site.\n Their e-mail address was: $email.\n\n Company: $company\n Phone: $phone\n\n File URL : $fileHTTPURL\n";


// START OF IMAGE UPLOAD
$path2Save      = "images/upload/"; // make sure dir exsists
$picFileName    = "$pic_name";
$fileSavedLink  = "$path2Save$picFileName";
$fileHTTPURL    = "http://www.critterclassifieds.net/$fileSavedLink";


if(empty($picFileName)){
      include("http://www.critterclassifieds.net/index.php?a=ad-signup");
        echo('No picture to upload');
      exit;
}
else {

             if(move_uploaded_file ($pic, $fileSavedLink)){
                   header('Location: http://www.critterclassifieds.net/index.php?a=paypalthankyou');
                         // mail coding stat here

                         mail($to,"Ad Sign Up - Request",$message,"From: $email\n");

                         // mail coding end here
             }

             else {
                  echo "Failed to upload file. Please try later";
                  include("form.htm");
             }
             exit;
     }
?>
ASKER CERTIFIED SOLUTION
Avatar of steelseth12
steelseth12
Flag of Cyprus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of catonthecouchproductions

ASKER

Hey, I am trying to see what you changed but cant..could you explain what you did?

Thanks,
Ryan
First you must difine the variable $fileHTTPURL and then use it in $message.

If you first use it and then define it then you will get empty in $message.
Ahhh...thank you for that! Worked great!

Ryan