It'll puke if they put in an invalid user name and
password. Check for rs.eof before you display their
name and color.
--- David Shadovitz <[EMAIL PROTECTED]> wrote:
> Can any of you ASP programmers tell me whether the
> following code will
> work?
>
> It is the action page of a login form. It should
> get the user's record
> from a database and display the user's first name
> and chosen color. I'm
> not too concerned that it should be graceful, I just
> want working code.
>
> Thanks.
> -David
>
> ===========
> (I've omitted the beginning and ending HTML tag)
>
> <head>
> <title>User Info</title>
> </head>
> <body>
> <h1>User Info</h1>
> <p>
> <%
> Set Conn = Server.CreateObject("ADODB.Connection")
> Conn.Open "demo"
> set RS = Conn.Execute("select * from [UserInfo]
> where [username]=" &
> request.form("username") & " and [password] =
> request.form("password"))
> %>
> <table border="1" cellspacing="2" cellpadding="2"
> bgcolor="<%
> =RS("color") %>">
> <tr><td>Hello, <% =RS("f_name") %>!</td></tr>
> </table>
> <p>
> Additional page content goes here.
> </body>
>
________________________________________________________________
> YOU'RE PAYING TOO MUCH FOR THE INTERNET!
> Juno now offers FREE Internet Access!
> Try it today - there's no risk! For your FREE
> software, visit:
> http://dl.www.juno.com/get/tagj.
>
------------------------------------------------------------------------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
>
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
> or send a message to
> [EMAIL PROTECTED] with 'unsubscribe'
> in the body.
>
>
------------------------------------------------------------------------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
>
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
> or send a message to
> [EMAIL PROTECTED] with 'unsubscribe'
> in the body.
__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.