stockton Posted April 4, 2007 Share Posted April 4, 2007 I am not sure that I understand the relationship between Ajax and a php script it calls. Basically what I am trying to understand is how do I return an error message from my PHP script to the Ajax/Javascript that called that PHP and how do I exit that PHP script at the point where the error occurred. Is it as simple as :- echo $Message; exit: Quote Link to comment Share on other sites More sharing options...
mainewoods Posted April 5, 2007 Share Posted April 5, 2007 echo $Message; exit: it is that simple! You might want to prefix it with some code so that when it is recieved by ajax it can tell it is an error: echo '**ERROR**' . $Message; exit: when ajax recieves its response, it will test the first characters of the response for '**ERROR**' Quote Link to comment Share on other sites More sharing options...
stockton Posted April 5, 2007 Author Share Posted April 5, 2007 Thank you 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.