alot of people told me iam using this the old way and i dont understant the newer way. can some one help me out..
iam trying to build form that will run same file.
so i have only one file called login.php
my form should run php script inside itself, when user click on button.
old way so i been told
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
}
?>
<form action='login.php' method='POST'>
<button type="submit" id="login_button" class="button" >Log in</button>
</form>
so i guess new way is?
<?php
if(isset($_POST['login_button']))
{
}
?>
<form action='login.php' method='POST'>
<button type="submit" id="login_button" class="button" >Log in</button>
</form>
but doesnt work. i also tried this but dont work:
<form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='POST'>