# Help needed asp

**URL:** <https://forum.kirupa.com/t/help-needed-asp/111486>\
**Category:** Uncategorized\
**Created:** [May 27, 2004, 12:46pm UTC](https://forum.kirupa.com/t/help-needed-asp/111486 "2004-05-27T12:46:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![samotboy](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@samotboy](https://forum.kirupa.com/u/samotboy)\
**Post date:** [May 27, 2004, 12:46pm UTC](https://forum.kirupa.com/t/help-needed-asp/111486/1 "2004-05-27T12:46:37Z")

</div>

this is like a password thing i will be realting to my flash form but for now its html forms

userform = Request.QueryString(“user”)  
EnteredPassword = Request.QueryString(“password”)

password = conn.Execute(“SELECT password FROM passwords WHERE username = '”&userform&"’")  
//just finidng the password in my table where the username they entered is

If EnteredPassword=password Then  
//trying to validate the password matched form table with one from form  
ive got my connection and everything but how do i make my sql statement a variable which i can use in my if statement what i ahve setup there doesn’t seem to work please help thaanks in advance

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 2:10pm UTC](https://forum.kirupa.com/t/help-needed-asp/111486/2 "2004-05-27T14:10:09Z")

</div>

Try this instead

userform = Request.QueryString(“user”)  
EnteredPassword = Request.QueryString(“password”)  
String = “SELECT \* FROM passwords WHERE username =’”& userform &"’"  
RecordSet = conn.Execute(String)

if not(RecordSet.EOF) then  
[INDENT]RecordSet.MoveFirst()[/INDENT]  
[INDENT]password = RecordSet.Fields.Item(“password”)[/INDENT]  
[INDENT]If EnteredPassword=password Then[/INDENT]  
[INDENT]’ \*\*\* logged in[/INDENT]  
[INDENT]else[/INDENT]  
[INDENT]’ \*\*\* wrong password[/INDENT]  
[INDENT]end if [/INDENT]  
end if

let me know how it goes :thumb:

[SIZE=1] **EDIT** : _D\*\*N!! I got confused the code above is in ASP cause your threads title says “Need help asp”. Think you meant asap. Anyway with just a few little changes this should still work_[/SIZE]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 10:11pm UTC](https://forum.kirupa.com/t/help-needed-asp/111486/3 "2004-05-27T22:11:46Z")

</div>

i suggest not passing the information as a querystring from the form to the to .asp page as it could lead to security issues.

instead use \<form method=“post”\> with userform = Request.form(“user”)

where “user” is the key just like it is in querystring.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 28, 2004, 12:08am UTC](https://forum.kirupa.com/t/help-needed-asp/111486/4 "2004-05-28T00:08:55Z")

</div>

lol so what does the eof part mean in the recordset this still seems jnot to work ill post a full shown thing of my script if this not work

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 28, 2004, 12:13am UTC](https://forum.kirupa.com/t/help-needed-asp/111486/5 "2004-05-28T00:13:45Z")

</div>

.EOF basically is null

so this part: if not(RecordSet.EOF) then

basically says, if it is TRUE (not null) then “do this” you need this becuase it stops the code from running if there is no user with that username /password combination.

now, the “’ \*\*\* logged in” part of the code is where you would put your code to happen if the user is logged in, which would most likely involve creating a user session with variables such as “username” “password” “access level”

[www.w3schools.com](http://www.w3schools.com) is a good place to learn asp. i taught myself and i have coded an entire forum before 🙂
