md5 weghalen

Gestart doorJeffreyt16 reacties70 weergaven

17 berichten · pagina 1 van 2

Jeffreyt

Lid · Topicstarter

Berichten
2.105
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi,
Ik wil dat de wachtwoorden GEEN md5 krijgen.
omdat ik ze dan niet meer kan oproepen (bijv. als ze ww verg. zijn)
Hoe zorg ik in het script hieronder dat md5 weg is?

if(isset($_POST[x])) {
    if(empty($_POST[naam]) || empty($_POST[email]) || empty($_POST[wachtwoord]) || empty($_POST[wachtwoord2])) {
        echo U heeft niet alle velden ingevuld!;
    } elseif($_POST[wachtwoord] != $_POST[wachtwoord2]) {
        echo De wachtwoorden komen niet overeen!;
    } elseif(!eregi(@,$_POST[email])) {
        echo Het e-mailadres is ongeldig.;
    } else {
        $iNaam = mysql_query("SELECT * FROM users WHERE naam = ".$_POST[naam]."") or die(mysql_error());
        if(mysql_num_rows($iNaam) === 0) {
            mysql_query("INSERT INTO users (naam,wachtwoord,email,rang,ban,ip) VALUES (".$_POST[naam].", ".md5($_POST[wachtwoord]).", ".$_POST[email].", 0, 0, ".$_SERVER[REMOTE_ADDR].")") or die(mysql_error());
            echo U bent succesvol geregistreerd!;
        } else {
            echo Gebruikersnaam is al in gebruik.;
        }
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Probeer maar wat. Het antwoord staat gewoon in je bericht.. emo
Alleen ik denk dat het handiger is als je een extra pagina maakt dat ze een email krijgen om een nieuw wachtwoord in te stellen ipv het wachtwoord gewoon kunnen zien?
0
Tgrm

Lid

Berichten
2.133
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jeffreyt schreef:
Hoi,
Ik wil dat de wachtwoorden GEEN md5 krijgen.
omdat ik ze dan niet meer kan oproepen (bijv. als ze ww verg. zijn)
Hoe zorg ik in het script hieronder dat md5 weg is?

if(isset($_POST[x])) {
    if(empty($_POST[naam]) || empty($_POST[email]) || empty($_POST[wachtwoord]) || empty($_POST[wachtwoord2])) {
        echo U heeft niet alle velden ingevuld!;
    } elseif($_POST[wachtwoord] != $_POST[wachtwoord2]) {
        echo De wachtwoorden komen niet overeen!;
    } elseif(!eregi(@,$_POST[email])) {
        echo Het e-mailadres is ongeldig.;
    } else {
        $iNaam = mysql_query("SELECT * FROM users WHERE naam = ".$_POST[naam]."") or die(mysql_error());
        if(mysql_num_rows($iNaam) === 0) {
            mysql_query("INSERT INTO users (naam,wachtwoord,email,rang,ban,ip) VALUES (".$_POST[naam].", ".md5($_POST[wachtwoord]).", ".$_POST[email].", 0, 0, ".$_SERVER[REMOTE_ADDR].")") or die(mysql_error());
            echo U bent succesvol geregistreerd!;
        } else {
            echo Gebruikersnaam is al in gebruik.;
        }
Als ze wws vergeten zijn dan maken ze maar een nieuwe aan... ik denk niet dat mensen het op prijs stellen dat jij hun wws kan lezen -.-
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@tgrm,
dat is zn vraag niet

if(isset($_POST[x])) {
    if(empty($_POST[naam]) || empty($_POST[email]) || empty($_POST[wachtwoord]) || empty($_POST[wachtwoord2])) {
        echo U heeft niet alle velden ingevuld!;
    } elseif($_POST[wachtwoord] != $_POST[wachtwoord2]) {
        echo De wachtwoorden komen niet overeen!;
    } elseif(!eregi(@,$_POST[email])) {
        echo Het e-mailadres is ongeldig.;
    } else {
        $iNaam = mysql_query("SELECT * FROM users WHERE naam = ".$_POST[naam]."") or die(mysql_error());
        if(mysql_num_rows($iNaam) === 0) {
            mysql_query("INSERT INTO users (naam,wachtwoord,email,rang,ban,ip) VALUES (".$_POST[naam].", ". $_POST[wachtwoord] .", ".$_POST[email].", 0, 0, ".$_SERVER[REMOTE_ADDR].")") or die(mysql_error());
            echo U bent succesvol geregistreerd!;
        } else {
            echo Gebruikersnaam is al in gebruik.;
        }


als t goed is klopt t zo
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bartv schreef:
@tgrm,
dat is zn vraag niet

if(isset($_POST[x])) {
    if(empty($_POST[naam]) || empty($_POST[email]) || empty($_POST[wachtwoord]) || empty($_POST[wachtwoord2])) {
        echo U heeft niet alle velden ingevuld!;
    } elseif($_POST[wachtwoord] != $_POST[wachtwoord2]) {
        echo De wachtwoorden komen niet overeen!;
    } elseif(!eregi(@,$_POST[email])) {
        echo Het e-mailadres is ongeldig.;
    } else {
        $iNaam = mysql_query("SELECT * FROM users WHERE naam = ".$_POST[naam]."") or die(mysql_error());
        if(mysql_num_rows($iNaam) === 0) {
            mysql_query("INSERT INTO users (naam,wachtwoord,email,rang,ban,ip) VALUES (".$_POST[naam].", ". $_POST[wachtwoord] .", ".$_POST[email].", 0, 0, ".$_SERVER[REMOTE_ADDR].")") or die(mysql_error());
            echo U bent succesvol geregistreerd!;
        } else {
            echo Gebruikersnaam is al in gebruik.;
        }
als t goed is klopt t zo

klopt volgensmij niet, iets teveel quotes en haakjes. zie alleen niet hoe want jesus wat een rommel is die text
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@timmie,
wat is er dan nog fout?
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Die van Timmie klopt wel hoorsmile
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@josnl,
dat is die van mij yummie
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ik weet niet eens hoe je het kan installeren? (heb het wel nodig/ ben geen php kanjer)
Kan iemand me het uitgleggen via PB? voor een kleine beloning?
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Inderdaad hij klopt wel, dacht dat ik een quote teveel zag maar hij klopt inderdaad (Pfoe dat de persoon die hem heeft gemaakt er zelf nog uit komt)
0
Jeffreyt

Lid · Topicstarter

Berichten
2.105
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Foutmelding: Parse error: syntax error, unexpected T_ELSE in /home/protuner/domains/nfstb.eu/public_html/site/registeren.php on line 22

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]style.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/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]x[/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]email[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord2[/COLOR][COLOR= #007700]])) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft niet alle velden ingevuld![/COLOR][COLOR= #007700];
    }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord2[/COLOR][COLOR= #007700]]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]De wachtwoorden komen niet overeen![/COLOR][COLOR= #007700];
    }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/eregi"]eregi[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]@[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]])) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Het e-mailadres is ongeldig.[/COLOR][COLOR= #007700];
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$iNaam[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE naam = "[/COLOR][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/die"]die[/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]$iNaam[/COLOR][COLOR= #007700]) ===[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO users (naam,wachtwoord,email,rang,ban,ip) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", 0, 0, "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U bent succesvol geregistreerd![/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]Gebruikersnaam is al in gebruik.[/COLOR][COLOR= #007700];
        }  

}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE ip="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/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]$check[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is maar 1 account per IP toegestaan.[/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]<form method="post" action="">[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<table border="0">[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>Gebruikersnaam:</td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="text" name="naam"></td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>E-mail adres:</td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="text" name="email"></td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>Wachtwoord:</td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="password" name="wachtwoord"></td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>Herhaal wachtwoord:</td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="password" name="wachtwoord2"></td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>&nbsp;</td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="submit" value="Registreren" name="x"></td>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];
    }
}[/COLOR]
?>
0
Berichten
515
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als goed is, is het wettelijk verboden wachtwoorden ongecodeert op te slaan,

Md5 is onmogelijk te decoderen dus moet je het coderen naar iets wat je wel kan decoderen.
En je moet je querys beveiligen... Anders kan iemand zo al je data zien..
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
op regel 21 even een } zetten
0
Jeffreyt

Lid · Topicstarter

Berichten
2.105
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Justafool het is een privé site voor vrienden

//Sjoerd, check even: http://site.nfstb.eu/registeren.php doet hij het?
// 2 berichten samengevoegd
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