|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
php5 - Upload PHP file code
Hi,
I need a code that lets my customers upload a image file from their computer and then that file does 2 things 1. gets uploaded to upload folder on my server 2. a copy of that file gets e-mailed to me this is what I have so far, any improvements/additions on this code would really be appreciated... 1.//GET IMAGE INFO 2. 3. $dir = 'images/'; 4. $file_name = $_FILES['file']['name']; 5. $file_tmp = $_FILES['file']['tmp_name']; 6. 7. //CHECK FOR UPLOADED FILE 8. if(is_uploaded_file($file_tmp)){ 9. //MOVE TO DIR 10. move_uploaded_file($file_tmp, $dir.$file_name); 11. } --------------- Thanks & regards Lokananth Live chat By miOOt |
|
#2
|
||||
|
||||
|
HTML
Code:
<html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> PHP PHP Code:
emailing: PHP Code:
__________________
When I die, I want to go peacefully like my Grandfather did, in his sleep -- not screaming, like the passengers in his car. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > php5 - Upload PHP file code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|