0

move_uploaded_file not working. althought the query works fine. newbie to php & daniweb :) .

if($page=="Image")
{

    $uploads_dir = '/gallery';

     $tmp_name = $_FILES["t1"]["name"];

        $name = $_FILES["t1"]["name"];
  move_uploaded_file($tmp_name, "$uploads_dir/$name");




    $insert="insert into gallery values('','$tmp_name')";
    $query=mysql_query($insert);

    if($query)
    {

            header("Location:gallery.php");

    }
    else
    {
        mysql_error();
    }
}
1
Contributor
1
Reply
15
Views
3 Years
Discussion Span
Last Post by thirsty.soul
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.