Hjælp til hot or not
Mit Script<%
if (Request.ServerVariables("REQUEST_METHOD") = "POST") then
oldID = Request.Form("thisID")
else
oldID = 0
end if
set connect = server.createobject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.RecordSet")
Connect.open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("hotnot.mdb")
strSQL = "SELECT TOP 1, * FROM hotnot WHERE ID > "& oldID & ";"
Set rs = Connect.Execute(strSQL)
if rs.EOF then
strSQL = "SELECT TOP 1, * FROM hotnot WHERE kon ;"
Set rs = Connect.Execute(strSQL)
end if
if NOT rs.EOF then
oldID = rs("ID")
%>
<html>
<head>
<title>Hot Or Not</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="picture, billede, vote, ratings, rating, scor, date, girls, boys, fun, image">
<meta name="description" content="If you want to know who is the most beautiful, you do not longer need to look in the mirror at home. hitorshit.com gives you the opportunity to meet other people and get your image voted by them.">
<link rel="stylesheet" href="images/hot-or-not.css" type="text/css">
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function FormSubmit()
{
document.form1.submit();
}
function FormSubmit2()
{
document.form2.submit();
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" class="body">
<table width="745" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="745" cellspacing="0" cellpadding="0" align="center" border="0">
<!--tabel 1-->
<form name="form1" method="post" action="default.asp?vote=yes&old=<%=oldID%>">
<tr>
<td colspan="3" height="60"> </td>
</tr>
<tr width="100%">
<td valign="top" rowspan="2" width="8%">
<table cellpadding="0" cellspacing="0" background="images/barometer.gif" width="63" height="382">
<!--tabel 2-->
<tr height="44">
<td width="20" height="44"> </td>
</tr>
<tr>
<td > </td>
<td>
<input type="radio" name="Vote" value="10" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td > </td>
<td>
<input type="radio" name="Vote" value="9" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="radio" name="Vote" value="8" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td > </td>
<td>
<input type="radio" name="Vote" value="7" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td > </td>
<td>
<input type="radio" name="Vote" value="6" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td> </td>
<td >
<input type="radio" name="Vote" value="5" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="radio" name="Vote" value="4" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td > </td>
<td>
<input type="radio" name="Vote" value="3" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td > </td>
<td>
<input type="radio" name="Vote" value="2" onClick="FormSubmit()">
</td>
</tr>
<tr>
<td > </td>
<td>
<input type="radio" name="Vote" value="1" onClick="FormSubmit()">
</td>
</tr>
<tr height="57">
<td height="58"> </td>
</tr>
</table>
<br>
<td valign="top" width="7%" align="center" rowspan="3">
</tr>
<tr width="100%">
<td valign="top" width="85%">
<table cellspacing="0" cellpadding="0" style="margin-top:0;" height="464" border="0">
<!--tabel 3-->
<tr>
<td valign="top" align="center" width="347" rowspan="3">
<table border="0" cellpadding="0" cellspacing="0" width="347">
<tr>
<td nowrap><img src="images/arrow3.gif" align="middle"><font face="Arial Black, Verdana, Arial" size="2" color="#FF6600">
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">Vurder billedet på barometeret for at komme videre</font></font></td>
</tr>
<tr>
<script language="JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
<td align="center"><a href="java script: MM_openBrWindow('mailboxsend.asp?PictureID=<%=rs("Id")%>','Mail','width=350,height=300')"><font face="Arial Black, Verdana, Arial" size="3" color="#FF6600">
<font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Send en besked til personen på billedet</b></font></font></a> </td>
</tr>
<tr>
<td align="center" valign="top">
<table cellpadding="2" width="250" height="325">
<!--tabel 4-->
<tr>
<td align="center" valign="middle"> <a href="java script:MM_openBrWindow('showpicture.asp?PictureID=<%=rs("Id")%>','Picturewindow','status=yes,scrollbars=yes,resizable=yes,width=450,height=500');"><img src="Pictures/Copyright/<%=rs("Image")%>" width="250" border="0"></a>
</td>
</tr>
</table>
<!--tabel 4-->
<input type="hidden" name="thisID" value="<%=oldID%>">
<a href="sendtoafreind.asp?PictureID=<%=rs("Id")%>">
<font face="Arial Black, Verdana, Arial" size="3" color="#FF6600">
<font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Email dette billede til en ven</b></font></font></a><br>
<a href="abuse.asp?PictureID=<%=rs("Id")%>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#999999">
Klik her hvis du ikke mener dette billede hører til her</font></a> </td>
</tr>
</table>
<br>
</td>
<td valign="top" align="center" width="31" height="363"> </td>
<td valign="top" align="right" width="247" height="363">
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td height="50" colspan="2"> </td>
</tr>
<tr>
<td height="35" colspan="2" nowrap bgcolor="#999999"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>Lad
mig se</b></font>
<select name="sex" onChange="MM_callJS('document.form1.submit();')">
<option selected>Vælg
<option value="0">Begge køn
<option value="1">Mænd
<option value="2">Kvinder
</select>
</td>
</tr>
<tr align="center" valign="top">
<td height="85" colspan="2" nowrap>
<%
rs.close
if request("vote") = "yes" then
SQL = "SELECT * FROM hotnot WHERE ID = " & request("old")
set rs = connect.execute (SQL)
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
<tr>
<td> </td>
<td width="80"><img src="Pictures/Copyright/<%=rs("Image")%>" width="70" height="75"></td>
<td valign="top"><br>
Points: <%=rs("points")%> <br>
Gennemsnit: <%=rs("gens")%> </td>
</tr>
</table>
<%
else
response.write "<br><br>Velkommen til Hot Or Not"
end if
if request("sex") = "1" then
session("sex") = "Mænd"
end if
if request("sex") = "2" then
session("sex") = "Kvinder"
end if
if request("sex") = "0" then
session("sex") = ""
end if
response.write "<br>Du ser nu på " & session("sex")
%>
</td>
</tr>
<tr bgcolor="#999999">
<td height="47" colspan="2" nowrap> <font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#0099FF">
<b><font color="#000000">Er du lækker?</font></b></font><br>
<a href="newaccount.asp"><font face="Verdana, Arial, Helvetica, sans-serif" color="#666666"><b><font size="1">Upload dit billede</font></b></font></a><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#666666"> - og se sandheden</font></b></font></td>
</tr>
<tr>
<td height="65" colspan="2" nowrap> </td>
</tr>
<tr bgcolor="#999999">
<td height="30" valign="middle" colspan="2" nowrap> <a href="showhall.asp?show=1" style="text-decoration:none;"><font size="1" color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><b>Hall
of fame</b></font> - </a> <a href="showhall.asp?show=0" style="text-decoration:none;"><font size="1" color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><b>Hall
of shame</b></font></a> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="50" valign="middle" width="200" nowrap> <font size="3"><b><font color="#FF9900" face="Verdana, Arial, Helvetica, sans-serif"> <font size="2" color="#000000">Se
din vurdering</font></font></b></font><b><br>
</b> <font color="#333333"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> Kun for eksisterende brugere</font></b></font> </td>
<td height="50" valign="middle"> <a href="votes.asp" target="_blank">Login</a></td>
</tr>
</table>
</td>
<td valign="top" align="center" width="2" rowspan="3"> </td>
</tr>
<tr>
<td valign="top" colspan="2" height="35">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="72">
<tr>
<td width="70" align="center" valign="middle"><a href="mailto:mail@hitorshit.com"><img src="images/letter.gif" width="27" height="19" border="0"></a></td>
<td valign="top"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" colspan="2" height="200"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
</form>
<%
end if
Connect.Close
'rs.close
%>
</table>
</td>
</tr>
</table>
</body>
</html>
Når man vælger i drop ned menuen om man eks. vil se mænd, kvinder eller begge så sættes der en session.
jeg kan bar ikke finde ud af hvordan jeg får den til at vælge kun kvinder når session sex er sat til 2.
Jeg har prøvet på snart 10 forskellige måder og det virker ikke. Hvis jeg endelig får gang i den vil den kun køre alle poster igennem en gang og ikke starte forfra. Hvad gør jeg ???