http://www.fhhsbandhome.com/authalpha/forms.php
What I am trying to do should be pretty obvious. I'm in the process of building a new auth system for myself. (don't recommend me to use available ones on the Internet, none of these do what I need it to. I'm about an average PHP coder looking for some help.
The system at this point is very simple, to login enter your username, password, an "image name" for a previously selected image and click the image to login. If image = ur previously selected image, username = username and password = password and image name= image name, dologin();. Well by using Tamperdata in Firefox I saw that the form posts the following
POSTDATA=username=username&password=password&imagename=Image+Name&x=22&y=48
(this is a posted form at that link without any modification data acquired with Tamperdata)
As you can see it's passing the username alright, password, and the image name. I'll post my code below. If someone could make the correction so it would also pass the Image ID such as 01, 02, 03 that would be great!!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Simple CSS forms by roScripts</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<script language="javascript" type="text/javascript">
<!--
function IsBlankField(field){
var j = 0;
var chr;
for(j; j < field.length; j++){
chr = field.charAt(j);
if(chr != "" && chr != " " && chr != "n" && chr != "t"){
return false;
}
}
return true;
}
function SendTo(id){
//shortening form elements
var myForm = document.getElementById('myForm');
var txtSearch = document.getElementById('username');
var srchURL; // this variable will hold the URL of the search engine to be used
var srchVar; // this variable will hold the value of the text field 'name' which will hold the string to be searched
if(IsBlankField(txtSearch.value)){
//if the text field is blank
alert("Please enter text!");
} else{
switch(id){
case '01':
srchURL = "01";
break;
case '02':
srchURL = "http://en.wiktionary.org/wiki/Special:Search?";
break;
case '03':
srchURL = "http://en.wikiversity.org/wiki/Special:Search?";
break;
case '04':
srchURL = "http://en.wikinews.org/wiki/Special:Search?";
break;
case '05':
srchURL = "http://en.wikispecies.org/wiki/Special:Search?";
break;
case '06':
srchURL = "http://en.wikiquote.org/wiki/Special:Search?";
break;
case '07':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '08':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '09':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '10':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '11':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '12':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '13':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '14':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '15':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '16':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '17':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '18':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '19':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '20':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '21':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '22':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '23':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '24':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
case '25':
srchURL = "http://en.wikisource.org/wiki/Special:Search?";
break;
default:
srchURL = "http://meta.wikimedia.org/wiki/Special:Search?";
break;
}
//adding the attribute name and values to the form and text field elements
myForm.setAttribute("action", srchURL);
txtSearch.setAttribute("name", srchVar);
myForm.setAttribute("target", "_blank"); //this, of course, will open a new browser window
myForm.setAttribute("method", "get");
myForm.submit();
}
}
//-->
<body>
<div id="container">
<div id="top">
<h1>Please complete the form bellow</h1>
</div>
<div id="leftSide">
<fieldset>
<legend>Login details</legend>
We have added another layer of security to protect your accounts. <div style="clear:both;"></div>
To login:<div style="clear:both;"></div>
1: Enter your username and password<div style="clear:both;"></div>
2: Enter a name for one of the pictures on the right. <div style="clear:both;"></div>
3: Click on that picture.<div style="clear:both;"></div>
Each time you login after the first time, you will need to enter the same picture name and click on the same picture.</font> <br />
<div style="clear:both;"></div>
<form name="myForm" id="myForm" action="forms.php" method="post" class="form">
<label for="username">Username</label>
<div class="div_texbox">
<input name="username" type="text" class="username" id="username" value="username" />
</div>
<label for="password">Password</label>
<div class="div_texbox">
<input name="password" type="password" class="password" id="password" value="password" />
</div>
<label for="imagename">Image Name</label>
<div class="div_texbox">
<input name="imagename" type="text" class="imagename" id="imagename" value="Image Name" />
</div>
<div class="clear"></div>
</fieldset>
<hr size="1" />
</div>
<div id="rightSide">
<p>Confused? Submit your login by clicking on your picture below.</p>
<p id="flagbar">
<!--begin submit login images-->
<input type='image' src='images/securitypics/01.jpg' id="01" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/02.jpg' id="02" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/03.jpg' id="03" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/04.jpg' id="04" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/05.jpg' id="05" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/06.jpg' id="06" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/07.jpg' id="07" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/08.jpg' id="08" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/09.jpg' id="09" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/10.jpg' id="10" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/11.jpg' id="11" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/12.jpg' id="12" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/13.jpg' id="13" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/14.jpg' id="14" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/15.jpg' id="15" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/16.jpg' id="16" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/17.jpg' id="17" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/18.jpg' id="18" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/19.jpg' id="19" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/20.jpg' id="20" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/21.jpg' id="21" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/22.jpg' id="22" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/23.jpg' id="23" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/24.jpg' id="24" onClick="SendTo(this.id)"/>
<input type='image' src='images/securitypics/25.jpg' id="25" onClick="SendTo(this.id)"/>
<!--end submit login images-->
</p>
</div>
<div class="clear"></div>
</div>
</body>
</html>
In case you haven't realized I've never attempted anything like this before, as the idea is there, but I defiantly don't see many things similiar to this on the web so I hope you guys are able to assist me. If you could even rewrite the whole thing to be more efficent that would be great lol. I would be a great way to give me a great start on a auth for a system that will be for a very good cause, our high schools band website 🙂
fhhsbandhome.com