Mail (Krijg 0,3 wie snel fixed anders 0,15)

Gestart doorJoeri16 reacties61 weergaven

17 berichten · pagina 1 van 2

Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
WIE FIXED KRIJGT 0,15
VOOR 7 UUR FIXEN KRIJG JE 0,3 PUNTEN!


Het werkt nu goed maar alleen nog niet op hotmail accounts merk ik? hoe kan dat? yummie
Weet iemand hoe ik ervoor kan zorgen dat hij deze fout niet meer aangeeft :
Parse error: syntax error, unexpected T_ELSE in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/registratie.php on line 162

in deze code?

[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>
// 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 
    $post = array( 
                gebruikersnaam    => htmlentities($_POST[gebruikersnaam]), 
                email                => htmlentities($_POST[email])); 
     
    // Verwerking 
     
    // Eerst enkele functies schrijven die de controle vergemakkelijken 
    function geregistreerd($zoek, $veld) { 
        // Ik plaats de query op meerdere lijnen voor de leesbaarheid 
        $qZoek = mysql_query(" 
            SELECT COUNT(".$veld.") 
                      FROM gebruikers 
                   WHERE ".$veld." = ".mysql_real_escape_string($zoek).""); 
                    
        // Als de gebruikersnaam nog niet bestaat, geeft dit false, anders true 
        return (mysql_result($qZoek,0) == 0 ? false : true); 
    } 
     
    // De reguliere expressies voor de controle op e-mailadressen is door FangorN samengesteld :] 
    function is_email($in) { 
        list($local, $host) = explode(@, $in); 
        $pattern_local = ^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?). 
                       . ([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$;  
        $pattern_host = ^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?).([-]?) 
                      . [0-9a-z]*([-]?[0-9a-z]+)+)*.[a-z]{2,4}$;  
        $match_local   = eregi($pattern_local, $local); 
        $match_host    = eregi($pattern_host, $host); 
         
        return ($match_local && $match_host ? true : false); 
    } 
     
    // Hier zullen we de fouten in opslaan 
    $fouten = array(); 
     
    if(empty($_POST[gebruikersnaam])) { 
        $fouten[]    = Er is geen gebruikersnaam opgegeven.; 
    } elseif(strlen($_POST[gebruikersnaam]) > 50) { 
        $fouten[] = De gebruikersnaam mag niet langer dan 50 tekens zijn.; 
    } elseif(geregistreerd($_POST[gebruikersnaam], gebruikersnaam)) { 
        $fouten[] = De gebruikersnaam is reeds geregistreerd.; 
    } 
     
     
    if(empty($_POST[wachtwoord])) { 
        $fouten[]    = Er is geen wachtwoord opgegeven.; 
    } elseif($_POST[wachtwoord] != $_POST[wachtwoord_herh]) { 
        $fouten[] = De wachtwoorden komen niet overeen.; 
    } 
     
     
    if(!is_email($_POST[email])) { 
        $fouten[] = Er is geen geldig e-mailadres opgegeven.; 
    } elseif(geregistreerd($_POST[email], email)) { 
        $fouten[] = Dit e-mailadres is reeds geregistreerd.; 
    } 
     
    // Het formulier is gecontroleerd, nu kijken we of er fouten opgetreden zijn 
    if(count($fouten) > 0) { 
        ?> 
        <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]"
"[/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.joeriwii.one2xs.nl/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]"CPiscool" <meldaan@joeriwii.one2xs.nl>[/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] false[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] 
?> 
<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>


WIE FIXED KRIJGT 0,15
VOOR 7 UUR FIXEN KRIJG JE 0,3 PUNTEN!
0
Krm

Lid

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
volgens mij ligt het aan je email maar ik zegt nix
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat zou ik dan bij e0mail moeten doen of hoe aanmaken?(kerstpaket)
0
Krm

Lid

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
probeer is email contact@php-kerem.nl
en kijk wat hij nu doet
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gedaan en geprobeerd maar niks ontvangen. probeer maar at joeriwii.one2xs.nl/registratie.php
0
Krm

Lid

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
en erors heb je wel veel

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user joeriwii@localhost (using password: NO) in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/activatie.php on line 10

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/activatie.php on line 10

Warning: mysql_query() [function.mysql-query]: Access denied for user joeriwii@localhost (using password: NO) in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/activatie.php on line 10

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/activatie.php on line 10

Warning: mysql_affected_rows() [function.mysql-affected-rows]: A link to the server could not be established in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/activatie.php on line 14
De account bestaat niet of was reeds geactiveerd.
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Errors gefixed ik was dit stukkie vergeten :

// Database details
    $name_db = "joeriwii_cpiscool"; // Name of database
    $user_db = "joeriwii_cpcool"; // Username for database
    $pass_db = "*****"; // Password for database
    $host_db = "localhost"; // Host for database
    $connect_db = mysql_connect($host_db, $user_db, $pass_db);

    // Making connection to our database         
    mysql_select_db($name_db,$connect_db);


Maar van welk e-mail adres heb je dat gekregen want ik heb er net nog een beetje aan zitten klooien en bij mij werkte het bij beide niet
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het werkt nu goed maar alleen nog niet op hotmail accounts merk ik? hoe kan dat? yummie
Weet iemand hoe ik ervoor kan zorgen dat hij deze fout niet meer aangeeft :
Parse error: syntax error, unexpected T_ELSE in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/registratie.php on line 162

in deze code?

[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>
// 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 
    $post = array( 
                gebruikersnaam    => htmlentities($_POST[gebruikersnaam]), 
                email                => htmlentities($_POST[email])); 
     
    // Verwerking 
     
    // Eerst enkele functies schrijven die de controle vergemakkelijken 
    function geregistreerd($zoek, $veld) { 
        // Ik plaats de query op meerdere lijnen voor de leesbaarheid 
        $qZoek = mysql_query(" 
            SELECT COUNT(".$veld.") 
                      FROM gebruikers 
                   WHERE ".$veld." = ".mysql_real_escape_string($zoek).""); 
                    
        // Als de gebruikersnaam nog niet bestaat, geeft dit false, anders true 
        return (mysql_result($qZoek,0) == 0 ? false : true); 
    } 
     
    // De reguliere expressies voor de controle op e-mailadressen is door FangorN samengesteld :] 
    function is_email($in) { 
        list($local, $host) = explode(@, $in); 
        $pattern_local = ^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?). 
                       . ([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$;  
        $pattern_host = ^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?).([-]?) 
                      . [0-9a-z]*([-]?[0-9a-z]+)+)*.[a-z]{2,4}$;  
        $match_local   = eregi($pattern_local, $local); 
        $match_host    = eregi($pattern_host, $host); 
         
        return ($match_local && $match_host ? true : false); 
    } 
     
    // Hier zullen we de fouten in opslaan 
    $fouten = array(); 
     
    if(empty($_POST[gebruikersnaam])) { 
        $fouten[]    = Er is geen gebruikersnaam opgegeven.; 
    } elseif(strlen($_POST[gebruikersnaam]) > 50) { 
        $fouten[] = De gebruikersnaam mag niet langer dan 50 tekens zijn.; 
    } elseif(geregistreerd($_POST[gebruikersnaam], gebruikersnaam)) { 
        $fouten[] = De gebruikersnaam is reeds geregistreerd.; 
    } 
     
     
    if(empty($_POST[wachtwoord])) { 
        $fouten[]    = Er is geen wachtwoord opgegeven.; 
    } elseif($_POST[wachtwoord] != $_POST[wachtwoord_herh]) { 
        $fouten[] = De wachtwoorden komen niet overeen.; 
    } 
     
     
    if(!is_email($_POST[email])) { 
        $fouten[] = Er is geen geldig e-mailadres opgegeven.; 
    } elseif(geregistreerd($_POST[email], email)) { 
        $fouten[] = Dit e-mailadres is reeds geregistreerd.; 
    } 
     
    // Het formulier is gecontroleerd, nu kijken we of er fouten opgetreden zijn 
    if(count($fouten) > 0) { 
        ?> 
        <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.joeriwii.one2xs.nl/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]"CPiscool" <meldaan@joeriwii.one2xs.nl>[/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] false[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] 
?> 
<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>
0
Berichten
536
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je moet in regel 70 nog even wink
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dus dan word het zo :

[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]
?> [COLOR= #0000BB]<?php[/COLOR] 

[COLOR= #007700]<[/COLOR]div id[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"header"[/COLOR][COLOR= #007700]><[/COLOR]/div[COLOR= #007700]>

<[/COLOR]div id[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"menu"[/COLOR][COLOR= #007700]> <[/COLOR]h1[COLOR= #007700]> <[/COLOR]a title[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"home"[/COLOR] href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"index.php"[/COLOR] target[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"_self"[/COLOR] [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"menu"[/COLOR][COLOR= #007700]>[/COLOR]Home[COLOR= #007700]<[/COLOR]/a[COLOR= #007700]> |
<[/COLOR]a title[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"Nieuws"[/COLOR] href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"nieuws.php"[/COLOR] target[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"_self"[/COLOR] [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"menu"[/COLOR][COLOR= #007700]>[/COLOR]Nieuws[COLOR= #007700]<[/COLOR]/a[COLOR= #007700]> |
<[/COLOR]a title[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"CP-paginas"[/COLOR] href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"paginas.php"[/COLOR] target[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"_self"[/COLOR] [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"menu"[/COLOR][COLOR= #007700]>[/COLOR]CP[COLOR= #007700]-[/COLOR]pagina[COLOR= #DD0000]s</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>
// 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 
    $post = array( 
                [/COLOR]gebruikersnaam[COLOR= #DD0000]    => htmlentities($_POST[[/COLOR]gebruikersnaam[COLOR= #DD0000]]), 
                [/COLOR]email[COLOR= #DD0000]                => htmlentities($_POST[[/COLOR]email[COLOR= #DD0000]])); 
     
    // Verwerking 
     
    // Eerst enkele functies schrijven die de controle vergemakkelijken 
    function geregistreerd($zoek, $veld) { 
        // Ik plaats de query op meerdere lijnen voor de leesbaarheid 
        $qZoek = mysql_query(" 
            SELECT COUNT(".$veld.") 
                      FROM gebruikers 
                   WHERE ".$veld." = ".mysql_real_escape_string($zoek).""); 
                    
        // Als de gebruikersnaam nog niet bestaat, geeft dit false, anders true 
        return (mysql_result($qZoek,0) == 0 ? false : true); 
    } 
     
    // De reguliere expressies voor de controle op e-mailadressen is door FangorN samengesteld :] 
    function is_email($in) { 
        list($local, $host) = explode([/COLOR][COLOR= #007700]@[/COLOR][COLOR= #DD0000], $in); 
        $pattern_local = [/COLOR][COLOR= #007700]^([[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]9[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]*([-|[/COLOR]_[COLOR= #007700]]?[[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]9[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]+)*)(([-|[/COLOR]_[COLOR= #007700]]?)[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] 
                       . [/COLOR][COLOR= #007700]([-|[/COLOR]_[COLOR= #007700]]?)[[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]9[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]*([-|[/COLOR]_[COLOR= #007700]]?[[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]9[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]+)+)*([-|[/COLOR]_[COLOR= #007700]]?)[/COLOR]$[COLOR= #DD0000];  
        $pattern_host = [/COLOR][COLOR= #007700]^([[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]9[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]+([-]?[[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]9[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]+)*)(([-]?)[/COLOR][COLOR= #007700].([-]?)[/COLOR][COLOR= #DD0000] 
                      . [/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]9[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]*([-]?[[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]9[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]+)+)*[/COLOR][COLOR= #007700].[[/COLOR]a[COLOR= #007700]-[/COLOR]z[COLOR= #007700]]{[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700]}[/COLOR]$[COLOR= #DD0000];  
        $match_local   = eregi($pattern_local, $local); 
        $match_host    = eregi($pattern_host, $host); 
         
        return ($match_local && $match_host ? true : false); 
    } 
     
    // Hier zullen we de fouten in opslaan 
    $fouten = array(); 
     
    if(empty($_POST[[/COLOR]gebruikersnaam[COLOR= #DD0000]])) { 
        $fouten[]    = [/COLOR]Er is geen gebruikersnaam opgegeven[COLOR= #007700].[/COLOR][COLOR= #DD0000]; 
    } elseif(strlen($_POST[[/COLOR]gebruikersnaam[COLOR= #DD0000]]) > 50) { 
        $fouten[] = [/COLOR]De gebruikersnaam mag niet langer dan [COLOR= #0000BB]50[/COLOR] tekens zijn[COLOR= #007700].[/COLOR][COLOR= #DD0000]; 
    } elseif(geregistreerd($_POST[[/COLOR]gebruikersnaam[COLOR= #DD0000]], [/COLOR]gebruikersnaam[COLOR= #DD0000])) { 
        $fouten[] = [/COLOR]De gebruikersnaam is reeds geregistreerd[COLOR= #007700].[/COLOR][COLOR= #DD0000]; 
    } 
     
     
    if(empty($_POST[[/COLOR]wachtwoord[COLOR= #DD0000]])) { 
        $fouten[]    = [/COLOR]Er is geen wachtwoord opgegeven[COLOR= #007700].[/COLOR][COLOR= #DD0000]; 
    } elseif($_POST[[/COLOR]wachtwoord[COLOR= #DD0000]] != $_POST[[/COLOR]wachtwoord_herh[COLOR= #DD0000]]) { 
        $fouten[] = [/COLOR]De wachtwoorden komen niet overeen[COLOR= #007700].[/COLOR][COLOR= #DD0000]; 
    } 
     
     
    if(!is_email($_POST[[/COLOR]email[COLOR= #DD0000]])) { 
        $fouten[] = [/COLOR]Er is geen geldig e[COLOR= #007700]-[/COLOR]mailadres opgegeven[COLOR= #007700].[/COLOR][COLOR= #DD0000]; 
    } elseif(geregistreerd($_POST[[/COLOR]email[COLOR= #DD0000]], [/COLOR]email[COLOR= #DD0000])) { 
        $fouten[] = [/COLOR]Dit e[COLOR= #007700]-[/COLOR]mailadres is reeds geregistreerd[COLOR= #007700].[/COLOR][COLOR= #DD0000]; 
    } 
     
    // Het formulier is gecontroleerd, nu kijken we of er fouten opgetreden zijn 
    if(count($fouten) > 0) { 
        ?> 
        <span style="color: #FF0000; ">De volgende fouten zijn opgetreden:</span> 
        <ul> 
            <?php foreach($fouten as $fout) { ?> 
                <li><?=$fout?></li> 
            <?php } ?> 
        </ul> 
        <?php 
     else { 
        // Er zijn geen fouten, voer registratie uit! 
        mysql_query("INSERT INTO gebruikers 
                                 (gebruikersnaam, wachtwoord, email, datum) 
                                 VALUES 
                                 (".mysql_real_escape_string($_POST[gebruikersnaam]).", 
                                  ".sha1($_POST[wachtwoord]).", 
                                  ".mysql_real_escape_string($_POST[email]).", 
                                  NOW() 
                                 )"); 
                                  
        $gebruikers_id = mysql_insert_id(); 
         
        // Een volledig willekeurige code van 40 tekens 
        $activatiecode = sha1(md5(microtime()*rand(1,10))); 
        mysql_query("INSERT INTO gebruikers_activaties 
                                 (gebruikers_id, sleutel) 
                                 VALUES 
                                 (".$gebruikers_id.", ".$activatiecode.")"); 
                                  
        // Voor de regeleinden 
        define([/COLOR]EOL[COLOR= #DD0000], "n"); 
        // Je kan deze mail uit uitbreiden, evt HTML mail,... 
        $mail   = [/COLOR]Bedankt voor je registratie[COLOR= #007700],[/COLOR] blaat[COLOR= #007700],[/COLOR] blaat[COLOR= #007700],[/COLOR] activeer hier[COLOR= #007700]:[/COLOR][COLOR= #DD0000].EOL; 
        $mail  .= [/COLOR]http[COLOR= #007700]:[/COLOR][COLOR= #FF8000]//www.joeriwii.one2xs.nl/activatie.php?gebruiker=.$gebruikers_id.&sleutel=.$activatiecode.EOL; [/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]"CPiscool" <meldaan@joeriwii.one2xs.nl>[/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] 
?> 
<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>


Maar dan geeft hij dit aan :
Parse error: syntax error, unexpected < in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/registratie.php on line 35
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Nee, niet op 70, maar op regel 90 smile:

[COLOR= #0000BB]<?[/COLOR]php // Hier komt alle behandeling van het formulier
0
Joeri

Lid · Topicstarter

Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Parse error: syntax error, unexpected T_ELSE in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/registratie.php on line 162

en nu is dit mijn code :

[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>
[COLOR= #0000BB]<?php[/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] 
     [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.joeriwii.one2xs.nl/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]"CPiscool" <meldaan@joeriwii.one2xs.nl>[/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] 
?> 
<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>
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
[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>
[COLOR= #0000BB]<?php[/COLOR]  
    [COLOR= #FF8000]// Hier komt alle behandeling van het formulier [/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] 
    [COLOR= #FF8000]// 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.joeriwii.one2xs.nl/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]"CPiscool" <meldaan@joeriwii.one2xs.nl>[/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] 
?> 
<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>


Volgens mij zo, maar je code is echt bagger...
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
} zetten voor else { op regel 162. 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