开发者

Trouble With PHP Errors

I am working with my website, and have just have 开发者_开发知识库completed it successfully. This website is for payment process. Everything works fine even though am getting errors. What can I do to fix them?

Here are the errors:

Notice: Constant FIRSTNAME already defined in E:\wamp\www\david\include\variables.php on line 42

Notice: Constant LASTNAME already defined in E:\wamp\www\david\include\variables.php on line 43

Notice: Constant EMAIL already defined in E:\wamp\www\david\include\variables.php on line 44

Notice: Constant ADDRESS1 already defined in E:\wamp\www\david\include\variables.php on line 45

Notice: Constant ADDRESS2 already defined in E:\wamp\www\david\include\variables.php on line 46

Notice: Constant CITY already defined in E:\wamp\www\david\include\variables.php on line 47

Notice: Constant POSTCODE already defined in E:\wamp\www\david\include\variables.php on line 48

it comes untill the 63 lines..

How can I fix this?


Your are just including the file twice where these constants are defined.

Check and include them once.

if you are including the file use

require_once('constants.php')

instead of include()


The code is trying to re-define constants somewhere, an action that is not allowed (hence the name "constants").

My guess is that the same file is getting included more than once somewhere. Look through your code to find out what file defines those constants, and then find out what places it's included.

You should also use include_once instead of include. include_once checks to make sure it hasn't been included already. See the manual here:

http://php.net/include-once


Check to see if you are including the same thing twice in your .php page.


you can turn off error reporting at run time using error_reporting(0);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