Jump to content

Recommended Posts

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 ;D

Link to comment
https://forums.phpfreaks.com/topic/153253-solved-help-with-short-bit-of-code/
Share on other sites

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

 

<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

<?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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.