Foutje Ledensysteem

Gestart doorRubenmaxie17 reacties36 weergaven

18 berichten · pagina 1 van 2

Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heey,

Er zit nog een foutje in, maar dan nu in me inlog-systeem op lijn 166.
Zien jullie m misschien? redface Het schijnt iets te zijn met "session_start()".

Dit is de code:

<html>
<head>
<style type="text/css">
body, html {
background-color: #808080;
padding: 0;
margin: 0;
}

input {
border: 1px solid #000000;
}

.headertekst {
margin: 10px 0 25px 80px;
}

.menu_subheader {
background-color: #0066ff;
width: 240px;
height: 40px;
color: #ffffff;
font-size: 18px;
font-weight: bold;
border: 1px solid #ffffff;
padding-top: 9px;
padding-left: 15px;
margin-top: 3px;
margin-left: 4px;
}

.content_menu {
background-color: #0066ff;
width: 592px;
height: 40px;
color: #ffffff;
font-size: 16px;
font-weight: bold;
border: 1px solid #ffffff;
padding-top: 9px;
padding-left: 15px;
margin-top: 3px;
margin-left: 4px;
}

.content_menu a {
color: #ffffff;
font-size: 16px;
font-weight: bold;
text-decoration: none;
}

.content_menu a:hover {
color: #ffffff;
font-size: 16px;
font-weight: bold;
text-decoration: underline;
}

#main {
width: 859px;
height: 552px;
margin: -276px 0 0 -429.5px;
position: absolute;
top: 348px;
left: 50%;
}

#header {
height: 45px; 
background: url("headerbg.jpg");
margin: 0px 0 2px 0;
padding: 0;
border-bottom: 1px dotted #ffffff;
color: #0066FF;
}

#menu {
height: 550px;
width: 250px;
background-color: #a9a9a9;
border: 1px dotted #ffffff;
}

#menu ul, li {
list-style-type: none;
}

#menu a {
color: #0066ff;
font-size: 12pt;
margin-left: 15px;
text-decoration: none;
}

#menu a:hover {
color: #0066ff;
font-size: 12pt;
margin-left: 15px;
text-decoration: underline;
}

#menu p {
color: #000000;
font-size: 12pt;
margin-left: 15px;
}

#menu h2 {
color: #000000;
font-size: 16pt;
margin-left: 15px;
}

#content {
height: 550px;
width: 600px;
background-color: #a9a9a9;
border: 1px dotted #ffffff;
position: absolute;
top: 0;
left: 252px;
}

#content h2 {
color: #000000;
font-size: 16pt;
margin-left: 0;
margin-right: 15px;
}

#content p {
color: #000000;
font-size: 12pt;
margin-left: 15px;
margin-right: 15px;
}

