dimanche 28 janvier 2018

my if not working or I am making a mistake

when i don't select file and click on "up" , my output is "ok".. i think its wrong. please help me..i confuse. :|

     <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>

<form method="post" action="" enctype="multipart/form-data">
    <input type="file" name="image">
    <button type="submit" name="btn">up</button>
</form>
<?php  
if(isset($_POST['btn']))
{
    if(isset($_FILES['image']))
    {
    echo "ok";
    }
}
?>
</body>
</html>

Aucun commentaire:

Enregistrer un commentaire