Php upload

Ok, so i’m uploading with php for my first time… easier then asp, but im still running into a problem

this is my code…

$idir = "../images/";
$tdir = "../images/thumbs/";
$twidth = "125"; 
$theight = "100"; 
$file_ext = strrchr($_FILES["image"]["name"], ".");
  $url = $imageid."".$file_ext;
  if($_FILES["image"]["type"] == "image/jpg" || $_FILES["image"]["type"] == "image/jpeg" || $_FILES["image"]["type"] == "image/pjpeg"){
    $copy = move_uploaded_file($_FILES["image"]["tmp_name"], "$idir".$url);
    if ($copy){
      echo "Image uploaded successfully.<br />";
    } else {
      echo "<font color=\"#FF0000\">ERROR: Unable to upload image.</font>";
  } else {
    echo "<font color=\"#FF0000\">ERROR: Wrong filetype (has to be a .jpg or .jpeg. Yours is $file_ext.</font>";

i keep getting the “ERROR: Unable to upload image.” error :frowning: