How to save password in a form hidden field with PHP and HTML

1 Answer

0 votes
<?php
if (isset($_POST['user_name']))
{
    echo $_POST['user_name'] . "<br />";
    echo $_POST['password'] . "<br />";
}

$password = 983724324;
?>
<html>
<head>
<title>title</title>
</head>
<body>
<form method="post" action="<?php echo $_SERVER ['PHP_SELF'] ?>">
 <input type="text" name="user_name" />
<input type="hidden" name="password" value="<?php echo $password ?>" /> 
</form>
</body>
</html>
<?php
/*
run:

dan
983724324

*/
?>

 



answered Oct 15, 2016 by avibootz
...