een vraag

Gestart doorErik23 reacties211 weergaven

24 berichten · pagina 2 van 2

Berichten
747
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dan doe je iets verkeerd emo
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
oow. emo
0
Berichten
747
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Post eens wat je hebt?
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]//Top includen.[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"top.php"[/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
                <h1>
                    Registreer
                </h1>[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]//Het IP van deze gebruiker in een variable zetten.[/COLOR]
[COLOR= #0000BB]$ip[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #FF8000]//Checken met de database.[/COLOR]
[COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
                SELECT *
                    FROM members
                WHERE
                    ip = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ip[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"
                    "[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR]echo_mysql_error[COLOR= #007700]());[/COLOR]
[COLOR= #FF8000]//Deze gebruiker is al lid van deze site.[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
                Hallo,<br />
                Je bent op deze site al geregistreerd.<br />
                <a href="login.php">Login</a>[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #FF8000]//Deze gebruiker is nog niet lid.[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
    [COLOR= #FF8000]//Deze gebruiker heeft al op Registreer geklikt.[/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]//Variables klaar maken.[/COLOR]
        [COLOR= #0000BB]$gebruikersnaam[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]);[/COLOR]
        [COLOR= #0000BB]$wachtwoord1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord1[/COLOR][COLOR= #007700]]);[/COLOR]
        [COLOR= #0000BB]$wachtwoord2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord2[/COLOR][COLOR= #007700]]);[/COLOR]
        [COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]];[/COLOR]
        [COLOR= #0000BB]$emailweergeven[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]emailweergeven[/COLOR][COLOR= #007700]]);[/COLOR]
        [COLOR= #FF8000]//Er is iets helaas niet ingevuld.[/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]$gebruikersnaam[/COLOR][COLOR= #007700]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wachtwoord1[/COLOR][COLOR= #007700]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wachtwoord2[/COLOR][COLOR= #007700]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700]))
        {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
                Hallo,<br />
                Je hebt iets niet ingevuld.<br />
                <a href="javascript:history.back(-1)">Verbeter de fouten</a><br />[/COLOR][COLOR= #007700];
        }[/COLOR]
        [COLOR= #FF8000]//De twee wachtwoorden zijn niet gelijk.[/COLOR]
        [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wachtwoord1[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$wachtwoord2[/COLOR][COLOR= #007700])
        {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
                Hallo,<br />
                De twee wachtwoorden die je opgaf zijn niet gelijk.<br />
                <a href="javascript:history.back(-1)">Verbeter de fouten</a><br />[/COLOR][COLOR= #007700];
        }[/COLOR]
        [COLOR= #FF8000]//Het email adres is niet geldig.[/COLOR]
        [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR]filter_var[COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700],[/COLOR] FILTER_VALIDATE_EMAIL[COLOR= #007700])
        {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
                Hallo,<br />
                Het email adres dat je opgaf is niet geldig.<br />
                <a href="javascript:history.back(-1)">Verbeter de fouten</a><br />[/COLOR][COLOR= #007700];
        }[/COLOR]
        [COLOR= #FF8000]//De gebruikersnaam checken met de database.[/COLOR]
        [COLOR= #0000BB]$gebruikersnaamquery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
                                        SELECT *
                                            FROM members
                                        WHERE
                                            gebruikersnaam = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"
                                            "[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR]echo_mysql_error[COLOR= #007700]());[/COLOR]
        [COLOR= #FF8000]//De gebruikersnaam die de gebruiker opgaf is niet geldig.[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$gebruikersnaamquery[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
        {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
                Hallo,<br />
                De gebruikersnaam die je opgaf is al in gebruik.<br />
                <a href="javascript:history.back(-1)">Verbeter de fouten</a>[/COLOR][COLOR= #007700];
        }[/COLOR]
        [COLOR= #FF8000]//Alles oké. Dus we gaan deze gebruiker toevoegen aan de database.[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [COLOR= #FF8000]//Keygen maken.[/COLOR]
            [COLOR= #0000BB]$keygen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]100000[/COLOR][COLOR= #007700]);[/COLOR]
            [COLOR= #FF8000]//Toevoegen.[/COLOR]
            [COLOR= #0000BB]$toevoeg[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
                                INSERT INTO
                                    members
                                (
                                    ip,
                                    gebruikersnaam,
                                    wachtwoord,
                                    email,
                                    emailweergeven,
                                    munten,
                                    keygen
                                )
                                VALUES
                                (
                                    "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ip[/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]$gebruikersnaam[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]",
                                    "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wachtwoord1[/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]$email[/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]$emailweergeven[/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]$ov[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]default_munten[/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]$keygen[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]"
                                )
                                    "[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR]echo_mysql_error[COLOR= #007700]());[/COLOR]
            [COLOR= #FF8000]//Bericht maken voor een email.[/COLOR]
            [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]
                        Hallo [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000],
                        Je hebt je onlangs aangemeld op [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ov[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]site_name[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000].
                        Hierbij ontvang je je gegevens en je activatie keygen.
                        Je activatie keygen is: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$keygen[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]
                        Om je account te activeren moet je naar deze link gaan:
                        [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ov[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]site_url[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]/activatie.php
                        Hieronder vind je je gegevens.
                        Gebruikersnaam: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]
                        Wachtwoord: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$wachtwoord1[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]
                        Groetjes,
                        [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ov[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]site_name[/COLOR][COLOR= #007700]];[/COLOR]
            [COLOR= #FF8000]//Mail versturen.[/COLOR]
            [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]Registratie[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]FROM: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ov[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]site_email[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000][/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
                Hallo,<br />
                Je bent succesvol geregistreerd op deze website.<br />
                Je hebt een mailtje gekregen met daarin je gegevens en je activatie keygen.<br />
                <a href="activatie.php">Activeer je account</a>[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
    [COLOR= #FF8000]//Deze gebruiker heeft nog niet op Registreer geklikt.[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
                <form action="" method="post">
                    <table width="100%">
                        <tr>
                            <td class="een">
                                Gebruikersnaam
                            </td>
                            <td class="een">
                                <input type="text" name="gebruikersnaam" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Wachtwoord
                            </td>
                            <td>
                                <input type="password" name="wachtwoord1" />
                            </td>
                        </tr>
                        <tr>
                            <td class="een">
                                Wachtwoord <small>(Nogmaals)</small>
                            </td>
                            <td class="een">
                                <input type="password" name="wachtwoord2" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Email
                            </td>
                            <td>
                                <input type="text" name="email" />
                            </td>
                        </tr>
                        <tr>
                            <td class="een">
                                Email weergeven?
                            </td>
                            <td class="een">
                                <input type="checkbox" class="checkbox" value="1" name="emailweergeven" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <input type="submit" name="submit" value="Registreer" />
                            </td>
                        </tr>
                    </table>
                </form>[/COLOR][COLOR= #007700];
    }
}[/COLOR]
[COLOR= #FF8000]//Bottom includen.[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"bottom.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Berichten
2.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
elseif(filter_var($email, FILTER_VALIDATE_EMAIL)

Vervangen door

elseif(!filter_var($email, FILTER_VALIDATE_EMAIL))
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
is da niet onweg? emo Want ik ben daar bezig met de foute dingen. emo
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
onweg?
0
Berichten
747
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je bent dat uitroepteken vergeten, zet die erbij en het werkt.
0
Berichten
2.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
en een )
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