Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another question about vbscript

Status
Not open for further replies.

taz97

Programmer
Jun 7, 2001
17
CA
Sorry for my english, i'm french canadian!
Hi again, this is my asp file call "valid". This file are called by login.html. No problem for this. In my asp file, if the login is wrong, I call erreur.html. In this file (erreur.html), I want a button for returning to login.html. I tried:
&quot;<form action=&quot;login.html&quot; method=&quot;post&quot;>
<input type=&quot;button&quot; value=&quot;return to ...&quot;>
</form>&quot;
but nothing. I tried aslso:
&quot;<form action=&quot; method=&quot;post&quot;>
<input type=&quot;button&quot; value=&quot;return to ...&quot;>
</form>&quot;
also nothing !
If someone can help me !!! Thanks ! see below for some file

VALID.ASP
<%
DIM login
DIM password

login = request.form(&quot;login&quot;)
password = Request.Form(&quot;password&quot;)


if (login=&quot;rros017&quot; and password=&quot;osaka98a&quot;) then
Response.Redirect(login & &quot;.html&quot;)

elseif (login=&quot;rdus019&quot; and password=&quot;repas03n&quot;) then
Response.Redirect(login & &quot;.html&quot;)
else
Response.Redirect(&quot;erreur.html&quot;)
end if
%>


ERREUR.HTML
<html>
<!-- Date de création: 2001-10-17 -->
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<title></title>
<meta name=&quot;Description&quot; content=&quot;&quot;>
<meta name=&quot;Keywords&quot; content=&quot;&quot;>
<meta name=&quot;Author&quot; content=&quot;!! LoYa !!&quot;>
<meta name=&quot;Generator&quot; content=&quot;WebExpert 2000&quot;>
</head>
Mauvais mot de passe !
*********
*** Want to return to login.html
*********

</html>
 
OUPS ...
OR if its possible to ...just before the
Response.Redirect(&quot;erreur.html&quot;)
put a line like: popup(Wrong passwd) **after OK, next line)
Response.Redirect(&quot;login.html)
if it's possible, I don't need the file erreur.html

Thanks !
 
Why bother with the error.html page. You could just redirect them back to the login page(login.asp) and add a little message. You will have to use an ASP page for the login.

VALID.ASP
<%
DIM login
DIM password

login = request.form(&quot;login&quot;)
password = Request.Form(&quot;password&quot;)


if (login=&quot;rros017&quot; and password=&quot;osaka98a&quot;) then
Response.Redirect(login & &quot;.html&quot;)

elseif (login=&quot;rdus019&quot; and password=&quot;repas03n&quot;) then
Response.Redirect(login & &quot;.html&quot;)
else
Response.Redirect(&quot;login.asp?invalid&quot;)
end if
%>

Login.asp
<HTML>
<HEAD><TITLE>Login Page</TITLE></HEAD>
<BODY>

<% if request.servervariables(&quot;query_string&quot;) = &quot;invalid&quot; then %>
You entered an incorrect login or password. Please enter a valid login and password.
<% else %>
Please enter your login and password
<% end if %>

<FORM NAME=&quot;Login&quot; ACTION=&quot;VALID.ASP&quot; METHOD=&quot;POST&quot;>
.
.
.
.
<INPUT TYPE=&quot;SUBMIT&quot;.........
</FORM>
</BODY>
</HTML>


Hope this helps a little. You could also use a client side JavaScript script, but then people could view the login and passwords if they viewed the source.
Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top