My url path is correct, but whenever I click the “Sign Up” button, it leads to 404 error where the page is not found, here my code snippet, anyone know how to fix this? Thank you in advance!
<!-- php code start -->
<?php
print_r($_POST);
?>
<!-- php code end -->
<form action="auth-register.php" method="post">
<div class="row gy-3">
<div class="col-12">
<div class="form-group">
<label for="username" class="form-label">Email</label>
<div class="form-control-wrap">
<input type="email" class="form-control" name="email" id="username" placeholder="Enter email address">
</div>
</div><!-- .form-group -->
</div>
<div class="col-12">
<div class="form-group">
<label for="fullname" class="form-label">Full Name</label>
<div class="form-control-wrap">
<input type="text" class="form-control" name="fullname" id="fullname" placeholder="Enter your full name">
</div>
</div><!-- .form-group -->
</div>
<div class="col-12">
<div class="form-group">
<label for="password" class="form-label">Password</label>
<div class="form-control-wrap">
<input type="password" class="form-control" name="password" id="password" placeholder="Enter password">
</div>
</div><!-- .form-group -->
</div>
<div class="col-12">
<div class="form-group">
<label for="repeat_password" class="form-label">Re-Type Password</label>
<div class="form-control-wrap">
<input type="password" class="form-control" name="repeat_password" id="repeat_password" placeholder="Re-type password">
</div>
</div><!-- .form-group -->
</div>
<div class="col-12">
<div class="form-check form-check-sm">
<input class="form-check-input" type="checkbox" value="" id="iAgree" name="iAgree">
<label class="form-check-label" for="iAgree"> I agree to <a href="#">privacy policy</a> & <a href="#">terms</a></label>
</div>
</div>
<div class="col-12">
<div class="d-grid">
<input type="submit" class="btn btn-primary" value="Sign Up" name="submit">
</div>
</div>
</div><!-- .row -->
</form>
I tried to change the
<form action="auth-register.php" method="post">
to <form action="src/auth-register.php" method="post">
where I specified the path also didn’t work, please help me T_T
1
-
Check File Location: Ensure that the auth-register.php file is located in the correct directory. the file should be in the same directory as the page with the form.
-
Case Sensitivity: Ensure that the file name and the path are correct and match the case exactly. On some servers, file names are case-sensitive.
-
Check Server Configuration: Ensure the web server is configured correctly to serve PHP files.
-
Debugging: Add someone debugging code to check if the form is being submitted to the correct URL.
<script>
document.getElementById('registerForm').onsubmit = function() {
alert(this.action);
return true;
};
</script>
<form id="registerForm" action="auth-register.php" method="post">
<!-- form fields here -->
</form>