Jump to content

Recommended Posts

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

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 ;)

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.

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");

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'; }

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.