Fout bij inloggen

Gestart doorFrozenflame5 reacties31 weergaven

6 berichten · pagina 1 van 1

Frozenflame

Lid · Topicstarter

Berichten
1.561
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
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

[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] 
?>
0
Berichten
418
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Probeer nu is zet include bovenaan

[COLOR= #0000BB]<?php[/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]
            design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Inloggen[/COLOR][COLOR= #007700]);[/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]
                design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Inloggen[/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]
 [COLOR= #FF8000]//De inhoud van de pagina.[/COLOR]
 design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Inloggen[/COLOR][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]
design_onder[COLOR= #007700]([/COLOR][COLOR= #DD0000]1[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Frozenflame

Lid · Topicstarter

Berichten
1.561
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat wordt niks. Dat design onder enz. moet allemaal weg. Ik werk met html_top en html_bottom. De fout zit denk ik in deze regel: header(Location: /leden/index.php); want daar wordt die doorverwezen.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Vervang

header(Location: /leden/index.php);


door

echo <meta http-equiv="refresh" content="0; url=/leden/index.php" />;


Of zet

ob_start();


bovenin je code
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
staat session_start(); helemaal bovenaan?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Superb:
staat session_start(); helemaal bovenaan?
Daar heeft het niks mee te maken, het gaat erom dat er als HTML is ge-output voordat er gebruik is gemaakt van header();
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren