<?php
if ($_GET['go'] == "yes"){
if ($_GET['loggedin'] == "true"){
function dosomething (){
$_GET['loggedin'] = false;
echo "You have been successfully logged out.<br />";
}
}
if ($_GET['loggedin'] == "false"){
function dosomething (){
$_GET['loggedin'] = true;
echo "You have been successfully logged in.<br />";
}
}
dosomething();
}
if ($_GET['loggedin']){
?><a href="index.php?go=yes&loggedin=true">click here to log out</a><?php
} elseif (!$_GET['loggedin']){
?><a href="index.php?go=yes&loggedin=false">click here to log in</a><?php
}
?>