PHP gevorderde |
|
Hallo,
Ik heb volgende code:
<div class="contenttopdiv" style="background-image:url(images/registreren.jpg);background-repeat: no-repeat;"></div>
<div class="contenthomediv"><a href="index.php"><img src="images/home_button.gif" alt="Homepagina" style="border:0px;"/></a></div>
<div class="contentdiv"><br /><span class="subhoofdcont" style="padding-left:20px;padding-right:20px;padding-top: 20px;">Uitloggen</span><br /><br />
<?php
if(ingelogd()) {
if(isset($_POST['ja'])) {
// verwijder het cookie
$tijd = time() - 3600;
setcookie("login","",$tijd,'/');
header("Location: index.php?page=home");
}
elseif(isset($_POST['nee'])) {
echo '<p style="padding-left:20px;">';
echo 'Je bent niet uitgelogd!<br/>';
echo '<a href="index.php?page=home2">Home</a>';
echo '</p>';
}
else {
?>
<table style="margin-left: 20px;margin-right: 20px;"><form name="delleiding" method="post" action="<?php $_SERVER['REQUEST_URI']; ?>">
<tr valign=top>
<td colspan="2">Wilt u uitloggen?</td>
</tr>
<tr>
<td><input type="submit" value="ja" name="ja" style="width:40px"/></td><td><input type="submit" value="nee" name="nee" style="width:40px"/></td>
</tr>
</form>
</table>
<?php
}
}
else
{
echo '<p style="padding-left:20px;">';
include('inloggen.php');
echo '</p>';
}
?></div>
<div class="contenttopdiv" style="background-image:url(images/registreren.jpg);background-repeat: no-repeat;"></div> <div class="contenthomediv"><a href="index.php"><img src="images/home_button.gif" alt="Homepagina" style="border:0px;"/></a></div> <div class="contentdiv"><br /><span class="subhoofdcont" style="padding-left:20px;padding-right:20px;padding-top: 20px;">Uitloggen</span><br /><br /> <?php if(ingelogd()) { if(isset($_POST['ja'])) { // verwijder het cookie header("Location: index.php?page=home"); } elseif(isset($_POST['nee'])) { echo '<p style="padding-left:20px;">'; echo 'Je bent niet uitgelogd!<br/>'; echo '<a href="index.php?page=home2">Home</a>'; } else { ?> <table style="margin-left: 20px;margin-right: 20px;"><form name="delleiding" method="post" action="<?php $_SERVER['REQUEST_URI']; ?>"> <tr valign=top> <td colspan="2">Wilt u uitloggen?</td> </tr> <tr> <td><input type="submit" value="ja" name="ja" style="width:40px"/></td><td><input type="submit" value="nee" name="nee" style="width:40px"/></td> </tr> </form> </table> <?php } } else { echo '<p style="padding-left:20px;">'; include('inloggen.php'); } ?></div>
Eerst was dit voldoende om uit te loggen. Maar nu werkt het totaal niet meer... Hoe komt dit??
|