• 0

Declaration Errors


Question

So on my index.php page I get a declaration error:

Fatal error: Cannot redeclare sha512() (previously declared in /home/flownyx/public_html/lacydic/config.php:8) in /home/flownyx/public_html/lacydic/config.php on line 11[/PHP]

And on my config.php file it only contains the following from lines 1-12:

[PHP]<?php
$mysqluser = "censored";
$mysqlpass = "censored";
$mysqldb = "censored";
$mysqlserver = "localhost";


function sha512($input){
$sha512 = hash('SHA512', $input);
return $sha512;
}
[/PHP]

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Is that the ~only~ file you are using right now or do you have other files? Usually that error is because you are including that somewhere else so you have a duplicate instance of it.

Link to comment
Share on other sites

  • 0

Only the index.php file is including the config.php file. I got that response, but when I tried to fix the remaining errors that error popped up again.

Link to comment
Share on other sites

  • 0

is the error because your function name and variable name are the same?

Nope not the issue.

However, are you adding or calling that config.php multiple times in your index.php? Are you 100%?

Link to comment
Share on other sites

  • 0

Nope not the issue.

However, are you adding or calling that config.php multiple times in your index.php? Are you 100%?

My money's on this. include_once() and require_once() are what you should be using unless you have a good reason otherwise.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.