PDA

View Full Version : Alert on results from querystring


holty
03-23-2003, 11:07 AM
Hi,

I have a login script where if its successful the querystring will be true, i.e - index.asp?login=true and if unsuccessful it will be false, i.e - index.asp?login=false.


If the login is false I would like an Alert saying login incorrect. I have only done alerts before where you have to click things to get them to pop up or on the body onload. How can I do this?

Thanks

fshiu
03-23-2003, 11:52 AM
<%
If Request.Querystring("login") = "False" Then
Response.write "<script>alert('Login incorrect')</script>"
End If
%>

holty
03-23-2003, 12:24 PM
great stuff cheers!!

glenngv
03-24-2003, 01:12 AM
this is not the best way to protect your site since the user can easily change the querystring to true. you should use session variable instead to check if the user has successfully logged in or not.