Hi From Turkey,
I have a toplist and I want to prevent certain websites that I recorded previously in database. I recorded only domain names( ie: hotmail.com), and want to catch the registrations which contains this domains. For example in registration form user entered www.hotmail.com http://www.hotmail.com or http://www.hotmail.com/index.asp, I must prevent this registration using the record “hotmail.com”
But the codes below is incorrect. Please modify the SQL line in order to prevent this sites. Please help me.
Thanks in advance
Ali Goksel
Kayitformu.asp:
<html>
<head>
<title>Form</title>
</head>
<body>
<form method="get" action="verify.asp">
site name
<input type="text" name="URL" size="20" value="http://">
<input type="submit" value="Save" name="cmd">
</form>
</body>
</html>
Verify.asp:
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("yasak.mdb")
URL = request.querystring("URL")
set objRS = Server.CreateObject("ADODB.Recordset")
sql = "select * from tblBanUrl where Banurl like '%" & URL & "%' "
objRS.open sql,conn,1,3
if objRS.eof then
response.write "Nothing found. So this site is not banned"
response.end
else
do while not objRS.eof
response.write "Banned Site Name:"
response.write "<br>"
response.write objRS("banurl")
objRS.movenext
loop
end if
%>
Database:
Database name: yasak.mdb
Table Name: tblBanurl
Field Name: Banurl
Records: hotmail.com, msn.org, microsoft.com