I'm trying to use a logout link to logout from a form, but it's not working (error appears). What am I doing wrong?
Logout.php code:
<? php
session_start();
session_unset();
session_destroy();
header('Location: Login Link');
exit;
?>
Login Form:
<?php
session_start();
?>
<?php
(...)
echo' <p style="text-align:left;"> <a href="abc/logout.php">Logout</a> </p>';
(...)
?>
your first line is <? php
<? php
and it should be <?php
, notice the space
You made a typo mistake:
<? php
<? php
--> <?php
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.