hey guys, i no its st pats day but can someone please help me!!!!!!!
i have an asp that populates a dropdown box with destinations. i chose one of the destinations from the dropdown box. this leads to another asp where i want my choice and the database information to be displayed on the 2nd asp.
problem is,itl display the 2nd asp but it wont display the chosen destination...
the code is:
1st asp........................
<%
Dim connection
Dim check
Dim check2
Dim check3
Dim check4
Dim logindata
Dim loginData2
Dim loginData3
Dim loginData4
Dim insert
Dim query
Set connection = Server.CreateObject("ADODB.Connection")
connection.Mode = 3
connection.Open("auction1")
Set logindata = Server.CreateObject("ADODB.RecordSet")
check= "SELECT DISTINCT Destination FROM MockDest"
Call logindata.Open(check,connection)
On Error Resume Next
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional //EN">
<HTML>
<HEAD>
<TITLE> Updatable Choose</TITLE>
<link rel="stylesheet" href="file:///C|/Inetpub/Mhaire%20 type="text/css">
</HEAD>
<BODY BGCOLOR = "#FFFF99" class="stylesheet1">
<H1><U>High Flyers</U> </H1><BR><BR>
<H2>Please Enter Your Credit Card Details </H2><BR><BR>
<H2></H2>All the field below MUST be completed.<BR>
<title>Test Form</title>
<script language="Javascript">
function checksubmit()
{
if ((document.formname.qty.value == "")|| (isNaN(document.formname.qty.value)) )
{
alert("Please enter a quantity value");
document.formname.qty.focus();
return false
}
return true
}
</script>
</head>
<body onLoad="document.formname.qty.focus()"
<br>
<TABLE>
</TABLE>
Wend
<tr><td>
destination:
<TD><select name="Destination">
<%
If Request.Cookies ("Destination")<>"" Then
Call Returning()
Else
Call NewUser()
End If
%>
</select>
<br><br>
</form>
<%
Sub Returning()
Dim found
found = False
While Not logindata.EOF
%> <OPTION
<%
If(Not found) Then
If Request.Cookies("Destination")_
= logindata("Destination")_
Then
Call Response.Write("SELECTED")
found = True
End If
End If
%>
Value = "<%=logindata("Destination") %>">
<%=logindata ("Destination")%>
<% Call logindata.MoveNext()
Wend
End Sub
Sub NewUser()
While Not loginData.EOF
%> <OPTION VALUE = "<%=loginData("Destination")%>">
<%=loginData ("Destination")%>
<% Call logindata.MoveNext()
Wend
Call loginData.MoveFirst()
End Sub
%>
2nd asp.................
<%
'Dimension variables
Dim connection 'Holds the Database Connection Object
Dim check 'Holds the recordset for the records in the database
Dim logindata 'Holds the SQL query for the database
Dim totalCost
Dim quantity
Dim cost
Dim arrtime
Dim destination
Dim deptime
Dim leaving
Dim flightID
Dim total
Set connection = Server.CreateObject("ADODB.Connection")
Call connection.Open ("auction1")
check = "SELECT Destination FROM MockDest WHERE Destination = '"_
& Request ( "Destination") & "'"
Set logindata = Server.CreateObject("ADODB.Recordset")
Call logindata.Open (check , connection)
On Error Resume Next
if Request ("Destination") = logindata("Destination") Then
totalCost = logindata("Destination")%>
<th> The total cost of the flights is: </th><br>
<%Response.Write(totalCost)
%>
<%end if
%>
i would be extremely gratful for any replies!!!!!!!
i have an asp that populates a dropdown box with destinations. i chose one of the destinations from the dropdown box. this leads to another asp where i want my choice and the database information to be displayed on the 2nd asp.
problem is,itl display the 2nd asp but it wont display the chosen destination...
the code is:
1st asp........................
<%
Dim connection
Dim check
Dim check2
Dim check3
Dim check4
Dim logindata
Dim loginData2
Dim loginData3
Dim loginData4
Dim insert
Dim query
Set connection = Server.CreateObject("ADODB.Connection")
connection.Mode = 3
connection.Open("auction1")
Set logindata = Server.CreateObject("ADODB.RecordSet")
check= "SELECT DISTINCT Destination FROM MockDest"
Call logindata.Open(check,connection)
On Error Resume Next
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional //EN">
<HTML>
<HEAD>
<TITLE> Updatable Choose</TITLE>
<link rel="stylesheet" href="file:///C|/Inetpub/Mhaire%20 type="text/css">
</HEAD>
<BODY BGCOLOR = "#FFFF99" class="stylesheet1">
<H1><U>High Flyers</U> </H1><BR><BR>
<H2>Please Enter Your Credit Card Details </H2><BR><BR>
<H2></H2>All the field below MUST be completed.<BR>
<title>Test Form</title>
<script language="Javascript">
function checksubmit()
{
if ((document.formname.qty.value == "")|| (isNaN(document.formname.qty.value)) )
{
alert("Please enter a quantity value");
document.formname.qty.focus();
return false
}
return true
}
</script>
</head>
<body onLoad="document.formname.qty.focus()"
<br>
<TABLE>
</TABLE>
Wend
<tr><td>
destination:
<TD><select name="Destination">
<%
If Request.Cookies ("Destination")<>"" Then
Call Returning()
Else
Call NewUser()
End If
%>
</select>
<br><br>
</form>
<%
Sub Returning()
Dim found
found = False
While Not logindata.EOF
%> <OPTION
<%
If(Not found) Then
If Request.Cookies("Destination")_
= logindata("Destination")_
Then
Call Response.Write("SELECTED")
found = True
End If
End If
%>
Value = "<%=logindata("Destination") %>">
<%=logindata ("Destination")%>
<% Call logindata.MoveNext()
Wend
End Sub
Sub NewUser()
While Not loginData.EOF
%> <OPTION VALUE = "<%=loginData("Destination")%>">
<%=loginData ("Destination")%>
<% Call logindata.MoveNext()
Wend
Call loginData.MoveFirst()
End Sub
%>
2nd asp.................
<%
'Dimension variables
Dim connection 'Holds the Database Connection Object
Dim check 'Holds the recordset for the records in the database
Dim logindata 'Holds the SQL query for the database
Dim totalCost
Dim quantity
Dim cost
Dim arrtime
Dim destination
Dim deptime
Dim leaving
Dim flightID
Dim total
Set connection = Server.CreateObject("ADODB.Connection")
Call connection.Open ("auction1")
check = "SELECT Destination FROM MockDest WHERE Destination = '"_
& Request ( "Destination") & "'"
Set logindata = Server.CreateObject("ADODB.Recordset")
Call logindata.Open (check , connection)
On Error Resume Next
if Request ("Destination") = logindata("Destination") Then
totalCost = logindata("Destination")%>
<th> The total cost of the flights is: </th><br>
<%Response.Write(totalCost)
%>
<%end if
%>
i would be extremely gratful for any replies!!!!!!!