[add-on] Account Bevestigen

Gestart doorDaoloth9 reacties64 weergaven

10 berichten · pagina 1 van 1

Daoloth

Lid · Topicstarter

Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi,

Dit bevestig systeem is gemaakt op het systeem van Guildjuhh
http://www.one2xs.com/threads/3122

Stap 1
We beginnen bij reg.php
Zoek

echo <div class="registred">Account aangemaakt. Je moet nog alleen je account bevestigen.</div>;


Op zet daarboven:

$code = substr(md5(microtime()), 0, 7);


Stap 2
Zoek

mysql_query("INSERT INTO login_members (username,pass,email,ip) VALUES (" . mysql_real_escape_string($_POST[username]) . "," . hash(sha256, hash(sha512,$_POST[password])) . "," . mysql_real_escape_string(strtolower($_POST[email])) . "," . $_SERVER[REMOTE_ADDR] . ")") or die(mysql_error());


Vervang het door:

mysql_query("INSERT INTO login_members (username,pass,email,ip,activated) VALUES (" . mysql_real_escape_string($_POST[username]) . "," . hash(sha256, hash(sha512,$_POST[password])) . "," . mysql_real_escape_string(strtolower($_POST[email])) . "," . $_SERVER[REMOTE_ADDR] . ", ".$code.")") or die(mysql_error());


Stap 3
Zet onder

mysql_query("INSERT INTO login_members (username,pass,email,ip,activated) VALUES (" . mysql_real_escape_string($_POST[username]) . "," . hash(sha256, hash(sha512,$_POST[password])) . "," . mysql_real_escape_string(strtolower($_POST[email])) . "," . $_SERVER[REMOTE_ADDR] . ", ".$code.")") or die(mysql_error());


