Jump to content


[Closed] PHP Cannot redeclare...


  • This topic is locked This topic is locked
No replies to this topic

#1 Friiks

    Young Padawan

  • Members
  • Pip
  • 56 posts
  • Gender:Male
  • Location:Latvia
  • Interests:Guitar, music, having all sorts of fun...and well enjoying my life (as enjoyable as it can be) as good as I can :D<br /><br />Oh yea, and of course - http://snowmoons.com

Posted 10 July 2007 - 04:27 PM

Hi!

I just switched hosts for my site and I'm fixing the bugs I didn't see. But I just noticed something that I don't know how to fix. When I try to access a part of my site I get this error:

error said:

Fatal error: Cannot redeclare userlist() (previously declared in /path_goes_here/header.php:7)
in /path_goes_here/header.php on line 6

And those lines in header.php are
function userlist(){
$timee=time();
$time=$timee-(60*15);
mysql_query("DELETE FROM `online` WHERE `username`='".$_SESSION['username']."'");
mysql_query("DELETE FROM `online` WHERE `time`<'".$time."'");
mysql_query("INSERT INTO `online` (id,username,time,uid) VALUES ('NULL','".$_SESSION['username']."','".$timee."','".$_SESSION['id']."')") or die('Error - '.mysql_error());				
}

I'm really confused and have no idea what am I doing wrong :P

Thanks, Matt

Edit:

I'm sorry to bother you with my stupidness...I noticed I was calling header.php twice..

Edited by Friiks, 10 July 2007 - 04:38 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users