Hallo,
Ik heb een fout met het inloggen op een site. Normaal stuurt hij je door maar nu krijg ik deze fout:
Warning: Cannot modify header information - headers already sent by (output started at /home/thomlamp/domains/geldezeltje.nl/public_html/ref2cash/html_top.php:13) in /home/thomlamp/domains/geldezeltje.nl/public_html/ref2cash/inloggen.php on line 54
Ik heb een fout met het inloggen op een site. Normaal stuurt hij je door maar nu krijg ik deze fout:
Warning: Cannot modify header information - headers already sent by (output started at /home/thomlamp/domains/geldezeltje.nl/public_html/ref2cash/html_top.php:13) in /home/thomlamp/domains/geldezeltje.nl/public_html/ref2cash/inloggen.php on line 54
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"html_top.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"_include.php"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]//Kijken of de post verstuurt is.[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
{[/COLOR]
[COLOR= #FF8000]//Alle inputs beveiligen.[/COLOR]
[COLOR= #0000BB]$user[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #FF8000]//Foute errors tegen gaan.[/COLOR]
[COLOR= #0000BB]$error[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]//Is er een gebruikersnaam ingevuld? [/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #FF8000]//Dan zeggen we hem toch wat hij fout deed.[/COLOR]
[COLOR= #0000BB]$error[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"Je hebt geen gebruikersnaam ingevuld.<br>"[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #FF8000]//Is er een wachtwoord ingevuld? [/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #FF8000]//Dan zeggen we hem toch wat hij fout deed.[/COLOR]
[COLOR= #0000BB]$error[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"Je hebt geen wachtwoord ingevuld.<br>"[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #FF8000]//Als er een error is, dan geven we deze maar weer.[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$error[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #FF8000]//Hem is duidelijk maken wat hij fout deed.?[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$error[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]//We kijken of hij wel alles juist heeft ingevuld. [/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM `users` WHERE `user`="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" AND `pass`="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]" AND `emailactief`=yes"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$res[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]//Kijken of hij alles juist heeft ingevuld.[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$res[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je gebruikersnaam of wachtwoord zijn niet juist, of je account is nog niet geactiveerd!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]//Alle gegevens waren correct, nu hem nog inloggen.[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$user[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Location: /leden/index.php[/COLOR][COLOR= #007700]);
}
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<h2>Inloggen</h2>
<form action="" method="post" enctype="multipart/form-data" />
Gebruikersnaam:<br />
<input name="user" type="text" /><br /><br />
Wachtwoord:<br />
<input name="pass" type="password" /><br /><br />
<input type="submit" name="submit" value="Inloggen" /></td>
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"html_bottom.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>