hey im searching for a php code to upload file system by user. I found some on internet but im including that upload file within Contact Us form so can i include that uploading thing within the Php page i already have to send email
hey im searching for a php code to upload file system by user. I found some on internet but im including that upload file within Contact Us form so can i include that uploading thing within the Php page i already have to send email
chek this one should do it.
http://us.php.net/manual/en/features...load.php#72064
ur looking for a contact form with an attachment tool on it?
to see if i can help u out.
Maybe this.... http://www.webcheatsheet.com/PHP/sen...hment.php#html
its not gonna be one line. use the code from that and modify your current file.
hmm never did this attachment before and i dont even want to mysql in this attachment here is the code in php and also tell me what to add in html file as well.
PHP Code:if(isset($_POST['submit'])) {
$to = "email";
$clientid = "13001";
$mail = "1";
$subject = $_POST['subject'];
$message = $_POST['message'];
$message1 = $_POST['message1'];
$body = "E-Mail: $mail\n Client Id: $clientid\n Comment:\n $message\n Suggestion:\n $message1";
echo "Email Sent";
mail($to, $subject, $body, "From: $mail");
} else {
echo "invalid!";
}
Last edited by Snookerman; 04-21-2009 at 07:44 AM. Reason: added [php] tags
name the file as upfile.php
//name the file as upload_file.phpHTML Code:<html> <body> <form enctype="multipart/form-data" action="upload_file.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> </body> </html>
first you create a folder and name it as upload and this folder should be in the folder where the the above two programs is in ,and execute the program upfile.phpPHP Code:<?php
$target_path = "uploads/";
echo $target_path."<br>";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
bye
Last edited by Snookerman; 04-21-2009 at 07:46 AM. Reason: added [html] and [php] tags
can I add this in my php code which i posted above
Bookmarks