I have a logoff system, and it works, but, I did not 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 there be any way to put a onclick
, for example, within this <a>
to execute a function in PHP? The same we do with javascript, for example:
<a href="javascript:void(0)">Sair</a>
Or do you guys think I could continue to log off like this?
I wanted to do, for example:
<a href="<?php echo minhaFuncao()?>">Sair</a>