|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
header location
ok, so i've got something like this:
session_start(); if ($logout == 1) { session_destroy(); header("location:index.php"); exit; as far as i understand php it means that if you log out, you'll go to index.php , right? i dont want to go to index.php, but stay on current page? i saw something like it somewhere, but i dont know where. what sould i put in "location: ?? " to make it stay on the same page? greetz roberto |
|
#2
|
|||
|
|||
|
it should be
header("location: " $_SERVER['PHP_SELF']); That should do it. |
|
#3
|
|||
|
|||
|
it looks like another problem is exit; , should be exit(); , though you don't NEED to use exit() after a header anyway.
and shouldn't it be either header("Location : $_SERVER[PHP_SELF]"); or header("Location : " . $_SERVER[PHP_SELF]); ? I normally just double quote the whole statement , but woudln't it error without the concatenation? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > header location |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|