1
I’m with a logoff system, and it works, but, I didn’t want to run it by using URL:
$logoff = filter_input(INPUT_GET, 'logoff', FILTER_VALIDATE_BOOLEAN);
if($logoff){
unset($_SESSION['userlogin']);
session_destroy();
header('Location: ../painel');
}
<a href="painel.php?logoff=true">Sair</a>
Would you have some way of, uh, putting a onclick
for example, within this <a>
to run a PHP function? Like we do with javascript, for example:
<a href="javascript:void(0)">Sair</a>
Or do you think I could keep logging on like this?
I wanted to do:
<a href="<?php echo minhaFuncao()?>">Sair</a>
If you want to run PHP from behind and get some result, you are actually looking for Ajax
– Isac