I have this code (below) where an image file is chosen, a new file name is generated, and the newly named file is moved to upload/ folder.
Does this line of code combine the new file name with where the newly-named file was moved to?
$file_location = '<a href="http://www.--.com/upload/' . $newfilename . '">http://www.--.com/upload/' . $newfilename . '</a>';
$allowedExts = array("gif", "jpeg", "jpg", "png");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = strtolower( end($temp) );
if ( $_FILES["file"]["size"] < 2000000
&& in_array($extension, $allowedExts) )
{
if ($_FILES["file"]["error"]!= 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
} else {
$length = 20;
$randomString = (time());
$newfilename = $randomString . "." . $extension;
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $newfilename );
[B]$file_location = '<a href="http://www.--.com/upload/' . $newfilename . '">http://www.--.com/upload/' . $newfilename . '</a>';[/B]
}
} else {
echo "Invalid upload file";
}