jamesm6162
01-05-2008, 11:49 AM
Hi
I wrote the following script, but for some reason the function refuses to execute when it's called. The only output I receive is the "---" assigned to the variable at the start.
What am I doing wrong?
$html="---";
function checkSession()
{
$html.="checksession started";
if (session_id() != "")
{
$html .= "Session in Progress";
}
elseif (isset($_POST["username"]))
{
$html .= "Logging in";
}
else {$html .= "Not logged in";}
}
checkSession();
echo $html;
I wrote the following script, but for some reason the function refuses to execute when it's called. The only output I receive is the "---" assigned to the variable at the start.
What am I doing wrong?
$html="---";
function checkSession()
{
$html.="checksession started";
if (session_id() != "")
{
$html .= "Session in Progress";
}
elseif (isset($_POST["username"]))
{
$html .= "Logging in";
}
else {$html .= "Not logged in";}
}
checkSession();
echo $html;