Inlogsysteem

Gestart doorJoeri16 reacties45 weergaven

17 berichten · pagina 1 van 2

Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hier maak ik een inlogsysteem en post al me problemen die ik ermee heb : Meteen iets gevonden ik moet bovenaan elke pagina dit zetten :
Opmerking: ik ga er van uit dat je gebruik maakt van een index.php waarin je alle content include. In die index.php is dan reeds een database connectie aanwezig, en staat session_start() voor alle output.
Mocht dit niet het geval zijn:

Maak bovenaan iedere pagina een databaseconnectie
Plaats boven iedere pagina session_start() zodat de $_SESSION-variabelen overal bereikbaar zijn

Nu heb ik dit gedaan :

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

    [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]parser.php[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #FF8000]// Database details[/COLOR]
    [COLOR= #0000BB]$name_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"joeriwii_cpiscool"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Name of database[/COLOR]
    [COLOR= #0000BB]$user_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"joeriwii_cpcool"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Username for database[/COLOR]
    [COLOR= #0000BB]$pass_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"******"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Password for database[/COLOR]
    [COLOR= #0000BB]$host_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Host for database[/COLOR]
    [COLOR= #0000BB]$connect_db[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$user_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pass_db[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #FF8000]// Making connection to our database         [/COLOR]
    [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$name_db[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$connect_db[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$achtergrond[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur[/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]submit[/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]$achtergrond[/COLOR][COLOR= #007700]))
    {[/COLOR]
        [URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"achtergrond"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$achtergrond[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Achtergrond verandert naar: "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$achtergrond[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$meta[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<meta http-equiv="refresh" content="3;url=achtergrond2.php" />"[/COLOR][COLOR= #007700];
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Geen geldigen achtergrond."[/COLOR][COLOR= #007700];
    }    
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<form method=POST action=achtergrond2.php>
    <p>
    <input type=radio value=#333333 checked name=kleur>Grijs<br>
    <input type=radio name=kleur value=#666666>Grijzer<br>
    <input type=radio name=kleur value=#999999>Grijst :P<br>
    <input type=submit value=Submit name=submit>
</form>
"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="opmaak.css" />
<title>CPiscool | Voor alles over cp</title>

  <script type="text/javascript">
  function insertBBCode(elementID, bbCode)
{
    if (typeof elementID === undefined || typeof bbCode === undefined) return;
    if (document.getElementById(elementID)) {
        var elementObject = document.getElementById(elementID);
        if (document.selection) { // IE
            elementObject.focus();
            var sel = document.selection.createRange();
            sel.text = bbCode;
        } else if (elementObject.selectionStart || elementObject.selectionStart == 0) {
            var startPos = elementObject.selectionStart;
            var endPos = elementObject.selectionEnd;
            elementObject.value = elementObject.value.substring(0, startPos) + bbCode + elementObject.value.substring(endPos, elementObject.value.length);
        } else {
            elementObject.value += bbCode;
        }
        elementObject.focus();
    }
}
</script>

</head>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$meta[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<body bgcolor="[/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]$HTTP_COOKIE_VARS[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"achtergrond"[/COLOR][COLOR= #007700]])) {[/COLOR][URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"#363636"[/COLOR][COLOR= #007700]; }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$HTTP_COOKIE_VARS[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]achtergrond[/COLOR][COLOR= #007700]];}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]">"[/COLOR][COLOR= #007700];[/COLOR]
?>

<div id="header"></div>

<div id="menu"> <h1> <a title="home" href="index.php" target="_self" class="menu">Home</a> |
<a title="Nieuws" href="nieuws.php" target="_self" class="menu">Nieuws</a> |
<a title="CP-paginas" href="paginas.php" target="_self" class="menu">CP-paginas</a> |
<a title="Adverteren" href="Adverteren.php" target="_self" class="menu">Adverteren</a>|
<a title="Inloggen" href="inloggen.php" target="_self" class="menu">Inloggen</a> |
<a title="Berichtenbalk" href="plaats.php" target="_self" class="menu">Berichtenbalk</a> |

<a title="Contact" href="contact.php" target="_self" class="menu">Contact</a> |
<a title="Settings" href="achtergrond2.php" target="_self" class="menu">Instellingen</a> |

 </h1> </div>
<div id="content">
<div id="leftcontent">
    <div id="leftcontentheader"></div>
    <div id="leftcontentachtergrond"><h2>Welkom</h2>
<h3>
Welkom op CPiscool we hebben onderhoud
<br>

            </h3></div>

<div id="leftcontentfooter"></div></div>
<div id="rightcontent"><h2>Log In </h2> <h3> Binnenkort kan je hier inloggen  </h3></div></div>

<div id="berichtenbg">
<div id="berichten"><h6><marquee>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]weergeef.php[/COLOR][COLOR= #007700]);[/COLOR] ?></marquee></h6></div></div>

<div id="footer"><h6> Clubpenguinissupercool - alle rechten voorbehouden, niet kopieren, voor vragen mailen naar CPISC@Live.be</h6></div>

</body>
</html>


Dan geeft hij dit aan :

Fatal error: Cannot redeclare parse_ubb_emo() (previously declared in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/parser.php:3) in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/parser.php on line 40

Op deze pagina :
http://joeriwii.one2xs.nl/testing.php

Maar op joeriwii.one2xs.nl waar ik niks heb veranderd
Werkt het wel gewoon goed wat moet ik nu doen en is de code voor de rest goed?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Joeriwii:
Heeft iemand een simpele liggen ik heb er veel gratis gevonden maar die zijn nog te ingewikkeld yummieGewoon aanmelden , uitloggen en registreren
webhelpje.be

naahjo yummie scriptdb moet je efe zoeken
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
op Webhelpje kan je inlogsysteem niet aanpassen en dat ziet er niet uit
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Joeriwii:
Webhelpje kan je niet aanpassen
...
0
Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
webmensen.nl
is misschien uitgebreid, maar goed om van te leren!
0
Krm

Lid

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik kan er wel 1 maken met inloggen registreren aanmelden en profiel wijzigen voor een goed bod
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Contact me. Heb misschien interesse.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Als ze er maar niet teveel voor vragen, anders moet je mij ff contacteren. Zoals ik zei begin in in het weekend toch aan een inlogsysteempje smile
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heeft iemand er ergens een tut voor liggen?
Het is denk ik handig als het zelf probeer en zo me kennis uitbreid clown
Iemand goede?
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hier maak ik een inlogsysteem en post al me problemen die ik ermee heb : Meteen iets gevonden ik moet bovenaan elke pagina dit zetten :
Opmerking: ik ga er van uit dat je gebruik maakt van een index.php waarin je alle content include. In die index.php is dan reeds een database connectie aanwezig, en staat session_start() voor alle output.
Mocht dit niet het geval zijn:

Maak bovenaan iedere pagina een databaseconnectie
Plaats boven iedere pagina session_start() zodat de $_SESSION-variabelen overal bereikbaar zijn

Nu heb ik dit gedaan :

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

    [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]parser.php[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #FF8000]// Database details[/COLOR]
    [COLOR= #0000BB]$name_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"joeriwii_cpiscool"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Name of database[/COLOR]
    [COLOR= #0000BB]$user_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"joeriwii_cpcool"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Username for database[/COLOR]
    [COLOR= #0000BB]$pass_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"******"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Password for database[/COLOR]
    [COLOR= #0000BB]$host_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Host for database[/COLOR]
    [COLOR= #0000BB]$connect_db[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$user_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pass_db[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #FF8000]// Making connection to our database         [/COLOR]
    [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$name_db[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$connect_db[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$achtergrond[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur[/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]submit[/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]$achtergrond[/COLOR][COLOR= #007700]))
    {[/COLOR]
        [URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"achtergrond"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$achtergrond[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Achtergrond verandert naar: "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$achtergrond[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$meta[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<meta http-equiv="refresh" content="3;url=achtergrond2.php" />"[/COLOR][COLOR= #007700];
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Geen geldigen achtergrond."[/COLOR][COLOR= #007700];
    }    
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<form method=POST action=achtergrond2.php>
    <p>
    <input type=radio value=#333333 checked name=kleur>Grijs<br>
    <input type=radio name=kleur value=#666666>Grijzer<br>
    <input type=radio name=kleur value=#999999>Grijst :P<br>
    <input type=submit value=Submit name=submit>
</form>
"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="opmaak.css" />
<title>CPiscool | Voor alles over cp</title>

  <script type="text/javascript">
  function insertBBCode(elementID, bbCode)
{
    if (typeof elementID === undefined || typeof bbCode === undefined) return;
    if (document.getElementById(elementID)) {
        var elementObject = document.getElementById(elementID);
        if (document.selection) { // IE
            elementObject.focus();
            var sel = document.selection.createRange();
            sel.text = bbCode;
        } else if (elementObject.selectionStart || elementObject.selectionStart == 0) {
            var startPos = elementObject.selectionStart;
            var endPos = elementObject.selectionEnd;
            elementObject.value = elementObject.value.substring(0, startPos) + bbCode + elementObject.value.substring(endPos, elementObject.value.length);
        } else {
            elementObject.value += bbCode;
        }
        elementObject.focus();
    }
}
</script>

</head>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$meta[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<body bgcolor="[/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]$HTTP_COOKIE_VARS[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"achtergrond"[/COLOR][COLOR= #007700]])) {[/COLOR][URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"#363636"[/COLOR][COLOR= #007700]; }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$HTTP_COOKIE_VARS[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]achtergrond[/COLOR][COLOR= #007700]];}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]">"[/COLOR][COLOR= #007700];[/COLOR]
?>

<div id="header"></div>

<div id="menu"> <h1> <a title="home" href="index.php" target="_self" class="menu">Home</a> |
<a title="Nieuws" href="nieuws.php" target="_self" class="menu">Nieuws</a> |
<a title="CP-paginas" href="paginas.php" target="_self" class="menu">CP-paginas</a> |
<a title="Adverteren" href="Adverteren.php" target="_self" class="menu">Adverteren</a>|
<a title="Inloggen" href="inloggen.php" target="_self" class="menu">Inloggen</a> |
<a title="Berichtenbalk" href="plaats.php" target="_self" class="menu">Berichtenbalk</a> |

<a title="Contact" href="contact.php" target="_self" class="menu">Contact</a> |
<a title="Settings" href="achtergrond2.php" target="_self" class="menu">Instellingen</a> |

 </h1> </div>
<div id="content">
<div id="leftcontent">
    <div id="leftcontentheader"></div>
    <div id="leftcontentachtergrond"><h2>Welkom</h2>
<h3>
Welkom op CPiscool we hebben onderhoud
<br>

            </h3></div>

<div id="leftcontentfooter"></div></div>
<div id="rightcontent"><h2>Log In </h2> <h3> Binnenkort kan je hier inloggen  </h3></div></div>

<div id="berichtenbg">
<div id="berichten"><h6><marquee>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]weergeef.php[/COLOR][COLOR= #007700]);[/COLOR] ?></marquee></h6></div></div>

<div id="footer"><h6> Clubpenguinissupercool - alle rechten voorbehouden, niet kopieren, voor vragen mailen naar CPISC@Live.be</h6></div>

</body>
</html>


Dan geeft hij dit aan :

Fatal error: Cannot redeclare parse_ubb_emo() (previously declared in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/parser.php:3) in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/parser.php on line 40

Op deze pagina :
http://joeriwii.one2xs.nl/testing.php

Maar op joeriwii.one2xs.nl waar ik niks heb veranderd
Werkt het wel gewoon goed wat moet ik nu doen en is de code voor de rest goed?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Haal de bovenste include van de parser weg, in weergeef.php staat ook een include en probeerd hij 2x de functie parse_ubb_emo op te starten, wat niet mogelijk is smile
of haal hem in weergeef weg, is nog handiger want dan kan je in je echos ook de parser gebruiken smile
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[of[ hoe kom je aan SUB.one2xs.nl?[/of]
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bij parser zie ik geen include hoor?

[COLOR= #0000BB]<?php[/COLOR]
    [COLOR= #FF8000]// Replace functies[/COLOR]
 [COLOR= #007700]function[/COLOR] parse_ubb_emo  [COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR][COLOR= #007700]) {[/COLOR]
    [COLOR= #0000BB]$array1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
                    [COLOR= #FF8000]/* Emoticons */[/COLOR] 
                   
                    [COLOR= #DD0000][nl][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][fr][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][us][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][de][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][rarrow][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][larrow][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][update][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][*bullet][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][cake][/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000][bomb][/COLOR][COLOR= #007700],[/COLOR]
                     [COLOR= #DD0000]xD[/COLOR][COLOR= #007700],);[/COLOR]
                    
                    
                    
    [COLOR= #0000BB]$array2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
                    [COLOR= #FF8000]/* Emoticons */[/COLOR]       
                                 
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/nl.gif" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/fr.gif" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/us.gif" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/de.gif" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/arrow_right.gif" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/arrow_left.gif" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/new.png" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/bullet_star.png" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/cake.png" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/bomb.png" alt="Emoticon" />[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]<img src="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$emoticonsDirectory[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/xd.gif" alt="Emoticon" />[/COLOR][COLOR= #007700],);[/COLOR]
                    
                    
                    
    [COLOR= #0000BB]$output[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$array1[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$array2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$output[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Maar ik had wel in weergeef weggehaald en hoe het nu staat werkt het prima dus ik ben het aan het aan het bewerken overal biggrin
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Online gezet maar nu verzend hij hier : joeriwii.one2xs.nl/registratie.php geen mailtje naar je e-mail .. waar moet ik de e-mail waar hij van verzend veranderen in deze code?

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

    [COLOR= #FF8000]// Database details[/COLOR]
    [COLOR= #0000BB]$name_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"joeriwii_cpiscool"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Name of database[/COLOR]
    [COLOR= #0000BB]$user_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"joeriwii_cpcool"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Username for database[/COLOR]
    [COLOR= #0000BB]$pass_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"*****"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Password for database[/COLOR]
    [COLOR= #0000BB]$host_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Host for database[/COLOR]
    [COLOR= #0000BB]$connect_db[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$user_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pass_db[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #FF8000]// Making connection to our database         [/COLOR]
    [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$name_db[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$connect_db[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$achtergrond[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur[/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]submit[/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]$achtergrond[/COLOR][COLOR= #007700]))
    {[/COLOR]
        [URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"achtergrond"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$achtergrond[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Achtergrond verandert naar: "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$achtergrond[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$meta[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<meta http-equiv="refresh" content="3;url=achtergrond2.php" />"[/COLOR][COLOR= #007700];
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Geen geldigen achtergrond."[/COLOR][COLOR= #007700];
    }    
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<form method=POST action=achtergrond2.php>
    <p>
    <input type=radio value=#333333 checked name=kleur>Grijs<br>
    <input type=radio name=kleur value=#666666>Grijzer<br>
    <input type=radio name=kleur value=#999999>Grijst :P<br>
    <input type=submit value=Submit name=submit>
</form>
"[/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] 
    [COLOR= #FF8000]// Hier komt alle behandeling van het formulier 
     
    // Mocht er een fout optreden, is het leuk dat de gebruiker niet alles opnieuw hoeft 
    // in te vullen. Daarom vullen we de array $post met de velden, 
    // uiteraard door htmlentities() gehaald (veiligheidsmaatregel). 
    // Wachtwoord moeten wel opnieuw ingevuld worden, nogmaals veiligheidsmaatsregel [/COLOR]
    [COLOR= #0000BB]$post[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR] 
                [COLOR= #DD0000]gebruikersnaam[/COLOR]    [COLOR= #007700]=>[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]),[/COLOR] 
                [COLOR= #DD0000]email[/COLOR]                [COLOR= #007700]=>[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]));[/COLOR] 
     
    [COLOR= #FF8000]// Verwerking 
     
    // Eerst enkele functies schrijven die de controle vergemakkelijken [/COLOR]
    [COLOR= #007700]function[/COLOR] geregistreerd[COLOR= #007700]([/COLOR][COLOR= #0000BB]$zoek[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$veld[/COLOR][COLOR= #007700]) {[/COLOR] 
        [COLOR= #FF8000]// Ik plaats de query op meerdere lijnen voor de leesbaarheid [/COLOR]
        [COLOR= #0000BB]$qZoek[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]" 
            SELECT COUNT("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$veld[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]") 
                      FROM gebruikers 
                   WHERE "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$veld[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$zoek[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR] 
                    
        [COLOR= #FF8000]// Als de gebruikersnaam nog niet bestaat, geeft dit false, anders true [/COLOR]
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qZoek[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR] [COLOR= #007700]?[/COLOR] false [COLOR= #007700]:[/COLOR] true[COLOR= #007700]); 
    }[/COLOR] 
     
    [COLOR= #FF8000]// De reguliere expressies voor de controle op e-mailadressen is door FangorN samengesteld :] [/COLOR]
    [COLOR= #007700]function[/COLOR] is_email[COLOR= #007700]([/COLOR][COLOR= #0000BB]$in[/COLOR][COLOR= #007700]) {[/COLOR] 
        [URL="http://www.php.net/list"]list[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$local[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$host[/COLOR][COLOR= #007700]) =[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]@[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$in[/COLOR][COLOR= #007700]);[/COLOR] 
        [COLOR= #0000BB]$pattern_local[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?).[/COLOR] 
                       [COLOR= #007700].[/COLOR] [COLOR= #DD0000]([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$[/COLOR][COLOR= #007700];[/COLOR]  
        [COLOR= #0000BB]$pattern_host[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?).([-]?)[/COLOR] 
                      [COLOR= #007700].[/COLOR] [COLOR= #DD0000][0-9a-z]*([-]?[0-9a-z]+)+)*.[a-z]{2,4}$[/COLOR][COLOR= #007700];[/COLOR]  
        [COLOR= #0000BB]$match_local[/COLOR]   [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/eregi"]eregi[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pattern_local[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$local[/COLOR][COLOR= #007700]);[/COLOR] 
        [COLOR= #0000BB]$match_host[/COLOR]    [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/eregi"]eregi[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pattern_host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$host[/COLOR][COLOR= #007700]);[/COLOR] 
         
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$match_local[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$match_host[/COLOR] [COLOR= #007700]?[/COLOR] true [COLOR= #007700]:[/COLOR] false[COLOR= #007700]); 
    }[/COLOR] 
     
    [COLOR= #FF8000]// Hier zullen we de fouten in opslaan [/COLOR]
    [COLOR= #0000BB]$fouten[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][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]gebruikersnaam[/COLOR][COLOR= #007700]])) {[/COLOR] 
        [COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700][]    =[/COLOR] [COLOR= #DD0000]Er is geen gebruikersnaam opgegeven.[/COLOR][COLOR= #007700]; 
    }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]) >[/COLOR] [COLOR= #0000BB]50[/COLOR][COLOR= #007700]) {[/COLOR] 
        [COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]De gebruikersnaam mag niet langer dan 50 tekens zijn.[/COLOR][COLOR= #007700]; 
    }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR]geregistreerd[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700])) {[/COLOR] 
        [COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]De gebruikersnaam is reeds geregistreerd.[/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]wachtwoord[/COLOR][COLOR= #007700]])) {[/COLOR] 
        [COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700][]    =[/COLOR] [COLOR= #DD0000]Er is geen wachtwoord opgegeven.[/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]wachtwoord_herh[/COLOR][COLOR= #007700]]) {[/COLOR] 
        [COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]De wachtwoorden komen niet overeen.[/COLOR][COLOR= #007700]; 
    }[/COLOR] 
     
     
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR]is_email[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]])) {[/COLOR] 
        [COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Er is geen geldig e-mailadres opgegeven.[/COLOR][COLOR= #007700]; 
    }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR]geregistreerd[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000]email[/COLOR][COLOR= #007700])) {[/COLOR] 
        [COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Dit e-mailadres is reeds geregistreerd.[/COLOR][COLOR= #007700]; 
    }[/COLOR] 
     
    [COLOR= #FF8000]// Het formulier is gecontroleerd, nu kijken we of er fouten opgetreden zijn [/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR] 
        ?> 
        <span style="color: #FF0000; ">De volgende fouten zijn opgetreden:</span> 
        <ul> 
            [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fouten[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$fout[/COLOR][COLOR= #007700]) {[/COLOR] ?> 
                <li><?=$fout?></li> 
            [COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]}[/COLOR] ?> 
        </ul> 
        [COLOR= #0000BB]<?php[/COLOR] 
    [COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] 
        [COLOR= #FF8000]// Er zijn geen fouten, voer registratie uit! [/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO gebruikers 
                                 (gebruikersnaam, wachtwoord, email, datum) 
                                 VALUES 
                                 ("[/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]gebruikersnaam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", 
                                  "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/sha1"]sha1[/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/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", 
                                  NOW() 
                                 )"[/COLOR][COLOR= #007700]);[/COLOR] 
                                  
        [COLOR= #0000BB]$gebruikers_id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_insert_id"]mysql_insert_id[/URL][COLOR= #007700]();[/COLOR] 
         
        [COLOR= #FF8000]// Een volledig willekeurige code van 40 tekens [/COLOR]
        [COLOR= #0000BB]$activatiecode[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]()*[/COLOR][URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]10[/COLOR][COLOR= #007700])));[/COLOR] 
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO gebruikers_activaties 
                                 (gebruikers_id, sleutel) 
                                 VALUES 
                                 ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gebruikers_id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$activatiecode[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR] 
                                  
        [COLOR= #FF8000]// Voor de regeleinden [/COLOR]
        [URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]EOL[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"n"[/COLOR][COLOR= #007700]);[/COLOR] 
        [COLOR= #FF8000]// Je kan deze mail uit uitbreiden, evt HTML mail,... [/COLOR]
        [COLOR= #0000BB]$mail[/COLOR]   [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Bedankt voor je registratie, blaat, blaat, activeer hier:[/COLOR][COLOR= #007700].[/COLOR]EOL[COLOR= #007700];[/COLOR] 
        [COLOR= #0000BB]$mail[/COLOR]  [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]http://www.mijnsite.be/activatie.php?gebruiker=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gebruikers_id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]&sleutel=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$activatiecode[/COLOR][COLOR= #007700].[/COLOR]EOL[COLOR= #007700];[/COLOR] 
        [COLOR= #0000BB]$mail[/COLOR]  [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Bye bye.[/COLOR][COLOR= #007700];[/COLOR] 
         
        [COLOR= #0000BB]$header[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Mijnsite Account" <noreply@mijnsite.be>[/COLOR][COLOR= #007700];[/COLOR] 
         
        [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000]Je account activeren[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$mail[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$header[/COLOR][COLOR= #007700]);[/COLOR] 
        ?> 
        Er is een e-mail gestuurd met activatiedetails.
        [COLOR= #0000BB]<?php[/COLOR] 
        [COLOR= #FF8000]// Formulier verbergen [/COLOR]
        [COLOR= #0000BB]$verberg_form[/COLOR] [COLOR= #007700]=[/COLOR] true[COLOR= #007700]; 
    } 
     
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] 
    [COLOR= #FF8000]// Dit stuk wordt uitgevoerd als het formulier nog niet is verzonden. 
     
    // Het formulier is nog niet verzonden, dus is er ook geen $post array. 
    // we maken deze dus zelf aan met initiele waardes, om warnings te voorkomen. [/COLOR]
    [COLOR= #0000BB]$post[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]     
                [COLOR= #DD0000]gebruikersnaam[/COLOR]     [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] 
                [COLOR= #DD0000]email[/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/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$verberg_form[/COLOR][COLOR= #007700])) {[/COLOR] 
    ?> 
    <form action="<?=htmlentities($_SERVER[REQUEST_URI])?>" method="post"> 
        Gewenste gebruikersnaam:<br /> 
        <input type="text" name="gebruikersnaam" value="<?=$post[gebruikersnaam]?>" /><br /> 
        Wachtwoord:<br /> 
        <input type="password" name="wachtwoord" /><br /> 
        Wachtwoord herhalen:<br /> 
        <input type="password" name="wachtwoord_herh" /><br /> 
        E-mailadres:<br /> 
        <input type="text" name="email"  value="<?=$post[email]?>" /><br /> 
        <br /> 
        <input type="submit" value="Registreer" /> 
    </form> 
    [COLOR= #0000BB]<?php[/COLOR] 
[COLOR= #007700]}[/COLOR] 
?>
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