[SOLVED] Problem with a function
Posted: Sat Aug 14, 2004 9:40 am
Hey, i made a function to check if the user is logged in (justa a simple one)
this is it:
and then on my page i have this:
But i keep getting this error:
Fatal error: Cannot redeclare checklogin() (previously declared in *hidden*\functions.php:7) in *hidden*\functions.php on line 5
this is it:
Code: Select all
<?php
function checkLogin() {
// Check if the the terrastormlogin exists:
if (isset($_COOKIE['terrastormlogin']))
{
return true;
}
else if (!isset($_COOKIE['terrastormlogin']))
{
return false;
}
}
?>Code: Select all
<?php
require("functions.php");
if (checkLogin() == true)
{
$logpic = "nav_03_out.jpg";
$loglink = "logout.php";
}
else
{
$logpic = "nav_03.jpg";
$loglink = "login.php";
}
?>Fatal error: Cannot redeclare checklogin() (previously declared in *hidden*\functions.php:7) in *hidden*\functions.php on line 5