Code:Then here's the PHP code you need at the top of the page where you're going to have your upload form. You need to change the database access details at the top and the 'defines' to specify your domain and path names. Create the DEST_DIR directory on the server with 777 permissions. define('MAX_ALLOWED_FILE_SIZE', 1024000); // change 1024000 with the size U wish to allow people to upload define("DEST_DIR", '/upload/1/'); / / set your upload dir define('DEST_PATH', '/home/yourcpanelid/public_html' . DEST_DIR); //path to your dir define('DEST_URL', 'http://yourdomain.com' . DEST_DIR); $allowed_types = array("image/gif", "image/pjpeg", "image/x-png", "image/bmp"); //set the allowed extensions $dbhost = "localhost"; $dbname = "yourdb_name"; $dbuser = "yourdb_user"; $dbpass = "yourdb_password"; $errormessage = "Please enter file to be uploaded."; //change this message to whatever U want




Reply With Quote
Bookmarks