Version: 2
Type: Full Script
Category: Other
License: GNU General Public License
Description: I have written this program on linux OS , the directory structure will be different for windows OS , you can configure it as u require, but initially follow the commented documentation for installation and configuration in uploadresp.html read the comments carefully before using it
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Author" content="Madhu"> <meta name="GENERATOR" content="Mozilla/4.75 [en] (Win98; U) [Netscape]"> <title>uploadresp</title> </head> <body> <html> <br><body> <br><? <br> # Name this file as uploadresp.php and put it in phpcodes directory <br> # note upload.php and uploadresp.php must be in same folder <br> # directory structure <br> # /home/httpd/html/ideas chmod 777 uploaddirectory <br> # /home/httpd/html/ideas/giftimages/ <br> # /home/httpd/html/ideas/phpcodes <br> # If u see a message permission denied for image upload message <br> # give chmod 777 ideas Directory <br> # give chmod 777 giftimages Directory <br> # in myproject directory <br> # where uploaddirectory is subfolder or child directory <br> # Original Code to Upload file : Written by James Smith <br> # Configuration ============================= <br> <br> $uploaddir = "/home/httpd/html/ideas/giftimages/"; <br> $username = "James Smith"; <br> $email = "[email protected]"; <br> $mailsubject="Image Uploaded"; <br> $mailsubject2="Image Upload Failed"; <br> $Fromname="James Smith"; <br> $Fromaddress="James Company "; <p> //Upload 2 Image ------------------------------------- <br> if(!empty($myimage_name)) <br> { <br> if(copy($myimage,$uploaddir.$myimage_name)) <br> { <br> $msg="Hi James, the $myimage_name is Uploaded into $uploaddir Directory"; <br> print ($msg); <br> if (mail($username." <".$email.">", $mailsubject, $msg, "From: ".$Fromname." <".$Fromaddress.">nContent-Type: text/html; charset=iso-8859-1")) <br> { <br> print ("Confirmation Mail Sent "); <br> } <br> else <br> { <br> print ("Mail Could not be Delivered"); <br> } <br> } <br> } <br> else <br> { <br> $msg="Hi James, Something Went Wrong Image did not Get Uploaded , please use chmod777 to upload directory"; <br> print ($msg); <br> if (mail($username." <".$email.">", $mailsubject2, $msg, "From: ".$Fromname." <".$Fromaddress.">nContent-Type: text/html; charset=iso-8859-1")) <br> { <br> print ("Confirmation Mail Sent "); <br> } <br> else <br> { <br> print ("Mail Could not be Delivered"); <br> } <br> } <br>?> <br></body> <br></html> <br> <br> <br> </body> </html>