Re: JavaScript-Informix... HELP!!!
Posted in 1998
Topics: Stored Procedures & SPL, Server Administration, Java & JDBC Development
norli wrote:
>
> I have the following entry in my Informix OWS 7.22:
>
> emp=0
> name=abc
> priv=1
>
> I have the following in my JavaScript codes:
>
> (At a login screen, enter employee ID (emp). The following codes will
> verify the privilege)
>
> cursor=database.cursor("select * from STAFF where emp='" + request.emp +
> "'")
> cursor.next()
>
> if (cursor.emp==request.emp) // checks if emp exists
> {
> var empID = request.emp
> if (cursor.priv=="1") // checks for privilege
> {
> redirect("admin.htm")
> }
> }
>
> Problem:
>
> If I enter 0 at the login screen and submit, it'll bring me the
> admin.htm page.
> If I enter 000 at the login screen and submit, it'll also bring me the
> admin.htm page.
>
> From dbaccess, if I query
>
> SELECT * FROM staff WHERE emp='000'>
> The info for emp=0 is displayed. Strange...? HELP!!!!
>
> Thanks in advance.
>
> :-( norli
Hi, Norli !
Excuse me for my dumb question, but what about
the type of emp field of staff table ?
Cheers.
Claudio Duffini.