SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Dec 2000
    Location
    BOSTON MA
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi folks. need a little help.
    i have a login script where the user is asked for a username, pass1, pass2 (confirmation), and email.
    the script checks that the username is unique and that the passwords match, then enters the data into the db.

    my problem starts here. how do i direct the user to the second part of the sign-up process (a second, longer form) once the criteria are met?

    here's a part of the code:

    Code:
    //check to see if the 2 entered passwords match
    
    if ($upass == $upass2) {
        $sqlquery = mysql_query("SELECT * FROM $table WHERE (uname='$uname')");
        if (mysql_num_rows($sqlquery) > 0) {
    
    printf("We are sorry to inform you that the User Name <B><?php echo $Name ?></B> Is already Taken.");
    
    }
        else {
    
    //insert the values into the Db
    
             $sqlquery = mysql_query("INSERT INTO $table VALUES('$uname','$upass','$Email')");
    
    printf("You have registered.<BR>
    
            User Name: $uname
            <BR>
            Password: $upass");
         }
    }
    
    //problem area
    //problem area
    //problem area
    //problem area
    
    
    else {
        printf("Your Two Passwords Did Not Match");
    }
    the question is what goes in the "problem area"? how do i tell the script "go to form2"?

    is this making any sense? can anyone help??
    aaaaaaahhhhhhhhhhhhhhhhhhhhh <---- sorry...


    . . . chris

  2. #2
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2 ways... when you are echoing "you have been registered", etc.... just put the form in there, submitting to another URL...

    secondly, process the form FIRST, and if successful, Header("Location: new url"); ... then the new url could say "you have been registered, etc"

    Regards
    -----------------------
    SitePoint Community Advisor
    myPHPhost: our service speaks for itself


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •