Could you please help realize the procedure of sending attached files in php. If it is possible, please, provide me with ready code examples. Thanks in advance!
If you're sending files in PHP, you might want to try a framework to make easier work of that. CodeIgniter.com is the best light-weight no hassle framework that doesn't rely on outside libraries.
I guess you want to send mails using php mail function with attachments. Please specify your requirements, so that we may help!
if for examle I am planning to develop essay writing services website, both customers and writers will need to upload .doc files attached to my website, that's why I am asking this question on how this procedure can be realized in PHP, I am just looking for PHP code examples!
HTML code for the form to upload file. You can save this page as index.htm <html> <head> <title>File Upload Form</title> </head> <body> <form action="getfile.php" method="post"><br> Select File to upload: <input type="file" name="uploadFile"> <input type="submit" value="Upload File"> </form> </body> </html> Code (markup): Now here is the php code of getfile.php to process the uploaded file to uploads directory. That means you should create a folder named uploads in the scripts working directory before you run the script. <html> <head> <title>File Upload Status</title> </head> <body> <?php move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], "../uploads/{$_FILES['uploadFile'] ['name']}") ?> </body> </html> Code (markup): Hope it will help!
ok, thanks spc, we will try this code later and will let you know about the results, hope this will help
If you are talking about the emails with attachment in php, it is very much possible and very easy to do. For very easy ready to use few lines of code with proper comments see this: http://codingtricks.blogspot.com/2008/04/php-send-email-with-attachment.html