Q:

HTML form Validation With PHP

I tried a simple html form for logging in but the form doesn't respond.
I am new to PHP programming.
Please help
<?php
$match = 'honey';

if (isset($user_name) && isset($password)) {
    $user_name = $_POST['user_name'];
    $password = $_POST['password'];
    $submit = $_POST['submit'];

    if (!empty($user_name) && !empty($password)) {
        if ($password == $match) {
            echo 'Logged in';
        } else
            echo 'Incorrect password or username';
    } else
        echo 'Please fill in all the fields';

}

?>

<form action="index.php" method="POST">
Username:<input type="text" name="user_name" /><br><br>
Password:<input type ="password" name="password"/><br><br>
<input type="submit" name="submit" value="Login"/>
</form>

A:

Your are using isset() for variables you haven't declared yet.
Change your 
if (isset($user_name) && isset($password))

To
if (isset($_POST['user_name']) && isset($_POST['password'])

