Error message
Moderator: General Moderators
Error message
i made a form that has unique values,and when i enter values that are already in database and click submit button an error message(500) pops out because there are already values with the same data,i want it to be that way...but my question is,can i somehow override the output of this error,i want to show it only to the user as an usual alert box?
Re: Error message
It depends entirely on how your code is set up. If your database code automatically echo()s the error message to the screen, then there's not much you can do. However, if it just records the error in a function return value, or some other variable that you then output later in your code (ie: in your template), then you should be able to modify your template to output the error in an alert() box rather than HTML to the page
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Error message
Have the script query the database for records that match submitted data, if so, give them you custom message.
A server error is never an acceptable response to the end user.
A server error is never an acceptable response to the end user.
Re: Error message
it is a tricky business with this code because its a joomla component that i am recoding...i didnt want to show the server error to the user,i wanted to change the output and then show it...twinedev wrote:Have the script query the database for records that match submitted data, if so, give them you custom message.
A server error is never an acceptable response to the end user.