Jump to content

[SOLVED] Email with Paths to uploaded files HMM


UbH

Recommended Posts

I have a upload form that allows a user to upload 5 files.

 

After a user hits the forms submit button, my PHP uploading script runs.

 

This PHP uploading script uploads the files to its proper location and then begins to write up and send out an email.

 

In this email that gets sent out I have a URL path to each file so the person can download the files straight from their email.

However if the person who is uploading files only uploads say 4 out of the 5 that is allowed, this email still shows 5 URLs.

The 5th URL only points up to the folder where a 5th file would be if one had been uploaded. <Problem Begins

 

So I am trying to write a condition that wont display a url of a non uploaded file but rather a message saying something like "Sorry No Fifth file was uploaded".

 

Like So:

//Local Location of files 1-5
$path1= "a_subfolder/another_subfolder/".$HTTP_POST_FILES['ufile']['name'][0];
$path2= "a_subfolder/another_subfolder/".$HTTP_POST_FILES['ufile']['name'][1];
$path3= "a_subfolder/another_subfolder/".$HTTP_POST_FILES['ufile']['name'][2];
$path4= "a_subfolder/another_subfolder/".$HTTP_POST_FILES['ufile']['name'][3];
$path5= "a_subfolder/another_subfolder/".$HTTP_POST_FILES['ufile']['name'][4];


//Global Site Path
$GlobalPath = "http://www.mywebsite.com/";

//Nothing Uploaded Message
$noUpload = "Sorry No Fifth File Was Uploaded";

if ($path5 == false)
{
$path5 = $noUload;	
}
else
{
$path5=$GlobalPath.$path5;
}

//Now I can use $path1-5 in my email message and this condition will decide how it will come out when the user receives the email

 

Can someone tell me what am I doing wrong here??

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.