Nieuw lid |
|
Weet iemand hier de fout in:
<?
setcookie("username", $_POST['naam'], time()+7200) or die("ERROR");
?>
want hij geeft alleen ERROR aan
dit is het stuk waar het in staat:
<?
if(isset($_POST['submit'])){
$sql = mysql_query("SELECT * FROM users WHERE username = '".$_POST['naam']."' AND password = '".md5($_POST['wachtwoord'])."'");
$result = mysql_num_rows($sql);
if(!$result){
echo "No such username or invalid username/password combination.";
}
else{
setcookie("username", $_POST['naam'], time()+7200) or die("ERROR");
echo "Welcome back ".$_POST['naam']." <meta http-equiv=Refresh content=0;url=index.php>";
}
}
?>
<? if(isset($_POST['submit'])){ $sql = mysql_query("SELECT * FROM users WHERE username = '".$_POST['naam']."' AND password = '".md5($_POST['wachtwoord'])."'"); if(!$result){ echo "No such username or invalid username/password combination."; } else{ echo "Welcome back ".$_POST['naam']." <meta http-equiv=Refresh content=0;url=index.php>"; } } ?>
|