This question already has an answer here:
When I try to run my simple Brute Force Programs Php I get this.
Notice: Undefined index: input1 in /opt/lampp/htdocs/myfiles/Brute/form.php on line 12
Notice: Undefined index: input2 in /opt/lampp/htdocs/myfiles/Brute/form.php on line 13
Data Invalid!
This is my code...
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Script Test</title>
<meta charset="utf-8">
</head>
<body>
<?php
if(isset($_POST['sub'])){
$input1 = $_POST['input1'];
$input2 = $_POST['input2'];
if ( $input1 == "admin" and $input2 == "admin"){
echo "Logged Into The System";
}else{
echo "Data Invalid!";
}
}
?>
<form method="POST">
<input type="text" name="submit1">
<input type="text" name="submit2">
<input type="submit" name="sub">
</form>
</body>
</html>
I thought I defined both indexes and have it all setup correctly. I am relatively new to PHP but am very familiar with HTML. Any help and thoughts would be nice. I can't find anything specific to this question and the other can not define index questions could not help me. Thanks - Ian
Aucun commentaire:
Enregistrer un commentaire