php echo form method post action input type text name login input type

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<?php
echo '<form method="post" action="">
<input type="text" name="login" />
<input type="text" name="password" />
<input type="submit" value="Generate" />
</form>';
if($_POST) {
if(empty($_POST['login']) || empty($_POST['password'])) {
echo 'Error, login or password is empty!';
} else {
echo '<br />'.$_POST['login'].':'.crypt($_POST['password']).'';
}
}
?>