gaspan1984 Posted June 20, 2009 Share Posted June 20, 2009 Hi Masters I have some problem about handling errors. I have already create a script that add an information that they input to the registration page and send it in database. the problem now is how can I show the invalid message in the same script like empty string or the username is already taken. username: |username| username is already taken/fill the box something like that! Quote Link to comment Share on other sites More sharing options...
cikitani Posted June 21, 2009 Share Posted June 21, 2009 you want it ajax style? or after you submit? Quote Link to comment Share on other sites More sharing options...
gaspan1984 Posted June 22, 2009 Author Share Posted June 22, 2009 After you submit the information. Quote Link to comment Share on other sites More sharing options...
AwptiK Posted June 26, 2009 Share Posted June 26, 2009 You said you want it to verify AFTER they hit submit? $userName = $_POST['userName']; if($userName=='') { redirect and echo box was left blank }else{ $sql = "SELECT * FROM yourtable WHERE username='$username'"; $result = mysql_query($sql,$con); if($result != '0') { insert the stuff into the database }else{ redirect and echo the username is taken } } Sorry if that's totally wrong, it's been a few days. 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.