Jump to content
MakeWebGames

Recommended Posts

Posted

I log in and I get this error for some odd reason.

 

Fatal error: Cannot redeclare microtime_float() (previously declared in /home/hitmanm1/public_html/header.php:12) in /home/hitmanm1/public_html/header.php on line 14

 

If anyone can help me with this much appreciated, I have no idea what I did to get this error.

Posted

This is what is on line 14 }

 

function microtime_float() {
	$time = microtime();
	return (double)substr( $time, 11 ) + (double)substr( $time, 0, 8 );
}

microtime_float();
$starttime = microtime_float();
Posted

Another one where the error clearly states what the problem is and suggest how to cure it:

Fatal error

Somewhat self explanatory - the parser cannot proceed until action is taken to address this problem.

Cannot redeclare microtime_float()

Again should be obvious - Once a function had been declared, it cannot be redeclared

previously declared in /home/hitmanm1/public_html/header.php:12

That shows you where it is initially declared

in /home/hitmanm1/public_html/header.php on line 14

and where the attempt to redeclare it occurs.

Apart from a minor discrepancy in line numbers, it's apparent that the header.php file is being included twice. You need to examine closely each file to find out where it is including header.php (or other files which in turn include header.php).

From your htdocs (or public_html) folder:

grep -ril header.php *

will report the names of any files including header.php. (Decent editors often have similar capabilities these days if you are not command-line savvy).

Posted (edited)

The only pages I changed was my register, login, activate, forgotpassword... And I don't see anything including header. This is starting to get annoying. Grrr!

 

So how do I do this

 

grep -ril header.php *
Edited by SMOKEY_TEK
Posted
Why the hell would you need the first 15 lines?

It clearly states line 12 and line 14 - that does not mean 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13 or 15.

Stop spamming. You clearly don't know what you're talking about.

Posted (edited)

As you should know functions aren't usually just one line in length.

Saying to remove line x only would cause a syntax error, as you should know. It would also cause the script to execute in a manner not intended.

Then again, it is possible that two scripts are cross-including each other, which could also produce this error.

It's easy for the layman to assume everything is simple, but that's just not the case. To be proficient in what you do, you have to be able to think outside of the box for an answer to every possible question.

I have made a thread entitled "PHP Errors", which provides example errors with the most common causes.

Feel free to educate yourself with it.

Edited by Spudinski
Posted

"The only pages I changed was my register, login, activate, forgotpassword"

You may of included the wrong header?

Login,register, any page with GRPG without a session needs nlheader.php and nlfooter.php

That's the only thing I can think of.

If you need more help PM your msn and I can try my best.

Posted

Smokey that error just means that there are 2 Functions with the exact same name being used easiest way to find this out would be to open all the PHP files in notepad++ and do a search in all files for that name thats being declared twice if you get 2 results then you know 1 needs to be removed..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...