ASP side der skal flytte reservations data over på en anden side
Hej,Jeg prøver at lave en side, der kan reservere film. Meningen er at man søger en film, hvor efter man kan reservere en af titlerne. Se det forløbige resultat her : http://www.friserverplads.dk/mini97ad/film-rh.asp
Meningen er at når filmen reserveres, åbnes et nyt billede, der trække data med om den film der er reserveret og dette godkendes med password, login. Hvordan får jeg reservations data med over i et andet billede?
Den foreløbige kode er for neden :
</HEAD>
<BODY>
<form id=\"formSearch\" method=\"post\" action=\"film-rh.asp\">
<input type=\"hidden\" name=\"xmode\"
value=\"search\">
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
<tr>
<td>Søgeord:</td>
<td><input type=\"text\" name=\"film\" size=\"20\" value=\"<%=Request.Form(\"film\")%>\"></td>
</tr>
<tr>
<td> </td>
<%\' A button! - well lets use class=\"button\" to get the style we specified in <style> %>
<td><input class=\"button\" type=\"submit\" name=\"submit\" value=\"Søg\"></td>
</tr>
</table>
<%
\'*** Test if we are in reserve mode ***
If Request.Form(\"xmode\") = \"reserve\" Then
Dim Item
\'*** Pull out reserved movies ***
For Each Item In Request.Form
If Left(Item,3) = \"chk\" Then
Response.Write \"<p>Du har nu reserveret film nummer \" & Request.Form(Item) & \".</p>\"
End If
Next
ElseIf Request.Form(\"film\") <> \"\" then
Dim intHits
\'*** If we have some input, search for it - no more than 100 hits though ***
intHits = DoMovieSearch(Request.Form(\"film\"), 100)
End if
If intHits > 0 Then %>
<BR>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
<tr>
<td> </td>
<td>
<input class=\"button\" type=\"button\" name=\"btnReserver\" value=\"Reserver\" onClick=\"java script:onReserve()\">
</td>
</tr>
</table>
<script type=\"text/javascript\">
function onReserve()
{
document.formSearch.xmode.value = \'reserve\';
document.formSearch.submit();
}
</script>
<BR>
<BR>
<p>Antal hits: <%=intHits%></p>
<% End If %>
<%\' Make sure the form tag is ended AFTER your last <input> tag %>
</form>
</BODY>
</HTML>
<%
\'/**
\'* Use functions. Very nice if you might want to include the search
\'* feature more than one place on the web-site. This function returns
\'* the number of hits.
\'* strKeywords is the what to search the DB for, intMaxHits is the maximum
\'* number of hits you want printed.
\'**/
Function DoMovieSearch(strKeywords, intMaxHits)
\'*** Always remember to Dim your variables ***
Dim DB, DBSti, SQL, rs, Genre, skuespillere, Pris, Antal, Status
DoMovieSearch = 0
Set DB = Server.CreateObject(\"ADODB.Connection\")
DBSti = \"DBQ=\" & Server.Mappath(\"film.mdb\")
DB.Open \"DRIVER={Microsoft Access Driver (*.mdb)}; \" & DBSti
\'*** You might want to check strKeyword for wierd stuff like \', \\, ) - SQL might not like it ***
SQL = \"select * from film where Genre like \'%\" & strKeywords & \"%\' or Titel like \'%\" & strKeywords & \"%\' or Skuespillere like \'%\" & strKeywords & \"%\'\"
Set rs = DB.Execute(SQL)
If not rs.eof then
\'*** Use & _ if you want to continue a string on the next line. vbCrLf will do line return ***
Response.Write \"<table cellspacing=\"\"0\"\" cellpadding=\"\"0\"\" border=\"\"0\"\">\" & vbCrLf & \"<tr>\" & vbCrLf & _
\"<td class=\"\"header2\"\">Vælg</td>\" & vbCrLf & _
\"<td class=\"\"header2\"\">Titel</td><td class=\"\"header2\"\" width=30> </td>\" & vbCrLf & _
\"<td class=\"\"header2\"\">Genre</td><td class=\"\"header2\"\" width=30> </td>\" & vbCrLf & _
\"<td class=\"\"header2\"\">Skuespillere</td><td class=\"\"header2\"\" width=30> </td>\" & vbCrLf & _
\"<td class=\"\"header2\"\">Pris i dkr.</td><td class=\"\"header2\"\" width=30> </td>\" & vbCrLf & _
\"<td class=\"\"header2\"\">Antal</td><td class=\"\"header2\"\" width=30> </td>\" & vbCrLf & _
\"<td class=\"\"header2\"\">Ledige</td><td class=\"\"header2\"\" width=30> </td>\" & vbCrLf & _
\"</tr>\" & vbCrLf
Do until rs.eof
\'*** Only print if have not yet reached our limit ***
If DoMovieSearch < intMaxHits Then
\'*** If the movies have an unique ID use that for the checkbox name ***
Genre = rs(\"Genre\")
Skuespillere = rs(\"Skuespillere\")
Pris = rs(\"Pris\")
Antal = rs(\"Antal\")
Status = rs(\"Status\")
Response.Write \"<tr>\" & vbCrLf & _
\"<td><input type=\"\"checkbox\"\" value=\"\"val\"\" name=\"\"chk\" & DoMovieSearch & \"\"\"></td>\" & vbCrLf & _
\"<td>\" & rs(\"Titel\") & \"</td><td width=30> </td>\" & vbCrLf & _
\"<td>\" & Genre & \"</td><td width=30> </td>\" & vbCrLf & _
\"<td>\" & Skuespillere & \"</td><td width=30> </td>\" & vbCrLf & _
\"<td>\" & Pris & \"</td><td width=30> </td>\" & vbCrLf & _
\"<td>\" & Antal & \"</td><td width=30> </td>\" & vbCrLf & _
\"<td>\" & Status & \"</td><td width=30> </td>\" & vbCrLf & _
\"</tr>\" & vbCrLf
End If
\'*** Inc the number of hits in the return variable ***
DoMovieSearch = DoMovieSearch + 1
rs.movenext
Loop
Response.Write \"</table>\" & vbCrLf
Else
Response.Write \"<p class=\"\"error\"\">Der var ingen film, der matchede din søgekriterier!</p>\"
End If
\'*** Do some cleaning up ***
Set rs = Nothing
DB.Close
Set DB = Nothing
End Function
%>
