Form code
<form action=<?=$_SERVER['PHP_SELF']?> method="POST" id="form1">
Enter length of password:<input type="text" name="length">
<input type="submit" value="Submit"/>
PHP code
<?php
$length=$_POST['length']
?>
Error:
Undefined array key "length" in D:\XWAMP\htdocs\pg\index2.php on line 30
I'm writing both html and php in single file that's why it's happening but how to handle it?
