0

How can store the php code error messages to session variable so that i can access to the error messages to another page:

Eg:

$_SESSION[error] = error_reporting(0);

Output:

Notice: Use of undefined constant data - assumed 'data' in F:\Currnet Source\Infogreen\root\Advocate\lib\script\error_session.php on line 5

Notice: Undefined index: data in F:\Currnet Source\Infogreen\root\Advocate\lib\script\error_session.php on line 5

Please Help me to resolve my problem.

1
  • Using exceptions. Just get php error and that's it. Also you can write custom messages and save in session. P.S. Don't forget to start session. Commented May 5, 2016 at 10:27

1 Answer 1

1

You must enclose the error variable name, putting it without any enclosing quotes means that it is a CONSTANT

$_SESSION['error'] = 'Your error code here';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.