Forum Moderators: open

Message Too Old, No Replies

How to open login in the same frame

Need help

         

erenshte

6:37 pm on Jun 22, 2004 (gmt 0)

10+ Year Member



This is my problem.
The following code is login processing code:

<!-- #include file="dbconn.asp" -->
<%
username = request.form("username")
password = request.form("password")
SQL = "SELECT * FROM Personal WHERE username = '" & username & "' AND password = '" & password & "'"
set rs = cn.execute(SQL)

if rs.eof then
response.redirect "login.asp?error=1"
%>
<!-- #include file="dbconnclose.asp" -->
<%
else
session("loggedin") = true
session("personalid") = rs("PersonalID")
session("alias") = rs("Alias")
session("username") = rs("Username")
SQL = "UPDATE Personal SET TimesLoggedIN = TimesLoggedIn + 1, LastLogin = Now() WHERE Alias = '" & session("alias") & "'"
response.redirect "buildmain.htm"

set ps = cn.execute(SQL)
ps.close
set ps = nothing
rs.close
set rs = nothing

end if
%>

in the login.asp file I have a login form with the following line:

<form name="form1" method="post" target="_top" action="login_proc.asp">

which opens buildmain.htm form log_proc on the
_top window if login is correct

If user makes mistake the login form is displayed
again and id should be displayed at the same
frame as before. There is an initial link from the
manu that opens login form in one of three frames,
let's call main2.

If I change target in the line above to "_self"
it solves the problem, but then buildmain.htm
opens at the same frame too.

I'm stacked with this small and possible easy
solvable problem.

Please, help

erenshte

erenshte

3:18 am on Jun 23, 2004 (gmt 0)

10+ Year Member



This is a new thread.
Please, help