![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
PHP Script Help?
Problem with the following php script. I want the name of the uploaded file to
appear in the subject line and the body of the email it generates. It seems as though the script is supposed to write the filename in the confirmation (see first if/echo statement), but that doesn't happen. Also, is there an easy way to redirect it to a custom confirmation page? Any help would be greatly appreciated! Thanks <?php $target = "upload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; $to = 'enter email address'; $subject = 'New File Upload'; $message = 'A new file has been uploaded to DIRECTORY NAME'; $headers = 'From: enter email address' . "\r\n" . 'Reply-To: enter reply-to address' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded"; mail($to, $subject, $message, $headers); } else { echo "Sorry, there was a problem uploading your file."; } if ($uploaded_type =="text/php") { echo "No PHP files<br>"; $ok=0; } if ($uploaded_type =="text/html") { echo "No HTML files<br>"; $ok=0; } ?> |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|