Ik ben bezig met een ledensysteempje, voor me website. maar als ik inlog doet hij het niet.
ik krijg geen error niks.
login.phpalvast bedankt.
als er nog iets bij moet van code dan hoor ik het wel
ik krijg geen error niks.
login.php
Spoiler tonen
[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]
top[COLOR= #007700]();[/COLOR]
heat[COLOR= #007700]();[/COLOR]
menu[COLOR= #007700]();[/COLOR]
nav[COLOR= #007700]();[/COLOR]
news[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 users WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" AND password = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// Met deze query halen we de data uit de database, met de opgevraagde POST-data[/COLOR]
[COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// Hiermee halen we, als we succesvol zijn ingelogd, data op van de gebruiker met de bijbehoorende POST-data[/COLOR]
[COLOR= #0000BB]$num[/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] [COLOR= #FF8000]// Met deze query controleren we de login, dus de POST-data username, en password, of er in de tabel overeenkomsten zijn.[/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]sumbit[/COLOR][COLOR= #007700]]))[/COLOR] [COLOR= #FF8000]// Controleer of er op de login-button is geklikt.[/COLOR]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$num[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])[/COLOR] [COLOR= #FF8000]// Gebruiker niet ingelogd, mogelijk verkeerde combinatie van username, en password[/COLOR]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Gebruikersusername-/password komen niet overeen, probeer het opnieuw.[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]// Gebruiker is ingelogd, nu maken we wat sessies van de gebruikte, en komende variablen, zodat je die later weer kan opvragen.[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Welkom ingelogd, <strong>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</strong>.[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Weergeef een welkoms bericht[/COLOR]
[COLOR= #007700]}
}[/COLOR]
?>
<div id="center">
<h1><div align="center">Login pagina</div></h1>
<div class="text">
<span>Log hier snel en veilig in op [COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$web_username[/COLOR][COLOR= #007700];[/COLOR] ?>.</span>
</div>
<div class="text">
<img src="images/login.png" class="img" width="120" height="90" alt="" />
<p>
<form action="<?=$_SERVER[PHP_SELF];?>" method="post">
<table border="1px" cellpadding="0">
<tr><td>Gebruikersnaam:</td><td><input type="text" name="username" /></td></tr>
<tr><td>Wachtwoord:</td><td><input type="password" name="password" /></td></tr>
<tr><td><input type="button" name="sumbit" value="login" /></td><td> </td></tr>
</table>
</form>
</p>
<br /><br /><br />
<h1><div align="center">Nog niet aangemeld?</div></h1>
<div class="text">
<span>Registreer je gratis en snel in bij [COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$web_username[/COLOR][COLOR= #007700];[/COLOR] ?>.</span>
</div>
<br />
<p>
Klik op de link om je zelf te registreren <a href="aanmelden.php">Klik hier</a>.<br />
Indien u al een lid ben, is dit niet voor toepassing voor u.
</p>
</div>
</div>
[COLOR= #0000BB]<?php[/COLOR]
foot[COLOR= #007700]();[/COLOR]
?>als er nog iets bij moet van code dan hoor ik het wel

