...

View Full Version : Registration Form + Database + Checking Page



Icedan
01-11-2007, 03:56 AM
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.


<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

Spudhead
01-11-2007, 11:03 AM
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.

Icedan
01-11-2007, 11:35 AM
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.

Spudhead
01-11-2007, 12:50 PM
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


<%
'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.

Icedan
01-12-2007, 11:44 AM
oh FFS, it's that simple?

I feel stupid.

Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum