md5 maken

Gestart doorKrm8 reacties48 weergaven

9 berichten · pagina 1 van 1

Krm

Lid · Topicstarter

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hoe kan je als je acount aanmaakt dat hij wachtwoord als md5 verstuurd

[COLOR= #0000BB]<?php[/COLOR]

[COLOR= #FF8000]/**
 * @author 
 * @copyright 2009
 */[/COLOR]

[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]intellingen.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/echo"]echo[/URL][COLOR= #DD0000]"<br><br>"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$naam[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ref[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Geen gebruikersnaam 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= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Geen wachtwoord 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]email[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Geen emailadres ingevuld!"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"select * from leden where naam=$_POST[naam]"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_Array"]mysql_fetch_Array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Gebruikersnaam is in gebruik, kies een andere!"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$userreg[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO leden (id, naam, email, saldo, banner, kliks, popup, wachtwoord, actief, code, ip) VALUES (NULL, $_POST[naam], $_POST[email], 30, $_POST[wachtwoord], , 0, $code, "[/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/print"]print[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #0000BB]$van[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"$email"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$to[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$ow[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Account activeren"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$inh[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Hallo.
Je hebt je aangemeld op $sitenaam.

Klik op onderstaande link om je account te activeren:
$website"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"activeer.php?code=$code&user=$userreg"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$success[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$to[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$ow[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$inh[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"From: <$email>"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `leden` SET saldo=saldo+$refextra WHERE `naam` = $naam"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"U ben succesvol aangemeld!<br>Controleer u email voor de activatielink."[/COLOR][COLOR= #007700];
}}}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
    </p>
    <form name="form1" method="post" action="">
  <font size="2" face="Verdana, Arial, Helvetica, sans-serif"> Gebruikersnaam:<br>
  <input name="naam" type="text" id="naam">
  <br>
  Wachtwoord:<br>
  <input name="wachtwoord" type="password" id="wachtwoord">
  <br>
  Emailadres:<br>
  <input name="email" type="text" id="email">
  <br>
  <input type="submit" name="Submit" value="Aanmelden &gt;&gt;">
  </font> 
</form>
[COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
0
Remi

Lid

Berichten
1.270
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wachtwoord[/COLOR][COLOR= #007700]);[/COLOR]
?>


Maar dat staat toch al in je code?
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kan ook met de MD5database API (als die eindelijk af is)

edit: doe bij regel 26 inplaats van $_POST[wachtwoord] dit: $code
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Al zou ik geen md5 maar sha1() gebruiken.
0
Remi

Lid

Berichten
1.270
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Al zou ik geen sha1 maar sha512 gebruiken.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Kan ook, ik gebruik 512 & 256
0
Remi

Lid

Berichten
1.270
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb sha512 over een md5 hash omdat me wws eerst sha512 waren en anders iedereen nieuw account moest yummie
0
Berichten
2.837
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
wat is nouw dan sha512?? Iemand site ofzo er van..
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