0

Problem is my images don't move to the uploads folder.. There is no syntax error or get message.. but all data saving to database.. So Why do not the images just move.. ? Here is mysql codes;

if(isset($_POST['addslider'])) {

$uploads_dir="../uploads";

@$tmp_name=$_FİLES['sliderimages']['tmp_name'];
@$name=$_Files['sliderimages']['name'];


$sliderrandom1= rand(10000,20000);
$sliderrandom1= rand(20000,30000);
$sliderrandom1= rand(30000,40000);
$sliderrandom1= rand(40000,50000);

$sliderrandomname="$sliderrandom1"."$sliderrandom1"."$sliderrandom1"."$sliderrandom1";

$refimgpath=substr($uploads_dir,3)."/".$name.$sliderrandomname;

@move_uploaded_file($tmp_name, "$uploads_dir/$name$sliderrandomname");

$add_slider=mysql_query("insert into slider (slider_name, slider_imgpath, slider_order, slider_url ) VALUES ('".$_POST['slider_name']."','".$refimgpath."','".$_POST['slider_order']."','".$_POST['slider_url']."' ) ");


    if (mysql_affected_rows()) 
{

header("Location:../slider.php?addslider=ok");


}
        else 
        {

header("Location:../slider.php?addslider=failed");
        } }

I tried remove '@' but still there is no error.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • 1
    The "@" in front of move_uploaded_file suppresses the error messages, so you don't see them. Does the upload folder have the correct permissions? – cjs1978 May 09 '17 at 22:24
  • ohh I didin't know that, I just practicing what I watch on video.. I checked the folder and everything else, everything seems right. –  May 09 '17 at 22:30
  • Try to remove the @ and see if an error appears. Check the chmod of the upload folder. The folder should be writeable by the web server. – cjs1978 May 09 '17 at 22:37
  • still same.. no error, no move –  May 09 '17 at 22:42
  • @$name=$_Files['sliderimages']['name'] should be $name=$_FILES['sliderimages']['name'] – cjs1978 May 09 '17 at 22:45
  • I removed all of them –  May 09 '17 at 22:48

0 Answers0