Hoi,
Zit met een inlogfout! Eerst de html, daarna de php!
PHP
<strong>Inloggen</strong><br /><br />
Login met je gegevens waarmee je je hebt geregistreerd om officieel toegang te krijgen tot het systeem!<br /><br /><br />
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="?p=checklogin">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Inloggen </strong></td>
</tr>
<tr>
<td width="78">Email:</td>
<td width="6">:</td>
<td width="294"><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="mypassword" type="password" id="mypassword"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
</table>
</td>
</form>
</tr>
</table><br /><br />
Toon Meer
PHP
<?
// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$encrypted_mypassword=md5($mypassword);
// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT user_email, user_wachtwoord FROM stamperz_users WHERE user_email='$myusername' and user_wachtwoord='$encrypted_mypassword'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_succes.php");
}
else {
echo "Je hebt foute gegevens ingevoerd! Probeer het nogmaals";
}
?>
Hij laat dus de echo zien dat ik continu foute gegevens ingevoerd heb.
Toon Meer