Imtehbegginer Posted November 8, 2007 Share Posted November 8, 2007 Hello I was just wondering, how can I stop the script from continuing? If I use die(); it cuts off the rest of the page (html). So how can I end it without destroying the page. I mean... echo an error such as: "Passwords dont match". Then stop the script from continuing. Quote Link to comment Share on other sites More sharing options...
revraz Posted November 8, 2007 Share Posted November 8, 2007 die ("Passwords don't match"); Quote Link to comment Share on other sites More sharing options...
trq Posted November 8, 2007 Share Posted November 8, 2007 If you stop the script from continuing (die), output will cease aswell. You need to rearange your logic if you want otherwise. Quote Link to comment Share on other sites More sharing options...
SilveR316 Posted November 8, 2007 Share Posted November 8, 2007 Ideally, the code that handles the login to your page should be in a function, so that you can skip the rest of the code in the function based on a certain condition you can set. function login() { // execute login code // if there is an error, break out of the function return; // code down here does not get executed, ever } 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.