<?php if (isset($_POST['name'])&&isset($_POST['password'])) { $name= $_POST['name']; $password= $_POST['password']; if(!empty($name)&&!empty($password)) { echo 'ok'; } else { echo 'please enter all fields'; } } ?> <form action="new.php" method="POST"> Name: <input type="text" name="Name"> password: <input type="password" name="password"></br> <p></p> <input type="submit" name="submit" value="submit"> </form>