Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Registration Form + Database + Checking Page

    Ok here is the registration form:

    http://www.orient-explorer.com/sgx/Registration.asp

    Upon filling and submitting it, the data will enter the database (MDB file). Afterwards, it will redirect you to the Checking page, unfortunately, it does not request the data from the previous page (the registration page), this is because the action command for the form on the registration page only instructs the submission button to add the data to the database, not to pass the values to the checking page.

    Code:
    <form method="POST" action="<%=MM_editAction%>" name="form2">
    This is the line for submitting the form, as you can see, its action is for the database. If I were not having a database, it would have been "RegistrationCheck.asp" which would allow the Registration Checking page to request the values.


    I am not 100% sure, but I believe forms can only have one action, so if this is the case, how do I request the values from the Registration Page and have the Registration Check page collect those values and display them?


    Please note, if you do test the registration page out, you will notice on the Checking page the values "Not Interested" in some of the fields, that is because of some additional code I have put in the Registration Check page, so just ignore them.

    Thanks for any help.. Oh and you might notice from the MM that I am using Dreamweaver to help me build this.

    - Dan

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    I might be getting the wrong end of the stick here, but...

    You have file one (booking form), which submits to file two (database insert), which then sends people to file three (confirmation page)?

    Why not just get the database file to display the confirmation page after it's done the databasey bit? You don't need that third page to be a seperate file call. You can lump it all together. And you'd have your submitted form variables.

  • #3
    New Coder
    Join Date
    Apr 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, that is what I want to do, unfortunately, I do not know how to do that, because logically, when I look at it, how can it know what data to show? Yes, I have unique id's, but at this point, the only way I can see how to do this, is to create a session, but sessions are something beyond me, I am not even sure if this IS what sessions do.

  • #4
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Ok: you know that you can send data to the server using a form. You know that ASP pages can do stuff with that data when it arrives at the server, and you know that ASP pages can also send content - HTML code - back to the browser.

    Start with your registration form. Looking at the source, I notice that the form is effectively submitting to itself. This is a good start, because it means you've already got one file - registration.asp - doing two things. It displays a form, and it processes any submitted data into a database. We can build on that:

    registration.asp
    Code:
    <%
    'first, check to see if a form has been submitted
    
    
    dim mySubmittedFlag
    mySubmittedFlag = request.form("submitted")
    
    if mySubmittedFlag = "yes" then
    
    'if it has, put in some code to get the data (and drop it into the database)
    
    myVariable = request.form("something")
    databaseConnection.Execute("INSERT INTO myTable (myFieldname) VALUES (" & myVariable  & ")")
    
    %>
    
    <p>Thankyou for completing our form. You entered <%=myVariable %></p>
    
    <%
    
    else
    
    ' if no form has been submitted, draw a form for them to submit
    
    %>
    
    
    <form action="registration.asp" method="post">
    <input type="hidden" name="submitted" value="yes">
    </form>
    
    
    <%
    end if
    %>
    Does that help at all? It's pretty much what you're doing now, except that it now both processes the form AND displays the thankyou page.

  • #5
    New Coder
    Join Date
    Apr 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oh FFS, it's that simple?

    I feel stupid.

    Thanks.


  •  

    Posting Permissions

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