Login script met MD5

Gestart doorShahiem4 reacties39 weergaven

5 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb een loginscript met md5 maar als ik inlog met de goede gegevens zegt hij dat me wachtwoord onjuist is.
Weet iemand hoe ik dit oplos?

Code:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700])
    {[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]))
        {[/COLOR]
            [COLOR= #0000BB]$arrFout[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt niet alles ingevuld[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [COLOR= #0000BB]$sQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT ID, naam, pass FROM leden WHERE naam = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/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]$sQuery[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
            {[/COLOR]
                [COLOR= #0000BB]$arrFout[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]De opgegeven gebruikersnaam bestaat niet[/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [COLOR= #0000BB]$sFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sQuery[/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]] !=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]))
                {[/COLOR]
                    [COLOR= #0000BB]$arrFout[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Het opgegeven wachtwoord is onjuist[/COLOR][COLOR= #007700];
                }       
            }
        }[/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]$arrFout[/COLOR][COLOR= #007700])) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<strong>Er [/COLOR] [COLOR= #007700]. ([/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$arrFout[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]zijn meerdere fouten[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]is een fout[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000] gevonden:</strong><br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$arrFout[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$val[/COLOR][COLOR= #007700]){[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$val[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je bent ingelogd.[/COLOR][COLOR= #007700];
        }    
    }[/COLOR]
?>
<form name="login" action="" method="POST">
    <table>
        <tr>
            <td>Gebruikersnaam</td><td><input type="text" name="naam" value="" /></td>
        </tr>
        <tr>
            <td>Wachtwoord:</td><td><input type="password" name="pass" /></td>
        </tr>
        <tr>
            <td><input type="submit" name="submit" value="Log in" /></td>
        </tr>
    </table>
</form>
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Al opgelost smile
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Dat haat ik dus echt als mensen binnen 1 minuut nadat ze een topic maken het antwoord hebben. Dan heb je dus duidelijk zelf niet eerst gekeken voor je het topic maakt. Hier kan dus duidelijk een slotje op.
0
Berichten
10.409
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
indd hier kan een slotje op
mensen moeten is meer uit gaan proberen voordat ze een topic maken
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
Dat haat ik dus echt als mensen binnen 1 minuut nadat ze een topic maken het antwoord hebben. Dan heb je dus duidelijk zelf niet eerst gekeken voor je het topic maakt. Hier kan dus duidelijk een slotje op.
Zet er dan ook een slotje op emo
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