error notice: Constant DB_NAME already defined in
i have file which both show a form and validate it. when showing the form everything is ok, but when i press the submit button so it validate the form, here i got error although the form is well validated, the error is :
notice开发者_开发百科: Constant DB_NAME already defined in C:\wamp\www\ssiphone\ss-config.php on line 15
THX for help :)
You might be using include
or require
instead of include_once
or require_once
.
If the file where DB_NAME
is declared is being included more than once it would throw that error. Otherwise you may just have multiple declarations in your code.
I think you've used, include
or require
to include the file and the file may contain constant value. Replace with,
require_once("FILE_PATH");
or
include_once("FILE_PATH");
It means exactly what it says. You're defining a Constant called DB_NAME, and then trying to define it a second time. Look for this in files that you're including, which you should only be including once.... because my guess would be that you're defining in an included file.
精彩评论