SMOKEY_TEK Posted August 25, 2011 Share Posted August 25, 2011 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. Quote Link to comment Share on other sites More sharing options...
SMOKEY_TEK Posted August 25, 2011 Author Share Posted August 25, 2011 I need someone to help me PLEASE ........... Quote Link to comment Share on other sites More sharing options...
Konsigliare Posted August 25, 2011 Share Posted August 25, 2011 I think you may be including a page that includes header.php Check what line 14 actually consists of Quote Link to comment Share on other sites More sharing options...
SMOKEY_TEK Posted August 25, 2011 Author Share Posted August 25, 2011 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(); Quote Link to comment Share on other sites More sharing options...
Anonymous Posted August 25, 2011 Share Posted August 25, 2011 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). Quote Link to comment Share on other sites More sharing options...
SMOKEY_TEK Posted August 26, 2011 Author Share Posted August 26, 2011 (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 August 26, 2011 by SMOKEY_TEK Quote Link to comment Share on other sites More sharing options...
grant Posted August 26, 2011 Share Posted August 26, 2011 post the first 15 lines of header and we may be able find out wots wrong with it Quote Link to comment Share on other sites More sharing options...
Spudinski Posted August 26, 2011 Share Posted August 26, 2011 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. Quote Link to comment Share on other sites More sharing options...
Spudinski Posted August 26, 2011 Share Posted August 26, 2011 (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 August 26, 2011 by Spudinski Quote Link to comment Share on other sites More sharing options...
Spudinski Posted August 26, 2011 Share Posted August 26, 2011 Thank you for your kind words, but I do think it's time for me to stop this game. Quote Link to comment Share on other sites More sharing options...
ShadyCoco Posted August 27, 2011 Share Posted August 27, 2011 "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. Quote Link to comment Share on other sites More sharing options...
SMOKEY_TEK Posted August 27, 2011 Author Share Posted August 27, 2011 Thanks for the help, I still couldn't figure out what was going on so I just got a new Grpg script and did it like that and it's working ... Quote Link to comment Share on other sites More sharing options...
Uridium Posted August 27, 2011 Share Posted August 27, 2011 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.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.