Hi, I have written some code in admin section to insert the wallpaper in the folder. Only the pic name saved in the db. Locally this code works good , add the wallpaper and show it in my local server. but the problem is that when i shall upload it on the server and try to upload some file , it shows some warning, admin section show an entry but image is not displayed . Kindly help me to solve this issue. I have put the code. if($_POST){ $catid = trim(_POST("catid", "", false)); if($catid != ""){ $q = mysql_query("INSERT INTO `wallpapers` SET `catid` = '$catid'"); if($q){ $lastid = mysql_insert_id(); // uploading picture if($_FILES['pic']['error'] == "UPLOAD_ERR_OK"){ $picname = $_FILES['pic']['name']; $fileext = getFileExtention($_FILES['pic']['name']); $picname = str_replace(".$fileext", "$lastid.$fileext", $picname); $picpath = "../" . $WALLPAPER_PIC_DIR . $picname; move_uploaded_file($_FILES['pic']['tmp_name'], $picpath); mysql_query("UPDATE `wallpapers` SET `pic` = '$picname' WHERE `id` = '$lastid'"); } redirect("insert-wallpaper.php?er=done"); }else redirect("insert-wallpaper.php?er=not"); }else redirect("insert-wallpaper.php?er=empty"); } PHP:
Warnings are: Warning: move_uploaded_file(../wallpapers/Lottery-01263.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/funclue/public_html/admin/insert-wallpaper.php on line 28 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpHxFp60' to '../wallpapers/Lottery-01263.jpg' in /home/funclue/public_html/admin/insert-wallpaper.php on line 28 Warning: Cannot modify header information - headers already sent by (output started at /home/funclue/public_html/admin/insert-wallpaper.php:28) in /home/funclue/public_html/functions.inc.php on line 34