Zaloguj | Zarejestruj | FAQ
Anonymous

Simple Login Page

+ Odpowiedz

Posty: 2 Strona 1 z 1


Simple Login Page

przez Overgaard » Śr mar 16, 2016 3:28 pm

I have from another thread borrowed this code:

Kod: Zaznacz cały
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da" lang="en">
<head>
<title>Login</title>
</head>
<body>

<script type="text/javascript">

function CheckPassword() {
  var username=document.login.username.value;
  var password=document.login.password.value;
  location.href = username + password+'.htm';
}

</script>

<form method="post" action="ingen_javascript.htm"
  onsubmit="CheckPassword();return false;" name="login">
<pre>
Username: <input type="text" name="username">
Password: <input type="password" name="password">
</pre>
<input type="submit" value="log på"
  onclick="CheckPassword();return false;">
</form>

</body>
</html>


It logs me in with username + password to a html-page with a combo of the names ie. user = to and pass = do directs me to todo.html

Thats great, simple and I love it!

But is it any way possible, if I enter anything else than to + do it directs me to a page which basicly says "go away I dont know you"?

Or is it a complete different code I need?
Avatar użytkownika

Overgaard

  • Posty: 2
  • Dołączył(a): Śr mar 16, 2016 3:23 pm

Re: Simple Login Page

przez johnmacd » Cz kwi 14, 2016 1:18 pm

Try this code:

<html>
<head>
<title>Accounting</title>
</head>
<body>
<div align="center">
${param.errorMsg}
<form action="<c:url value='main.do'/>" method="post">
<div style="margin-top:200px;margin-bottom:10px;">
<span style="width:500px;color:blue;font-size:30px;font-weight:bold;border-bottom:1px solid blue;">Accounting System</span>
</div>
<div style="margin-bottom:5px;">
<span style="width:100px;">Name</span>
<input style="width:150px;" type="text" name="name" id="name" value="Mike">
</div>
<div><span style="width:100px;">password</span><input style="width:150px;" type="password" name="password" id="password" value="">
</div>
<input type="submit" value="Login"></form>
</div>
</body>
</html>
Avatar użytkownika

johnmacd

  • Posty: 23
  • Dołączył(a): Cz cze 13, 2013 12:50 pm
--
Website Designer with 7 years experience as WordPress Developer. Affordable, Professional and Experienced. 100% Satisfaction. 24/7 Available.


+ Odpowiedz

Strona 1 z 1