i am missing something
<?php
$target = "images/dars/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if (file_exists($_FILES['uploaded']['tmp_name']))
{
echo "Sorry, file already exists.";
$Ok = 0;}
//This is our limit file type condition
if ($target!=="image/jpg")
{
echo "You may only upload jpg files.<br>";
$ok=0;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{ Echo "Sorry your file was not uploaded"; }
//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
?>