Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send variable to web page

Status
Not open for further replies.

tonyx666

MIS
Apr 13, 2006
214
GB
ok this is a page that uses information from a form, searches the database and displays the results..

the 2 bold items i would like to send them to another page.. certain items would have to preload with these values already in them..

my question is what code do i place on page 2 to receive these values and place them in the form elements.



Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<% 
'SET-UP AND DECLARE VARIABLES TO GATHER
'FORM INFO FROM PAGE1.ASP

DIM sPostCode, sCarSelection, sCarModel

sPostCode = trim(request.form("postcode"))
sCarSelection = ucase(request.form("car1"))

'RUN A CONDITION SO THAT THE CAR SELECTED CODE
'IS OUTPUTTED TO THE SCREEN AS THE MODEL OF THE CAR CODE

if sCarSelection = "C1" then
sCarModel = "Saloon"
elseif sCarSelection = "C2" then
sCarModel = "Estate"
elseif sCarSelection = "C3" then
sCarModel = "People Carrier"
elseif sCarSelection = "C4" then
sCarModel = "Executive"
end if


 
'DECLARE CONNECTION VARIABLES

DIM myconn, connection, rs

set myconn = Server.CreateObject("ADODB.connection")
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("/_db_import/prices.mdb") & ";"
myconn.open (connection)

set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select price from h2t where cartype = '" & sCarSelection & "' and destination = '" & sPostCode & "' ", myconn
%>
<html>
<head>
			<%
DIM sTempVar

sTempVar = "&#"
%>
<p class="mainbody">Listed below are the details of your journey:</p><br>
<p class="mainbody">Pickup: <b>Heathrow</b><br><br>Destination: <b>[b]<%=sPostCode%>[/b]</b><br><br>Car: <b>[b]<%=sCarModel%>[/b]</b><br><br>Price: <b><%=sTempVar & "163;" & trim(rs("price"))%></b></p>
<br>
<p class="mainbody">If you would like to book this transfer online and receive confirmation either by phone or email then please use our:<br><br><a href="taxi-booking.htm">Booking Form</a>.<br><br>If you would like to get another quote please click <a href="price-search.htm">here</a>.</p>

		

			

</body>
</html>
 
You could make a link t the second page that uses the database values in a QueryString

<a href="page2.asp?Destination=<%= sPostCode%>&Car=<%= sCarModel%>

Or you could make an HTML for with these 2 as hidden elements.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top