Login procedure multiple pages, please help

Results 1 to 2 of 2

Thread: Login procedure multiple pages, please help

  1. #1
    Join Date
    Dec 1969

    Default Login procedure multiple pages, please help

    I am building a registration process in 5 steps with 5 pages. All variable have to be past from page to page and on page 5 it is submitted in a Database. On page 1, they create an account and I have the following problem:<BR><BR>How do I check the data first for valid format using a Javascript and then check if the username already exists in the database, BEFORE I proceed to page 2?<BR><BR>At this moment I have:<BR><BR>1) Page contains a form with input boxes for username, pwd, and re-type pwd.<BR>2) Submit button that calls a JavaScript function verify() that verifies the usual format checks<BR>3) If something is wrong an alert gives the error message<BR>4) If the format is correct it submits the form using: document.form.submit()<BR>5) The action for the form is &#060;FORM ACTION="page2.asp" METHOD="post"&#062;<BR>6) All variables are passed to page2 where more information is asked.<BR><BR>NOW: the big question somewhere in this process, the username that is given must be checked if it already exists in the database. I know how to check this, but where do I declare and call this function?? From the JavaScript?? I am not asking how to check if the username exist already, I know this but I just do not know where to declare this function and how to call it.<BR>Somehow AFTER the verify() function, but BEFORE loading page2.asp, the database must be opened and checked for the username.<BR><BR>I do not want the username to be checked on page 2 because I don&#039t want to load any "error" pages. I just want to use alerts and msgBox&#039es for speed. Only when verify() gives no error and the username does not exist do I want to load another page: page 2. PLEASE: can anybody tell me how this can be done?

  2. #2
    Janne Guest

    Default RE: Login procedure multiple pages, please help

    What about submitting the form to itself:<BR>1. &#060;FORM ACTION="page1.asp" method="post")<BR>2. Put a hidden field in the form called "todo", with the value "checkuser"<BR>3. In the beginning of the page1.asp-code, check if the form is being submitted or accessed for the first time with an If-statement:<BR><BR>If Form.Request("todo")="checkuser" Then <BR>... the user database check goes here... and if it is ok use Server.Transfer("page2.asp") to redirect to the new page. <BR>4. If the password is wrong, use Response.Write to write an error message somewhere near the login fields, and the user will be able to directly try again.<BR><BR>Hope this helps!<BR>

Posting Permissions

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