#content form {
color: #000000;
font-size: 12pt;
margin-left: 15px;
margin-right: 15px;
}
</style>
<title>Hoofdpagina</title>
</head>
<body>
<div id="header">
<img src="headertekst.jpg" class="headertekst">
</div>
<div id="main">
<div id="menu">
<div class="menu_subheader">Menu</div>
<h2>Hoofdmenu</h2>
<a href="http://www.oefenen.prutz0r.nl/index.php">Home</a><br/>
<a href="http://www.oefenen.prutz0r.nl/register.php">Aanmelden</a><br/>
<a href="http://www.oefenen.prutz0r.nl/login.php">Inloggen</a><br/>
<a href="http://www.oefenen.prutz0r.nl/sponsors.php">Sponsors</a><br/><br/>
<h2>Ledenmenu</h2>
<p>Niet ingelogd.</p>
</div>
<div id="content">
<div class="content_menu"><a href="http://www.oefenen.prutz0r.nl/index.php">Home</a> | <a href="http://www.oefenen.prutz0r.nl/adverteren.php">Adverteren</a> | <a href="http://www.oefenen.prutz0r.nl/stats.php">Statistieken</a> | <a href="http://www.oefenen.prutz0r.nl/faq.php">FAQ/Uitleg</a> | <a href="http://www.oefenen.prutz0r.nl/contact.php">Contact</a></div>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
?>

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$logout[/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]"U bent uitgelogd!"[/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]$user[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$login[/COLOR][COLOR= #007700])
{[/COLOR]
?>
<html>
<head>
<title>Inloggen</title>
</head>
<form action="login.php?login=ja" method="POST">
<table>
<tr><td>Gebruikersnaam:</td><td><input type="text" name="user"></td></tr>
<tr><td>Wachtwoord:</td><td><input type="password" name="pass"></td></tr>
</table>
<input type="submit" name="submit" value="Inloggen">
</form>
</html>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #DD0000]""[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$user[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$md5password[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$login[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"true"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$dbuser[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Ruben0_***"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$dbpass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"***"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$dbhost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$database[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Ruben0_***"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM members WHERE user = $user AND pass = $md5password"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$aantalrijen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aantalrijen[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"U bent al ingelogd als"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]",<P> a href=login.php?logout=uitloggen>log uit.</a>"[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/session_register"]session_register[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"login"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/session_register"]session_register[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"user"[/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]"Dit wachtwoord is niet juist!"[/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]"U bent al ingelogd als "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]",<P> <a href=login.php?logout=uitloggen>log uit.</a>"[/COLOR][COLOR= #007700];
}
}[/COLOR]
?>
</div>
</div>
</body>
</html>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/EXIT"]EXIT[/URL][COLOR= #007700]();[/COLOR]
?>
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Haal die "" weg bij de user pass enzo.
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat werkte dus smile
Maar nu geeft hij een fout op lijn 81...
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Tab je code dan ook... Ik zal weer ff gaan debuggen..
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke, dankjewel, maar ik kan me code niet tabben, want dan gaat de cursor weg in de textarea. hypocrite
____________________________________________________

Hij geeft aan, dat er iets mis is met zon accolade... confusedEn ik heb m al biggrin Bedankt allemaal voor het helpen! winkEr stond idd een accolade teveel onder de variabele query.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])   {[/COLOR]
?>
    <html>
        <head>
            <title>Registreren</title>
        </head>
        
        <body>
            <form action="index.php" method="GET">
                <h1>Registreren</h1>
                
                <h2>Accountgegevens</h2>
                <table>
                    <tr>
                        <td>Gebruikersnaam:</td>
                        <td><input type="text" name="user"></td>
                    </tr>
                    <tr>
                        <td>Wachtwoord:</td>
                        <td><input type="text" name="pass"></td>
                    </tr>
                    <tr>
                        <td>Herhaal Wachtwoord:</td>
                        <td><input type="text" name="hpass"></td>
                    </tr>
                </table>
                
                <h2>Persoonlijke gegevens</h2>
                <table>
                    <tr>
                        <td>Voornaam:</td>
                        <td><input type="text" name="fname"></td>
                    </tr>
                    <tr>
                        <td>Tussenvoegsel:</td>
                        <td><input type="text" name="insertion"></td>
                    </tr>
                    <tr>
                        <td>Achternaam:</td>
                        <td><input type="text" name="sname"></td>
                    </tr>
                    <tr>
                        <td>Leeftijd:</td>
                        <td><input type="text" name="age"></td>
                    </tr>
                    <tr>
                        <td>Geslacht:</td>
                        <td><input type="text" name="alias"></td>
                    </tr>
                    <tr>
                        <td>E-mailadres:</td>
                        <td><input type="text" name="email"></td>
                    </tr>
                </table><br/>
                <input type="submit" name="submit"><input type="reset" name="reset">
            </form>
        </body>
    </html>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR] 
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]]) && ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]) && ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]fname[/COLOR][COLOR= #007700]]) && ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]insertion[/COLOR][COLOR= #007700]]) && ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sname[/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]alias[/COLOR][COLOR= #007700]]) && ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]age[/COLOR][COLOR= #007700]])) {[/COLOR]
    [COLOR= #0000BB]$user[/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]user[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$pass[/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]pass[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$fname[/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]fname[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$insertion[/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]insertion[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$sname[/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]sname[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$email[/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= #0000BB]$alias[/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]alias[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$age[/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]age[/COLOR][COLOR= #007700]]);[/COLOR]

    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]$hpass[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR][COLOR= #007700]) >=[/COLOR] [COLOR= #0000BB]6[/COLOR][COLOR= #007700]) {[/COLOR]
            [COLOR= #0000BB]$dbuser[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Ruben0_***"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$dbpass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"***"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$dbhost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$database[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Ruben0_***"[/COLOR][COLOR= #007700];[/COLOR]
            
            [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$dbhost[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$dbuser[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$dbpass[/COLOR][COLOR= #007700]);[/COLOR]
            [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$database[/COLOR][COLOR= #007700]);[/COLOR]
            
            [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM members WHERE user = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]

            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])){[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Deze gebruikersnaam bestaat al!"[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                [COLOR= #0000BB]$md5password[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR][COLOR= #007700]);[/COLOR]
                [COLOR= #0000BB]$ip[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$REMOTE_ADDR[/COLOR][COLOR= #007700];[/COLOR]
                [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO members(user, pass, fname, insertion, sname, email, alias, age, ip) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fname[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$insertion[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$sname[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$email[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$alias[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$age[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$ip[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700];
            }[/COLOR]

            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/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]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Uw account is aangemaakt!"[/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]"Wachtwoord is te kort!"[/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]"Wachtwoorden zijn niet gelijk!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();[/COLOR]
?>


Ook onnodige dingen weggehaald, en je query insert veiliger gemaakt door mysql_real_escape (bijvoorbeeld in de naam kon je een mysql injectie doen)
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Guildjuhh: Oke, dankjewel, biggrin
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Ja, ik las pas later dat je zelf al opgelost had. Maarja. Je moet toch toegeven dat het overzichtelijker is met tabbing wink
0
Berichten
1.160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Guildjuhh:
Ja, ik las pas later dat je zelf al opgelost had. Maarja. Je moet toch toegeven dat het overzichtelijker is met tabbing wink
Leuke avatar yummieIk zag al op 65 dat er geen values waren gegeven maar reageerde dus te laat yummie
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kan iemand nog even kijken naar me nieuwe vraag, bovenaan deze pagina. hypocrite
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Gaat ie nog niet tabben schaterIk doe het nog een keer, maar de volgende keer heb je echt pech schaterEDIT Hier is geen regel 166, dus hier zit geen fout in :haha:
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Uhm,... Het ligt écht niet aan het tabben, maar nog een keer, dat kan niet bij mijn webhosting,
want dan gaa de cursor uit de textarea...

Maar toch bedankt alvast, wink
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Lees bericht hierboven met edit smile
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik weet het, sorry, ik heb nu de goede neergezet wink
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Zie het al, 1 sec

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
?>
<html>
<head>
<style type="text/css">
body, html {
background-color: #808080;
padding: 0;
margin: 0;
}

input {
border: 1px solid #000000;
}

.headertekst {
margin: 10px 0 25px 80px;
}

.menu_subheader {
background-color: #0066ff;
width: 240px;
height: 40px;
color: #ffffff;
font-size: 18px;
font-weight: bold;
border: 1px solid #ffffff;
padding-top: 9px;
padding-left: 15px;
margin-top: 3px;
margin-left: 4px;
}

.content_menu {
background-color: #0066ff;
width: 592px;
height: 40px;
color: #ffffff;
font-size: 16px;
font-weight: bold;
border: 1px solid #ffffff;
padding-top: 9px;
padding-left: 15px;
margin-top: 3px;
margin-left: 4px;
}

.content_menu a {
color: #ffffff;
font-size: 16px;
font-weight: bold;
text-decoration: none;
}

.content_menu a:hover {
color: #ffffff;
font-size: 16px;
font-weight: bold;
text-decoration: underline;
}

#main {
width: 859px;
height: 552px;
margin: -276px 0 0 -429.5px;
position: absolute;
top: 348px;
left: 50%;
}

#header {
height: 45px; 
background: url("headerbg.jpg");
margin: 0px 0 2px 0;
padding: 0;
border-bottom: 1px dotted #ffffff;
color: #0066FF;
}

#menu {
height: 550px;
width: 250px;
background-color: #a9a9a9;
border: 1px dotted #ffffff;
}

#menu ul, li {
list-style-type: none;
}

#menu a {
color: #0066ff;
font-size: 12pt;
margin-left: 15px;
text-decoration: none;
}

#menu a:hover {
color: #0066ff;
font-size: 12pt;
margin-left: 15px;
text-decoration: underline;
}

#menu p {
color: #000000;
font-size: 12pt;
margin-left: 15px;
}

#menu h2 {
color: #000000;
font-size: 16pt;
margin-left: 15px;
}

#content {
height: 550px;
width: 600px;
background-color: #a9a9a9;
border: 1px dotted #ffffff;
position: absolute;
top: 0;
left: 252px;
}

#content h2 {
color: #000000;
font-size: 16pt;
margin-left: 0;
margin-right: 15px;
}

#content p {
color: #000000;
font-size: 12pt;
margin-left: 15px;
margin-right: 15px;
}

#content form {
color: #000000;
font-size: 12pt;
margin-left: 15px;
margin-right: 15px;
}
</style>
<title>Hoofdpagina</title>
</head>
<body>
<div id="header">
<img src="headertekst.jpg" class="headertekst">
</div>
<div id="main">
<div id="menu">
<div class="menu_subheader">Menu</div>
<h2>Hoofdmenu</h2>
<a href="http://www.oefenen.prutz0r.nl/index.php">Home</a><br/>
<a href="http://www.oefenen.prutz0r.nl/register.php">Aanmelden</a><br/>
<a href="http://www.oefenen.prutz0r.nl/login.php">Inloggen</a><br/>
<a href="http://www.oefenen.prutz0r.nl/sponsors.php">Sponsors</a><br/><br/>
<h2>Ledenmenu</h2>
<p>Niet ingelogd.</p>
</div>
<div id="content">
<div class="content_menu"><a href="http://www.oefenen.prutz0r.nl/index.php">Home</a> | <a href="http://www.oefenen.prutz0r.nl/adverteren.php">Adverteren</a> | <a href="http://www.oefenen.prutz0r.nl/stats.php">Statistieken</a> | <a href="http://www.oefenen.prutz0r.nl/faq.php">FAQ/Uitleg</a> | <a href="http://www.oefenen.prutz0r.nl/contact.php">Contact</a></div>

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$logout[/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]"U bent uitgelogd!"[/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]$user[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$login[/COLOR][COLOR= #007700])
{[/COLOR]
?>
<html>
<head>
<title>Inloggen</title>
</head>
<form action="login.php?login=ja" method="POST">
<table>
<tr><td>Gebruikersnaam:</td><td><input type="text" name="user"></td></tr>
<tr><td>Wachtwoord:</td><td><input type="password" name="pass"></td></tr>
</table>
<input type="submit" name="submit" value="Inloggen">
</form>
</html>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #DD0000]""[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$user[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$md5password[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$login[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"true"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$dbuser[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Ruben0_***"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$dbpass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"***"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$dbhost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$database[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Ruben0_***"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM members WHERE user = $user AND pass = $md5password"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$aantalrijen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aantalrijen[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"U bent al ingelogd als"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]",<P> a href=login.php?logout=uitloggen>log uit.</a>"[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/session_register"]session_register[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"login"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/session_register"]session_register[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"user"[/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]"Dit wachtwoord is niet juist!"[/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]"U bent al ingelogd als "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]",<P> <a href=login.php?logout=uitloggen>log uit.</a>"[/COLOR][COLOR= #007700];
}
}[/COLOR]
?>
</div>
</div>
</body>
</html>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/EXIT"]EXIT[/URL][COLOR= #007700]();[/COLOR]
?>


Zorg altijd dat je session_start() of header() gebruikt VOOR je html gaat neerpleuren. Je browser verzend namelijk maar 1-malig de headers, en als je al iets hebt ge-echod dan zijn die headers al verzonden smile
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