I made a login page using HTML and I’m trying to submit the login details to a PHP script using a form. The problem is, that whenever I click the button to submit, it only reloads the page and besides that absolutely nothing.
I am not sure if the data from the form is supposed to show up in the URL, but in my case it doesn’t.
Here is the code:
<div class="card-header pb-2 pt-4 text-center">
<h2 class="text-uppercase fs-3 fw-bold">login</h2>
<p>Login using your username & password</p>
</div>
<div class="card-body px-4">
<form class="px-3 pb-4" method="POST" action="/includes/login.php">
<p class="ms-2 my-2">Username</p>
<input class="form-control mb-4" type="text" name="username" placeholder="Type your username here">
<p class="ms-2 my-2">Password</p>
<input class="form-control mb-4" name="password" type="password" placeholder="Type your password here">
<button type="submit" name="submit" class="btn w-100 btn-secondary">Login</button>
</form>
</div>
Here is the beginning of the PHP script:
if($isset($_POST["submit"])) {
And it spits out the following error:
POST /includes/login.php - Uncaught Error: Value of type null is not callable in C:websiteincludeslogin.php:3
Thanks for help in advance!
2
Answers
Fixed it myself after a short debugging session, the form was successfully posted, the PHP script was just wrong:
is meant to be:
this shows there is an error on line 3 of login.php file kindly share it