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();
    }
}