Advertisement
Advertisement
| 04.24.2008 at 05:44PM PDT, ID: 23352372 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: |
<?php
session_start();
$_SESSION['newform'] = 1;
?>
<html>
<head>
<title> You Bet Your Ass!</title>
<link rel="stylesheet" type="text/css"
href="mystyle.css" />
<script type="text/javascript">
function validateForm(form)
{
var ar_errors = new Array();
var j=0;
for(var i=0; i < form.elements.length;i++)
{
if(form.elements[i].type == "text" || form.elements[i].type == "password" )
{
var value = trim(form.elements[i].value);
if(value == "")
{
ar_errors[j] = form.elements[i].name;
j++;
}
}
}
if(ar_errors.length > 0)
{
var errorString="\n";
for(var i=0; i < ar_errors.length;i++)
{
errorString += ar_errors[i] + "\n";
}
alert("You forgot to enter in the fields for: " + errorString );
return false;
}
else
{
return true;
}
}
function trim(s)
{
var l=0; var r=s.length -1;
while(l < s.length && s[l] == ' ')
{ l++; }
while(r > l && s[r] == ' ')
{ r-=1; }
return s.substring(l, r+1);
}
</script>
</head>
<body>
<table width="100%">
<tr>
<td> <img src="logo.jpg" alt="You bet your ass logo" width="600" height="150"> </td>
</tr>
<tr>
<td>
<!-------START BODY-->
<?php
if(isset($_POST['submit']) )
{
include("dbconnect.php");
include("Globals.php");
$email = trim($_POST['email']);
$password = trim($_POST['password']);
$query ="SELECT * FROM users WHERE email = '$email' AND password = '$password'";
$r = mysql_query ($query);
if(!$r)//bad sql command
{
printSqlError();
printLogin();
}
//check for error input empty password or userID
else if( $email == "" || $password == "")
{
print "<p class='warning'> You forgot to enter in either your email or password.</p>";
printLogin();
}
//check for error input incorrect password or userID
else if(mysql_num_rows($r) == 1)
{
$row = mysql_fetch_array($r);
$_SESSION['name'] = $row['username'];
$_SESSION['email'] = $email;
$_SESSION['password'] = $password;
echo "<script language=javascript>window.location.href=\"main.php\"</script>";
}
else
{
print "<p class='warning'> Incorrect Login or Password!</p>";
printLogin();
}
}
else
{
printLogin();
}
function printLogin()
{
print <<< HTMLBLOCK
<center>
<form action ="Login.php" onSubmit="return validateForm(this)" method = "post">
<table>
<tr>
<td align = left>
<fieldset>
<legend> Login</legend>
<label for="email">Email :</label>
<br/>
<input type = 'text' name = 'email' id="email" size = '40'/>
<br/>
<label for="password">Password :</label>
<br/>
<input type = 'password' name = 'password' id="password" size = '25'/>
<br/> <br/>
<input type = 'submit' name = 'submit' value = 'submit'/>
<br/> <br/>
<a href='LostPassword.html'> Forgot Password?</a>
<br/>
</fieldset>
</td>
</tr>
</table>
<br>
<br>
HTMLBLOCK;
}
?>
</form>
<!--------END BODY---------->
<!------------------- ENDING MAIN TABLE FOR PAGE-------------->
</td>
</tr>
</table>
</body>
</html>
|