manix Posted August 7, 2011 Share Posted August 7, 2011 Hello, Is there any way to detect an error/warning/notice that occurs at any point of processing the script? Quote Link to comment Share on other sites More sharing options...
requinix Posted August 7, 2011 Share Posted August 7, 2011 Some types of errors, yes. (The others, no.) Quote Link to comment Share on other sites More sharing options...
Adam Posted August 7, 2011 Share Posted August 7, 2011 It depends on your definition of "detect". Yes you can create a generic handler, to customise how you handle the errors, but you can't detect within a block of code if one was produced (well I suppose it's possible, but no practical). Nor should you need to though! PHP errors should be fixed during development. Quote Link to comment Share on other sites More sharing options...
manix Posted August 7, 2011 Author Share Posted August 7, 2011 I am having in mind when someone uses the inspect element (chrome) option to edit something that might result in an error on my script (like hidden inputs in which I pass data to other pages) then I shall terminate the process and send the user to the index page. and I think get_error_last() would do fine. Thank you. Quote Link to comment Share on other sites More sharing options...
Adam Posted August 7, 2011 Share Posted August 7, 2011 As I was saying, you don't need to handle the errors to avoid issues like this. Your code should check the inputs are valid before trying to do anything with them. 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.