mail(addslashes($_POST[email]), "Je registratie voltooien", 
            "<span style="font-family: Verdana; font-size: 12px;">Beste ".ucfirst($_POST[username]).",<br /><br />".
            "Op ".date(d-m-Y om H:i)." heb je je geregistreerd op de site van ".$sitenaam." ".
            "Om je registratie te voltooien moet je alleen nog op onderstaande link klikken, ".
            "of deze kopieren naar de adresbalk van je browser:<br /><br />".
            "<a href="".$siteurl."bevestig.php?code=".$code."">".
            "".$siteurl."bevestig.php?code=".$code."</a><br /><br />".
            "Groeten,<br />".
            "Webmaster van ".$sitenaam.".</span>", "From: ".$sitemail."
Content-type: text/html");


Stap 4
Ga naar log.php
Zoek:

$query = mysql_query("SELECT id,username,pass FROM login_members WHERE username = ".mysql_real_escape_string($_POST[username])."") or die (mysql_error());


En vervang het door:

$query = mysql_query("SELECT id,username,pass,activated FROM login_members WHERE username = ".mysql_real_escape_string($_POST[username])."") or die (mysql_error());


Stap 5
Zoek:

elseif (empty($_POST[username])) {
                $fout[] = Geen gebruikersnaam ingevuld;
            }


Zet eronder:

if(mysql_num_rows($query)) {
                if(!$res[activated] = 0) {
                    $fout[] = Je account is nog niet geactiveerd;
                }
            }


Stap 6
Maak een pagina bevestig.php en zet erin:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]header.php[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/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]"SELECT 1 FROM login_members WHERE activated = "[/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/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][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]$query[/COLOR][COLOR= #007700]) ===[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
    {[/COLOR]
        
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE login_members SET activated = 0 WHERE activated = "[/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/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je account is bevestigd; je kunt nu inloggen.[/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]De code is onjuist.[/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 verkeerd deze pagina binnen gegaan.[/COLOR][COLOR= #007700];

}[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]footer.php[/COLOR][COLOR= #007700]);[/COLOR]
?>


Stap 7
Ga naar mysql.php
Zoek:

// Database details


Zet erboven

$siteurl = "http://jousiteurl.nl"; // Siteurl met /
    $sitemail = "jou@sitemail.nl"; // Siteurl
    $sitenaam = "jousitenaam"; // Sitenaam


Stap 8
Structuur veranderen:
Maak een pagina: update.php en zet erin:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]header.php[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"ALTER TABLE `login_members` CHANGE `activated` `activated` VARCHAR( 15 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 0"[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Succesvol Geupdate. Nu kun je update.php verwijderen."[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]footer.php[/COLOR][COLOR= #007700]);[/COLOR]
?>


Ga naar update.php, zodat deze pagina het systeem update.

Als het goed is werkt het bevestig systeem nu.
Vragen/Bugs Stel ze hier.

Donaties zijn altijd welkom:
One2xs account: Marijnnn
Paypal: Marijnnn@live.nl
Dutchleader: Super

Of een bezoekje op mijn sites is ook welkom.

Demo: http://www.inlogsystemen.nl

edit door Lennard: 1 bericht van gemaakt
0
Daoloth

Lid · Topicstarter

Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Stap 4
Ga naar log.php
Zoek:

$query = mysql_query("SELECT id,username,pass FROM login_members WHERE username = ".mysql_real_escape_string($_POST[username])."") or die (mysql_error());


En vervang het door:

$query = mysql_query("SELECT id,username,pass,activated FROM login_members WHERE username = ".mysql_real_escape_string($_POST[username])."") or die (mysql_error());


Stap 5
Zoek:

elseif (empty($_POST[username])) {
                $fout[] = Geen gebruikersnaam ingevuld;
            }


Zet eronder:

if(mysql_num_rows($query)) {
                if(!$res[activated] = 0) {
                    $fout[] = Je account is nog niet geactiveerd;
                }
            }


Stap 6
Maak een pagina bevestig.php en zet erin:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]header.php[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/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]"SELECT 1 FROM login_members WHERE activated = "[/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/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][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]$query[/COLOR][COLOR= #007700]) ===[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
    {[/COLOR]
        
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE login_members SET activated = 0 WHERE activated = "[/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/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je account is bevestigd; je kunt nu inloggen.[/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]De code is onjuist.[/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 verkeerd deze pagina binnen gegaan.[/COLOR][COLOR= #007700];

}[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]footer.php[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Daoloth

Lid · Topicstarter

Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Stap 7
Ga naar mysql.php
Zoek:

// Database details


Zet erboven

$siteurl = "http://jousiteurl.nl"; // Siteurl met /
    $sitemail = "jou@sitemail.nl"; // Siteurl
    $sitenaam = "jousitenaam"; // Sitenaam


Stap 8
Structuur veranderen:
Maak een pagina: update.php en zet erin:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]header.php[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"ALTER TABLE `login_members` CHANGE `activated` `activated` VARCHAR( 15 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 0"[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Succesvol Geupdate. Nu kun je update.php verwijderen."[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]footer.php[/COLOR][COLOR= #007700]);[/COLOR]
?>


Ga naar update.php, zodat deze pagina het systeem update.

Als het goed is werkt het bevestig systeem nu.
Vragen/Bugs Stel ze hier.

Donaties zijn altijd welkom:
One2xs account: Marijnnn
Paypal: Marijnnn@live.nl
Dutchleader: Super

Of een bezoekje op mijn sites is ook welkom.

Demo: http://www.inlogsystemen.nl
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
en waarom in 3 posts ?biggrin
0
Daoloth

Lid · Topicstarter

Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rogier schreef:
en waarom in 3 posts ?biggrin
Het is heel verziekt als je
<<<<
op ubb codes klikt, want dan gaat hij helemaal weer omhoog en dan moet je weer omlaag scrollen

Groetjes,
Marijn
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Ziet er goed uit, maar 1 tip: vervang * in bevestig.php op regel 7 door een 1.
Zo dus:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]header.php[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/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]"SELECT 1 FROM login_members WHERE activated = "[/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/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][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]$query[/COLOR][COLOR= #007700]) ===[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
    {[/COLOR]
        
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE login_members SET activated = 0 WHERE activated = "[/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/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je account is bevestigd; je kunt nu inloggen.[/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]De code is onjuist.[/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 verkeerd deze pagina binnen gegaan.[/COLOR][COLOR= #007700];

}[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]footer.php[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik kan deze helaas niet doen omdat ik kerstpakket heb sadley daar pakt hij de mailfuncite naar hotmail niet , en ik heb niet genoeg punten om normale host!
0
Berichten
620
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maar hoe download je dat ledensysteem ?
De link in het andere topic werkt niet !
0
Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hee ik kom er net achter dat het kerstpakket niet meer geldig is en ik nu een andere heb waardoor het wel kan biggrin EEEEUWIG DANK MARIJNNN!
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Habla schreef:
Maar hoe download je dat ledensysteem ?
De link in het andere topic werkt niet !

Die werkt wel =]
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