starvator Posted April 9, 2009 Share Posted April 9, 2009 can someone please tell me what is wrong with the following code <?php include "base.php; $_SESSION = array(); session_destroy(); ?> <meta http-equiv="refresh" content="0";"index.php"> (the page which displays the error is --> http://ipage.netau.net/logout.php <-- thanks ;D Quote Link to comment https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/ Share on other sites More sharing options...
Maq Posted April 9, 2009 Share Posted April 9, 2009 Quote Link to comment https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/#findComment-805086 Share on other sites More sharing options...
BandonRandon Posted April 9, 2009 Share Posted April 9, 2009 what are you trying to do? I think the issue may be with the session I belive it should be in the format of $_SESSION['example']="yes"; Also why use meta refresh instead of <?php header:location ?> ? see: http://us3.php.net/session http://www.w3schools.com/PHP/php_sessions.asp Quote Link to comment https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/#findComment-805087 Share on other sites More sharing options...
starvator Posted April 9, 2009 Author Share Posted April 9, 2009 <meta http-equiv="refresh" content="0;URL=index.php"> this doesnt work... i used a tutorial from http://nettuts.com/tutorials/php/user-membership-with-php/ but i cant seem to get the signout part to work... WHAT I AM TRYING TO DO IS: make a script logout when redirected there... I STILL GET THE ERROR: Parse error: syntax error, unexpected T_STRING in /home/a2638332/public_html/logout.php on line 2 Quote Link to comment https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/#findComment-805094 Share on other sites More sharing options...
unrelenting Posted April 9, 2009 Share Posted April 9, 2009 <?php include "base.php"; $_SESSION = array(); session_destroy(); ?> <meta http-equiv="refresh" content="0";"index.php"> Quote Link to comment https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/#findComment-805103 Share on other sites More sharing options...
starvator Posted April 9, 2009 Author Share Posted April 9, 2009 <?php include "base.php"; $_SESSION = array(); session_destroy(); ?> <meta http-equiv="refresh" content="0";"index.php"> YES! thank you! i just needed to put <?php include "base.php"; $_SESSION = array(); session_destroy(); ?> <meta http-equiv="refresh" content="0;URL=index.php"> A MIX OF 2 ANSWERS:D Quote Link to comment https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/#findComment-805105 Share on other sites More sharing options...
Maq Posted April 9, 2009 Share Posted April 9, 2009 First indent your code. Second use header unless base.php outputs something. include "base.php"; $_SESSION = array(); session_destroy(); header('Location: index.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/#findComment-805108 Share on other sites More sharing options...
unrelenting Posted April 9, 2009 Share Posted April 9, 2009 Glad you got it working. Quote Link to comment https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/#findComment-805111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.