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();
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.