home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 October / tst.iso / multimed / IDN / web / mixup / comp.asp < prev    next >
Encoding:
Text File  |  1999-07-19  |  3.5 KB  |  118 lines

  1. <%
  2. ' First try cookie
  3. iRegID = Request.Cookies("BMG_Mixup_RegID")
  4.  
  5. ' Failing that, try string
  6. If iRegID = "" Then
  7.     iRegID = Request.QueryString("id")
  8. End If
  9.  
  10. If iRegID = "" Then
  11.     Response.Redirect("register.asp?type=comp")
  12. Else
  13.     Set conn = Server.CreateObject("ADODB.Connection")
  14.     conn.Open "Dance"
  15.  
  16.     CurrentComp = 0
  17.  
  18.     ' Find current competition (if exists)
  19.     SQLQuery = "SELECT * FROM Comps"
  20.     Set RSComps = conn.Execute(SQLQuery)
  21.  
  22.     Do While Not RSComps.EOF
  23.         If RSComps("Current") = True Then
  24.             CurrentComp = RSComps("CompID")
  25.         End If
  26.         RSComps.MoveNext
  27.     Loop
  28.  
  29.     Set RSComps = Nothing
  30.  
  31.     If CurrentComp <> 0 Then
  32.         ' --- Check to see if user has already entered comp ---
  33.         SQLCheck = "SELECT RegID FROM CompResults WHERE CompID = " & CurrentComp
  34.         Set RSCheck = conn.Execute(SQLCheck)
  35.  
  36.         AlreadyTried = "False"
  37.         
  38.         Do While Not RSCheck.EOF
  39.             If RSCheck("RegID") = cint(iRegID) Then
  40.                 AlreadyTried = "True"
  41.             End If
  42.             RSCheck.MoveNext
  43.         Loop
  44.         
  45.         SQLQuery = "SELECT * FROM Comps WHERE CompID = " & CurrentComp
  46.         Set RSComp = conn.Execute(SQLQuery)
  47.     End If
  48. %>
  49.  
  50. <HTML>
  51. <HEAD>
  52. <TITLE>Dance.Com.2 - Win Free Stuff</TITLE>
  53. </HEAD>
  54.  
  55. <BODY BGCOLOR="#99CC66" background="images/background.gif" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> 
  56. <table width="540" border="0" cellspacing="0" cellpadding="0">
  57.   <tr> 
  58.     <td width="165"><img src="images/win/header_win.gif" width="206" height="61"></td>
  59.     <td width="246"> </td>
  60.     <td><img src="images/group.gif" width="129" height="61"></td>
  61.   </tr>
  62. </table>
  63. <table width="540" border="0" cellspacing="0" cellpadding="0">
  64.   <tr> 
  65.     <td width="20"><img src="images/splash/blank.gif" width="25" height="6"></td>
  66.     <td  </td>
  67.   </tr>
  68.   <tr> 
  69.     <td > </td>
  70.     <td valign="top"> 
  71.             <%
  72.             ' Test to see if there is a current comp on
  73.             If CurrentComp = 0 Then
  74.             %>
  75.                 <font face="Arial" size="2"><P><BR><B>Sorry, at present we do not have any competitions.</B><P>
  76.               <font face="Arial" size="1">Please return soon...                
  77.                 <P><BR><P><BR>
  78.             <P><BR>
  79.             <%Else%>
  80.                 <% ' Test if person already tried comp
  81.                 If AlreadyTried = "False" Then%>
  82.  
  83.                 <form method="POST" action="compresult.asp">
  84.                   <input type="hidden" name="currentc" value="<%=CurrentComp%>">
  85.                   <input type="hidden" name="RegID" value="<%=iRegID%>">
  86.                   <p><font face="Arial" size="2">
  87.                     Ok, here is another question to test your music knowledge and some more exclusive prizes.<br>Good luck!!
  88.                     </font></p>
  89.                   <P><font face="Arial" size="2">Who did Christian Fry tour with last year? (Oasis, Boyzone, Backstreet Boys?)
  90.                     <input type="text" name="Answer">
  91.                     </font>
  92.                   <P><font face="Arial" size="2">For a clue check out Christian Fry in <a href="guide.html">The 
  93.                     Guide</a></font><BR>
  94.                   <P> 
  95.                     <input type="submit" name="Submit" value="Submit">
  96.                        
  97.                     <input type="reset" name="Reset" value="Reset">
  98.                 </form>
  99.     
  100.                 <%Else%>
  101.                     <font face="Arial" size="2"><P><BR><B>Sorry!</B><P>
  102.                   <font face="Arial" size="1">You only get one chance to enter this competition. 
  103.                     We'll email you if you have won!  Good Luck and return soon for our next competition...
  104.                     <P><BR><P><BR>
  105.                 <%End If%>
  106.             
  107.             <%End If%>
  108.       </td>
  109.   </tr>
  110. </table>
  111. <p>  </p>
  112. </BODY>
  113. </HTML>
  114.  
  115. <%
  116.     conn.Close
  117. End If
  118. %>