Code: Select all
<?php
if($_SESSION['sessref'])
{
session_unregister($_SESSION['sessref']);
//session_unset();
session_destroy();
header("location:admin.php");
}
?>Moderator: General Moderators
Code: Select all
<?php
if($_SESSION['sessref'])
{
session_unregister($_SESSION['sessref']);
//session_unset();
session_destroy();
header("location:admin.php");
}
?>Code: Select all
$_SESSION = array();Try calling session_write_close(); before sending the header. Secondly, you might want to call exit() after sending the header(). Thirdly, some browsers won't understand relative links, so use the full path instead.ms_dos10 wrote:I'm get log out page blank and doesn't send me to admicp.php page .
i think header function doesn't work or what ?
Nope, but you can try it for yourself and we'll nudge you when needed.ms_dos10 wrote: And can you tell me with code it'll help me more and butter
Code: Select all
<?php
if($_SESSION['sessref'])
{
$_SESSION['sessref'] = array();
session_unset();
session_destroy();
header("location:admin.php");
exit();
}
?>Code: Select all
<?php
if($_SESSION['sessref'])
{
$_SESSION = array();
session_unset();
session_destroy();
header("location:admin.php");
exit();
}
?>Code: Select all
<?php
$neg = array('off', 0, false, '', null);
$flags = array(
'Register Globals' => 'register_globals',
'Short Tags' => 'short_open_tag',
'Display Errors' => 'display_errors',
'Magic Quotes GPC' => 'magic_quotes_gpc',
'Magic Quotes Runtime' => 'magic_quotes_runtime',
'Magic Quotes Sybase' => 'magic_quotes_sybase',
);
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
foreach ($flags as $n => $v)
{
$flags[$n] = (in_array(strtolower(ini_get($v)), $neg) ? 'Off' : 'On');
}
$cli = (php_sapi_name() == 'cli');
$eol = "\n";
$gle = get_loaded_extensions();
$rows = array();
$le = '';
$wide = 4;
$j = count($gle);
$pad = $wide - $j % $wide;
$len = max(array_map('strlen', $gle));
$func = create_function('$a', 'return str_pad($a, ' . intval($len) . ');');
$gle = array_map($func, $gle);
for($i = 0; $i < $j; $i += $wide)
{
$le .= ' ' . implode(' ', array_slice($gle, $i, $wide)) . $eol;
}
$ec = array(
'E_STRICT' => 2048, 'E_ALL' => 2047, 'E_USER_NOTICE' => 1024,
'E_USER_WARNING' => 512, 'E_USER_ERROR' => 256, 'E_COMPILE_WARNING' => 128,
'E_COMPILE_ERROR' => 64, 'E_CORE_WARNING' => 32, 'E_CORE_ERROR' => 16,
'E_NOTICE' => 8, 'E_PARSE' => 4, 'E_WARNING' => 2, 'E_ERROR' => 1,
);
$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
if (($t & $v) == $v)
{
$e[] = $n;
$t ^= $v;
}
}
if (ceil(count($ec) / 2) + 1 < count($e))
{
$e2 = array();
foreach ($ec as $n => $v)
{
if (!in_array($n, $e) and $n != 'E_ALL')
{
$e2[] = $n;
}
}
$er = $er . ' ((E_ALL | E_STRICT) ^ ' . implode(' ^ ', $e2) . '))';
}
else
{
$er = $er . ' (' . implode(' | ', $e) . ')';
}
if (!$cli)
{
echo '<html><head><title>quick info</title></head><body><pre>', $eol;
}
echo 'PHP Version: ', $ve, $eol;
echo 'PHP OS: ', $os, $eol;
echo 'Error Reporting: ', $er, $eol;
foreach ($flags as $n => $v)
{
echo $n, ': ', $v, $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;
if (!$cli)
{
echo '</pre></body></html>', $eol;
}
?>Code: Select all
<?php
header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_FILENAME']) . 'somepage.php');
exit;
?>Code: Select all
<?php
if($_SESSION['sessref'])
{
$_SESSION = array();
session_unset();
session_destroy();
header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['web/student']) . 'admincp.php');
exit();
}
?>