Начал изучать php и читаю книгу PHP for the web (fourth edition) некого Ларри Улмана. При изучении возникла проблема. Код html Код (Text): <h2>Registration Form <small class="text-muted">23.01.2018</small></h2><!-- Registration Form --> <p>Please complete this form to register</p> <form action="handle_reg.php" method="post"> <div class="form-group"> <label for="InputEmail1">Email Address</label> <input type="email" name="email" class="form-control" id="InputEmail1" aria-describedby="emailHelp" placeholder="Enter email"> </div> <div class="form-group"> <label for="InputPassword1">Password</label> <input type="password" name="password" class="form-control" id="InputPassword1" placeholder="Password"> </div> <div class="form-group"> <label for="InputPassword2">Confirm Password</label> <input type="password" name="confirm" class="form-control" id="InputPassword2" placeholder="Confirm Password"> </div> <div class="form-group"> <label for="InputYear">Year You Were Born</label> <input type="text" name="year" class="form-control" id="InputYear" placeholder="YYYY" value="YYYY"> </div> <div class="form-group"> <label class="my-1 mr-2" for="inlineFormCustomSelectPref">Favorite Color</label> <select class="custom-select my-1 mr-sm-2" id="inlineFormCustomSelectPref"> <option selected>Choose...</option> <option value="red">Red</option> <option value="yellow">Yellow</option> <option value="green">Green</option> <option value="blue">Blue</option> </select> </div> <div class="form-group"> <div class="custom-control custom-checkbox"> <input type="checkbox" name="confirm" class="custom-control-input" id="customCheck1"> <label class="custom-control-label" for="customCheck1">I agree to the terms</label> </div> </div> <button type="submit" class="btn btn-primary">Register</button> </form> <hr> ПХП Код (Text): echo '<h1>Registration Results</h1>'; // Flag variable to track success $okay = true; // Validate email if (empty($_POST['email'])) { echo '<div class="alert alert-danger" role="alert">Please enter your email address.</div>'; $okay = false; } // Validate password if (empty($_POST['password'])) { echo '<div class="alert alert-danger" role="alert">Please enter your password.</div>'; $okay = false; } // Validate the two passwords for equality if ($_POST['password'] != $_POST['confirm']) { echo '<div class="alert alert-danger" role="alert">Your confirmed password does not match to the original password.</div>'; $okay = false; } // Validate the birth year { if (is_numeric($_POST['year'])) { $age = 2018 - $_POST['year']; //Calculate age this year } else { echo '<div class="alert alert-danger" role="alert">Please enter the year You were born as four digits.</div>'; $okay = false; } // Check that they were born before this year if ($_POST['year'] >= 2018) { echo '<div class="alert alert-danger" role="alert">Either you entered your birth year wrong or you come from the future!</div>'; $okay = false; } // If there no errors, print a success message if ($okay) { echo "<p>You have been successfully registered (but not really).</p><p>You will turn $age this year.</p>"; } Проблема конкретно вот с этим: Код (Text): // Validate the two passwords for equality if ($_POST['password'] != $_POST['confirm']) { echo '<div class="alert alert-danger" role="alert">Your confirmed password does not match to the original password.</div>'; $okay = false; } Даже при вводе двух одинаковых паролей все равно выводит сообщение о том что они не совпадают. В чем причина? Заранее, спасибо.