Maak je code gewoon opnieuw, want deze klopt langs geen kanten 


Maartenl schreef:Ik ben blij dat het werkte....Maak je code gewoon opnieuw, want deze klopt langs geen kanten



Jellesch schreef:Wat is de oplossing nu? Misschien wel handig om te vermelden. Dan hebben wij er ook wat aan.
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ingelogd[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]0[/COLOR][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][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"pass"[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #DD0000]"wachtwoord"[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<div align="center"> <br />Het wachtwoord klopt niet
<br /><br /><b>Wachtwoord:</b><form action="" method="post">
<input name="pass" type="password" value="" size="20"><br />
<input type="submit" value="Inloggen">
</form>
</div>[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ingelogd[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Ingelogd[/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]<div align="center"> <br /><b>Wachtwoord:</b><form action="" method="post">
<input name="pass" type="password" value="" size="20"><br />
<input type="submit" value="Inloggen">
</form>
</div> [/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]a[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]uitloggen[/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]Je bent uitgelogd. Klik <a href="">hier</a>.[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();
}[/COLOR]
?>Ingelogd[COLOR= #0000BB]<?[/COLOR]php
[COLOR= #007700]}[/COLOR]
?> Aarclay schreef:Nee, we gaan niet dood.... Ook niet als ik via de voordeur het huis verlaat.die? die? die?

Nickjexx schreef:exit;Nee, we gaan niet dood.... Ook niet als ik via de voordeur het huis verlaat.Eerdere citaten tonen
Aarclay schreef:die? die? die?
Oja dat was idd een foutje

Dylanh schreef:exit() is ook niet verstandig, dat is exact hetzelfde denk ik? Gebruik geen error functions bij foutmeldingen zoals "Het wachtwoord klopt niet!"... Bij queries en dergelijke zou ik trigger_error() gebruiken, dat laat de rest van de lay-out ook nog zien.exit;Eerdere citaten tonen
Nickjexx schreef:Nee, we gaan niet dood.... Ook niet als ik via de voordeur het huis verlaat.Eerdere citaten tonen
Aarclay schreef:die? die? die?
Oja dat was idd een foutje