Please any kind hearted person should help me out, the code below is what i use to upload file...it worked locally but online it refused to move uploaded files into the destination folder. Please help me.
function findexts ($filename)
{
$filename = strtolower($filename) ;
$exts = split("[/\\.]", $filename) ;
$n = count($exts)-1;
$exts = $exts[$n]; return
$exts;
}
$s=rand(1000000000,9999999999);
$_SESSION['slot_id']=$s;
if(isset($_POST['upload'])){
$uploaded=check_input(trim($_FILES['uploaded']));
if($_FILES['uploaded']['name']==""){
$msg="Upload Image Please";
header("Location:index.php?msg=$msg");
exit();
}
$ext = findexts ($_FILES['uploaded']['name']) ;// exit;
//$ran = rand () ;
//echo $id;exit;
$ran = $_SESSION['slot_id'];
$ran2 =$ran."."; //<img src="passport/1267290864.jpg" />
$target = 'passport/image/'."/";
//if ($_FILES['uploaded']['type'] != "image/jpg"){
if ($ext != "jpg") {
$msg="Invalide Image Type; Upload jgp only";
header("location:index.php?msg=$msg");
exit();
}
$limit="100200";
if($_FILES['uploaded']['size']>$limit){
$msg="Image too big. Image must not exceed 100kb";
header("location:index.php?msg=$msg");
exit();
}
$mm=$ran2.$ext;
$targt = $target . $mm;
// move_uploaded_file($_FILES['uploaded']['tmp_name'], $targt);
$ct=$_FILES['uploaded']['tmp_name'];
//$destination='passport/image/'."/".$_FILES['uploaded']['name']; exit; echo
move_uploaded_file($ct,$targt)or die("Image Size is Too Big");
$_SESSION['mcm']=$mm;
header("location:index.php");
exit();
}