I just added the upload button to my form, but the files are stuck on the server in the upload folder…I need to output the location/url/target path of the files in the PHP script, so my users can download the files from the server. How can I do this? (I just started using PHP)
<?php $myemail = "[email protected]"; $subject = "test"; { if ($_FILES["file"]["error"] > 0) { } else { if (file_exists("upload/" . $_FILES["file"]["name"])) { } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); } } } $tshirt = check_input($_POST['tshirt']); $hearlawfirm = check_input($_POST['hearlawfirm']); $other = check_input($_POST['other']); $fname = check_input($_POST['fname']); $mname = check_input($_POST['mname']); $lname = check_input($_POST['lname']); $address = check_input($_POST['address']); $city = check_input($_POST['city']); $state = check_input($_POST['state']); $zip = check_input($_POST['zip']); $email = check_input($_POST['email']); $dob = check_input($_POST['dob']); $comments = "45Bucks.com tshirt Email Tshirt Size: $tshirt How did you hear about our law firm: $hearlawfirm other: $other First Name: $fname Middle Name: $mname Last Name: $lname Address: $address City: $city State: $state Zip: $zip Email Address: $email Date Of Birth: $dob ";mail($myemail, $subject, $comments); header('Location: thanks.html'); exit(); function check_input($data, $problem='') { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); if ($problem && strlen($data) == 0) { show_error($problem); } return $data; } function show_error($myError) { ?><html>
<body>
<b>Please correct the following error:</b><br />
<?php echo $myError; ?>
</body>
</html>
<?php
exit();
}
?>