if(trim($ft_uid)) {
if($logout=="Log-Out"){
session_unregister("ft_uid");
session_unregister("ft_pwd");
session_destroy();
exit;
}
}
First, I'd like to know what kind of variables are $fp_uid and $logout... are they session variables, POST variables, GET variables, ... ?
If they are session variables, I suggest you to use $SESSION (ex : $fp_uid => $SESSION["fp_uid"]).
If they are POST variables => $POST ($POST["fp_uid"])
If they are GET vars => $GET ($GET["fp-uid"])
By the way, when you destroy a session, you don't have to unregister sessions variables since the file that contains them will be deleted.
Note : if, to log-out the url look like this : http://www.myserver.com/path/file.php3?log-out
There will not be a variable named log-out. You need to add, at least, an equal sign (=). But since it will contain nothing, it will return false... so you should use isset($log-out) to know if that variable is present.
Ex :
http://www.myserver.com/path/file.php3?log-out=
if(isset($_GET["log-out"])) {
code...
}
Personnally, I would do the same thing as above, but for the URL I would write : http://www.myserver.com/path/file.php3?log-out=1
I find it nicer with a 1 ! 😛