beveiliging

Gestart doorJorzwa2 reacties47 weergaven

3 berichten · pagina 1 van 1

Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

ik heb een oud admin panel van me terug gevonden maar nu ik op beheerderstoevoegen.php de beveiliging eraf halen om een admin account aan te maken code:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../config.php[/COLOR][COLOR= #007700]);[/COLOR]
?>
<html>
<head>
<link rel="stylesheet" href="../style.css" type="text/css" />
<title>JongerenPlek - Beheerpagina - Beheerder Toevoegen</title>
</head>
<body>
<div align="center"><a href="index.php"><img src="../images/logo.png" width="600" height="120" border="0" /></a><br /><br /></div>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"U bent niet ingelogd!<br />
    <a href="inloggen.php">Klik hier om in te loggen</a>.<br />"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR]

    [COLOR= #0000BB]$gebruiker[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM beheerders WHERE gebruikersnaam = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" AND wachtwoord = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$nakijken[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$gebruiker[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [COLOR= #0000BB]$bestaat[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$nakijken[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bestaat[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"0"[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er klopt iets niet aan je log in gegevens<br />
        <a href="inloggen.php">Klik hier om in te loggen</a>.<br />"[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/session_destroy"]session_destroy[/URL][COLOR= #007700]();[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<br />Deze fout kan voorkomen als je je wachtwoord gewijzigd hebt. Dan moet je opnieuw inloggen met je nieuwe wachtwoord.<br />"[/COLOR][COLOR= #007700];
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]){[/COLOR]
            [URL="http://www.php.net/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] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord1[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord2[/COLOR][COLOR= #007700]])){[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je hebt een of meer verplichte velden niet ingevuld!<br />
                <a href="javascript:history.back(1)">Klik hier om terug te gaan</a>.<br />"[/COLOR][COLOR= #007700];
            }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord1[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord2[/COLOR][COLOR= #007700]]){[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De 2 wachtwoorden komen niet overeen met elkaar!<br />
                    <a href="javascript:history.back(1)">Klik hier om terug te gaan</a>.<br />"[/COLOR][COLOR= #007700];
                }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
                    [COLOR= #0000BB]$select[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM beheerders WHERE gebruikersnaam = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
                    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
                    [COLOR= #0000BB]$bestaatbeheerder[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
                    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bestaatbeheerder[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000]"0"[/COLOR][COLOR= #007700]){[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er is al een beheerder met deze gebruikersnaam!<br />
                        <a href="javascript:history.back(1)">Klik hier om terug te gaan</a>.<br />"[/COLOR][COLOR= #007700];
                    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
                
                        [COLOR= #0000BB]$wachtwoord3[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord1[/COLOR][COLOR= #007700]]);[/COLOR]
                        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO beheerders (id, gebruikersnaam, email, wachtwoord) VALUES 
                        (, "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$wachtwoord3[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]");"[/COLOR][COLOR= #007700]);[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De beheerder is <b>succesvol</b> toegevoegd.<br />
                        <a href="index.php">Klik hier om terug te gaan naar de admin</a>."[/COLOR][COLOR= #007700];
        
                    }
                }
            }
        }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<form method="post" action=""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_URI[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"">
            Gebruikersnaam:<br />
            <input type="text" name="gebruikersnaam" size="40" />
            <br /><br />
            E-mailadres:<br />
            <input type="text" name="email" size="40" />
            <br /><br />
            Wachtwoord:<br />
            <input type="password" name="wachtwoord1" size="40" />
            <br /><br />
            Wachtwoord: (bevestiging)<br />
            <input type="password" name="wachtwoord2" size="40" />
            <br /><br />
            <input type="submit" name="submit" value="Beheerder Toevoegen" /> 
            <input type="reset" name="reset" value="Wis Invoer" />
            </form>"[/COLOR][COLOR= #007700];
        }
    }
}[/COLOR]
?>
</body>
</html>


wie kan me helpen?
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
heb er niet veel/weinig verstand van.

maar je moet toch gewoon:
opdracht geven nieuwe accaunt in db doen.
dus wat heeft de beveiliging daar mee te maken dan:?confused:?
0
Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
nieuwe acc in db werkt niet maar heb al fixed yummie shopsource is bijna klaar!
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