if (isset($_POST['submitted'])) { if (is_uploaded_file($_POST['image'])) { $newfile = "profile/profile?" . $row->id; // $row is set earlier in mysql_fetch_object if (!move_uploaded_file($_FILES['image'], $newfile)) { print "Error Uploading File."; exit(); } }