Okay, wow. I found the perfect login solution. Now I'm working on a captcha solution and I see that Microsoft just came out with something I really like.
Here's the link to the login script
http://www.evolt.org/node/60384
and here's the microsoft script
http://research.microsoft.com/asirra/installation.aspx
I'm trying to figure out what microsoft is talking about here. I've got it close but it's not quite working. Here's how I merged the two register.php and microsofts data but I can't get it to work right. can you see what I missed?
you can see the live version at www.soundmethodmarketing.com/main.php.
here's the code I merged together.
<?
/**
Register.php
Displays the registration form if the user needs to sign-up,
or lets the user know, if he's already logged in, that he
can't register another name.
Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
Last Updated: August 19, 2004
*/
include("include/session.php");
?>
<html>
<title>Registration Page</title>
<body>
<?
/
The user is already logged in, not allowed to register.
/
if($session->logged_in){
echo "<h1>Registered</h1>";
echo "<p>We're sorry <b>$session->username</b>, but you've already registered. "
."<a href=\"main.php\">Main</a>.</p>";
}
/
The user has submitted the registration form and the
results have been processed.
/
else if(isset($SESSION['regsuccess'])){
/ Registration was successful /
if($SESSION['regsuccess']){
echo "<h1>Registered!</h1>";
echo "<p>Thank you <b>".$SESSION['reguname']."</b>, your information has been added to the database, "
."you may now <a href=\"main.php\">log in</a>.</p>";
}
/ Registration failed /
else{
echo "<h1>Registration Failed</h1>";
echo "<p>We're sorry, but an error has occurred and your registration for the username <b>".$SESSION['reguname']."</b>, "
."could not be completed.<br>Please try again at a later time.</p>";
}
unset($SESSION['regsuccess']);
unset($SESSION['reguname']);
}
/**
The user has not filled out the registration form yet.
Below is the page with the sign-up form, the names
of the input fields are important and should not
be changed.
/
else{
?>
<h1>Register</h1>
<html>
<title></title>
<script type="text/javascript">
function HumanCheckComplete(isHuman)
{
if (isHuman)
{
formElt = document.getElementById("mainForm");
formElt.submit();
}
else
{
alert("Please correctly identify the cats.");
return false;
}
}
</script>
</head>
<body>
<h3>
Hey humans, sign up today for an account at Sound Method Marketing LLC!
</h3>
<p>
<?
if($form->num_errors > 0){
echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font></td>";
}
?>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>
<tr><td>Email:</td><td><input type="text" name="email" maxlength="50" value="<? echo $form->value("email"); ?>"></td><td><? echo $form->error("email"); ?></td></tr>
<tr><td colspan="2" align="right">
<input type="hidden" name="subjoin" value="1">
<input type="button" value="Join!" onClick="javascript:Asirra_CheckIfHuman(HumanCheckComplete)"></td></tr>
<tr><td colspan="2" align="left"><a href="main.php">Back to Main</a></td></tr>
</table>
</form>
<?
}
?>
<br><script type="text/javascript" src="//challenge.asirra.com/js/AsirraClientSide.js"></script>
<script type="text/javascript">
// You can control where the big version of the photos appear by
// changing this to top, bottom, left, or right
asirraState.SetEnlargedPosition("bottom");
// You can control the aspect ratio of the box by changing this constant
asirraState.SetCellsPerRow(6);
</script>
<br>
</form>
</body>
</html>