Login | Register | FAQ

Simple Login Page

+ Post a reply

2 posts Page 1 of 1

Simple Login Page

by Overgaard » Wed Mar 16, 2016 3:28 pm

I have from another thread borrowed this code:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da" lang="en">

<script type="text/javascript">

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


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


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?
User avatar


  • Posts: 2
  • Joined: Wed Mar 16, 2016 3:23 pm

Re: Simple Login Page

by johnmacd » Thu Apr 14, 2016 1:18 pm

Try this code:

<div align="center">
<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 style="margin-bottom:5px;">
<span style="width:100px;">Name</span>
<input style="width:150px;" type="text" name="name" id="name" value="Mike">
<div><span style="width:100px;">password</span><input style="width:150px;" type="password" name="password" id="password" value="">
<input type="submit" value="Login"></form>
User avatar


  • Posts: 23
  • Joined: Thu Jun 13, 2013 12:50 pm
Website Designer with 7 years experience as WordPress Developer. Affordable, Professional and Experienced. 100% Satisfaction. 24/7 Available.

+ Post a reply

Page 1 of 1