hi
i have thes code
<? session_start();
if($_SESSION["login"]!= "true"){
header("location:../SecurePages/Login.php");
}
$path = 'banner/';
$imgname = basename($_FILES['fleImage']['name']);
$temp_file = $_FILES['fleImage']['tmp_name'];
include_once("../DataAccess.php");
if($_POST["btnAdd"]){
if($_POST["txtTitle"]=="" || $_POST["txtSummary"]=="" || $_POST["txtDetails"]==""
|| $_FILES["fleImage"]["name"]=="")
// $message="Please fill all fields";
$message="<script>window.alert(' الرجاء تعبئة جميع الحقول ')</script>";
else{
$type=strtolower($_FILES["fleImage"]["type"]);
if(strstr($type,"gif")||strstr($type,"png")||
strstr($type,"jpg")||strstr($type,"jpeg")){
// $message="Please select valid image type";
$message="<script>window.alert(' الرجاء اختيار النوع الصحيح للصورة ')</script>";
$split=explode(".",$imgname);
$type=$split[sizeof($split)-1];
$imgname=time().".".$type;
$title=$_POST["txtTitle"];
$summary=$_POST["txtSummary"];
$details=$_POST["txtDetails"];
}
$message="<script>window.alert('(jpg,png,gif) الرجاء اختيار احدى هذة الصيغ للصورة')</script>";
}
if (file_exists($path.$imgname)) {
echo 'file already exists';
}
else
{
move_uploaded_file($temp_file,$path.$imgname);
mysql_query("INSERT INTO `banner` ( `id` , `title` , `summary` , `details`
, `image` , `date` , `url` ) VALUES ('', '$title', '$summary', '$details',
'$imgname', sysdate() , '$url');");
// $message="News was added successfully";
$message="<script>window.alert(' تمت الاضافة ')</script>";
}
}
?>
this code worke on localhost but when i translate it into server of my web we not wokr and deplaye this massege
Warning: move_uploaded_file(banner/1219818320.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/kamiti/public_html/Banner/AddBanner.php on line 39
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpNOduAq' to 'banner/1219818320.gif' in /home/kamiti/public_html/Banner/AddBanner.php on line 39