Ämne: Gästbok
Visa ett inlägg
Oläst 2009-05-09, 04:07 #4
CotopaXi CotopaXi är inte uppkopplad
Flitig postare
 
Reg.datum: Nov 2004
Inlägg: 321
CotopaXi CotopaXi är inte uppkopplad
Flitig postare
 
Reg.datum: Nov 2004
Inlägg: 321
Kod:
<tr>
<td><input type="checkbox" name="checkboxen" value="dude" /></td>
</tr>
<tr>
<td> Hemsida:<br>
<input name="Hemsida" size="60" style="font-family:trebuchet ms, verdana;font-size:9px;border:#000000 solid 1px;background-color:#d5d6d5;;">
</td>
</tr>
<tr>
<td class="guess"> Inlägg:<br><textarea name="Inlagg" cols="80" rows="5" style="font-family:trebuchet ms, verdana;font-size:9px;border:#000000 solid 1px;background-color:#d5d6d5;;" ></textarea>

</td>
</tr>
<tr>
<td>
<input type="submit" value="Skicka" name="B1" style="font-family:trebuchet ms, verdana;font-size:9px;width: 110;border:#000000 solid 1px;color:#666666; background-color:#d5d6d5;">
</td>
</tr>
</form>
</table>
<%
'Lägger till posterna
If Request.Querystring("visa") = "spara" AND len(Request.Form("Inlagg")) > 0 then


'Anti-Spam Check
if request.form("checkboxen") <> "dude" then
response.redirect "no_access.asp"
end if


strNamn = SafeSQL(Request.Form("Namn"))
strEpost = SafeSQL(Request.Form("Epost"))
strHemsida = SafeSQL(Request.Form("Hemsida"))
strDatum = now()
strInlagg = SafeSQL(Request.Form("Inlagg"))
strIP = Request.ServerVariables("REMOTE_ADDR")

If Len(strHemsida) > 0 AND Instr(strHemsida,"http://") = 0 then
strHemsida = "http://" & strHemsida
End If

If InStr(strInlagg, "<a href") Then
Response.Redirect("67.asp")
Elseif InStr(strInlagg, "[url") Then
Response.Redirect("67.asp")
Elseif InStr(strInlagg, "[URL") Then
Response.Redirect("67.asp")
Elseif InStr(strInlagg, "http://") Then
Response.Redirect("67.asp")
Else
objConn.Execute("INSERT INTO gastbok(Namn,Epost,Hemsida,Datum,Inlagg,IP) VALUES('" & strNamn & "','" & strEpost & "','" & strHemsida & "','" & strDatum & "','" & strInlagg & "','" & strIP & "')")
Response.Redirect strSidnamn
End If
End If

' Stänger och förstör alla objekt
objRS.Close : Set objRS = nothing
objConn.Close : Set objConn = nothing
%>
CotopaXi är inte uppkopplad   Svara med citatSvara med citat