I have an issue with my form.
Here's my form structure.
<form method="POST" action="../login.php">
<input type="submit" name="login" value="test">
</form>
It's really only that.
But on my login page, it cannot get the POST parameter, and error logs says nothing.
<?php
if(isset($_POST['login']))
{
echo "true";
}
else {
echo "false";
}
^^ That's my php code, right there. I've also tried with
if($_SERVER['REQUEST_METHOD'] == "POST"){}
Instead of isset.
Can anyone see what i do wrong here??
Kind regards
open login.php directly from URL and at the top of the code in login.php add the code given below.
<?php
echo "hello";die;
?>
if you see the hello on the page that means your login.php working fine. but if you not that means your file is renamed incorrectly sometimes it happens by our editor. the file becomes like login.php.txt
If the filename is correct and you are not getting hello then your server is not working.
and it seems your code is also fine.
You can also use POSTMAN to post data on your page without form and there is one more alternative ajax. ../login.php is the wrong path.
if everything works fine then the error is 100% in the path.