JoelRocks Posted August 6, 2007 Share Posted August 6, 2007 Hello guys, I have a fully working registration system, it follows the following three stages: Registration - the user enter the details Authentication - the details are validated and verified Submitted- the correct details are added to the database Problem is these are three seperate pages, once the user has been added to the database how can i stop them from simply clicking back and adding the details again? Tried a HTTP Refer, only setting it from the registration page, makes the coding more secure but still giving me a head ache Cheers, Joel Quote Link to comment https://forums.phpfreaks.com/topic/63547-stop-user-from-using-the-back-button-during-registration/ Share on other sites More sharing options...
ViN86 Posted August 6, 2007 Share Posted August 6, 2007 well, you dont want multiple entries anyways. so just add code to check the entered info and make sure it's not in the database. if it's not there, add it, otherwise if it is, tell them that the info exists already and they must specify new user information. theres a way to prevent duplicate entries in MySQL as well, however, that would not necessarily spit out a good looking error to the user. itd be better to either... - write your own code to check the DB OR - determine if there are MySQL errors, interpret the error code, then tell the user what happened EDIT: one more thing, you only need to do this right before the info is added to the database. i mean, it doesnt matter if someone has duplicate information in the text fields as long as you dont try to add it to the db Quote Link to comment https://forums.phpfreaks.com/topic/63547-stop-user-from-using-the-back-button-during-registration/#findComment-316704 Share on other sites More sharing options...
JoelRocks Posted August 6, 2007 Author Share Posted August 6, 2007 No no, There are 3 seperate pages, starting with http://www.remotepanzer.com/Joel/register.php. This is the main page and then you have 2 different pages after that, try registering, see what you think. Quote Link to comment https://forums.phpfreaks.com/topic/63547-stop-user-from-using-the-back-button-during-registration/#findComment-316727 Share on other sites More sharing options...
ViN86 Posted August 7, 2007 Share Posted August 7, 2007 just check to see if the username or email exists in the database before it is inserted. it doesnt matter how many pages there are, there should be one INSERT query. just SELECT * FROM table WHERE username='$username' and a SELECT* FROM table WHERE email='$email' queries and if they return something, then stop the INSERT statement from being called. Quote Link to comment https://forums.phpfreaks.com/topic/63547-stop-user-from-using-the-back-button-during-registration/#findComment-317536 Share on other sites More sharing options...
jcombs_31 Posted August 9, 2007 Share Posted August 9, 2007 I don't understand why you have to show them what they just entered and make them click another button. Too many steps. Just have the form, validate it, if they complete it successfully, then send them somewhere with a header if(user passes test) header("Location: mypage.php"); Quote Link to comment https://forums.phpfreaks.com/topic/63547-stop-user-from-using-the-back-button-during-registration/#findComment-319559 Share on other sites More sharing options...
Crew-Portal Posted August 9, 2007 Share Posted August 9, 2007 use //Login Stuff Here First Page! if ($login = TRUE){ //Login Stuff 2 page } if ($login2 == TRUE){ //Login Stuff 3 page Header ('homepage.php'); } else { echo 'You Did Not Enter All The Fields Correctly'; } Quote Link to comment https://forums.phpfreaks.com/topic/63547-stop-user-from-using-the-back-button-during-registration/#findComment-319680 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.