[PHP] Simpel beveiligen wachtwoord & Sessie

Gestart doorMarvinn71 reacties159 weergaven

72 berichten · pagina 4 van 5

Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
je gaat eerst een sessie proberen te verwijderen, terwijl de sessie-motor (session_start) niet geladen is..
En maak je opeens weer een sessie aan? Je wou toch uitloggen?

Nee, erg logisch ....wink...
En die meta-tag hoort er niet.

Oh wacht ff
toevoeging op 15 juni 2012, 18:53:16:
In deze richting dan?
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/session_start"]session_start[/URL][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 nu succesvol uitgelogd.<br />"[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Nickjexx schreef:
Eerdere citaten tonen
Aarclay schreef:
je gaat eerst een sessie proberen te verwijderen, terwijl de sessie-motor (session_start) niet geladen is..
En maak je opeens weer een sessie aan? Je wou toch uitloggen?

Nee, erg logisch ....wink...
En die meta-tag hoort er niet.

Oh wacht ff

toevoeging op 15 juni 2012, 18:53:16:
In deze richting dan?
[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/session_start"]session_start[/URL][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 nu succesvol uitgelogd.<br />"[/COLOR][COLOR= #007700];[/COLOR]
?>

Ja.

http://www.homeandlearn.co.uk/php/php14p4.html

toevoeging op 15 juni 2012, 18:55:13:
en gebruik header(); als je wil doorsturen
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan is er iets fout in dit script:
[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]1[/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]"admin"[/COLOR][COLOR= #007700]) {[/COLOR]  
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Wachtwoord klopt niet"[/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]Je bent ingelogd, klik <a href="">hier</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]<div align="right">  
                <form action="" method="post">  
                    <input name="pass" type="password" value="" size="9"><br />  
                    <input type="submit" value="Log in">  
                </form>  
            </div> [/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]<style type="text/css"> 
body {
    font-family: Verdana;
    font-size: 11px;
}
body,td,tr {
    font-size: 11px;
    font-family: Verdana, Arial;
    margin-top:0px;
} </style>
<center><form action="------" method="post">
<br><br>Tekst in tweet: <br><textarea style="font-family:Verdana; font-size:11px;" name="tekst" cols="48" rows="10"></textarea>
<br><input type="submit" value="Tweet versturen" />
</form></center>
<center><form action="----" method="post">
<br>Tweets weergeven van: <br><input type="text" name="weergeven" />
<br><input type="submit" value="Tweets ophalen" />
</form></center> [/COLOR][COLOR= #007700];
}[/COLOR]

?>


En 2x op 1 pagina session_start kan btw toch ook niet?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
try.... wink
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit heb ik tot nu toe:

[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]1[/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]"admin"[/COLOR][COLOR= #007700]) {[/COLOR]  
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Wachtwoord klopt niet"[/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]Je bent ingelogd, klik <a href="">hier</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]<div align="right">  
                <form action="" method="post">  
                    <input name="pass" type="password" value="" size="9"><br />  
                    <input type="submit" value="Log in">  
                </form>  
            </div> [/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]<style type="text/css"> 
body {
    font-family: Verdana;
    font-size: 11px;
}
body,td,tr {
    font-size: 11px;
    font-family: Verdana, Arial;
    margin-top:0px;
} </style>
<center><form action="---" method="post">
<br><br>Tekst in tweet: <br><textarea style="font-family:Verdana; font-size:11px;" name="tekst" cols="48" rows="10"></textarea>
<br><input type="submit" value="Tweet versturen" />
</form></center>
<center><form action="---" method="post">
<br>Tweets weergeven van: <br><input type="text" name="weergeven" />
<br><input type="submit" value="Tweets ophalen" />
</form></center> [/COLOR][COLOR= #007700];
}[/COLOR]

?>
[COLOR= #0000BB]<?php[/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 nu succesvol uitgelogd.<br />"[/COLOR][COLOR= #007700]; }[/COLOR] ?>


Waar zit de fout yummie? Want het uitloggen werkt niet.
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Geen HTML en PHP door elkaar.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Maak een nieuwe pagina met daarop de log uit.
En waarom alle html echo`n in php?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Of gebruik switch() om de verschillende acties ($_GET[a]) een plaats te geven.
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nou nieuwe pagina: uitloggen.php

[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/session_start"]session_start[/URL][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 nu succesvol uitgelogd.<br />"[/COLOR][COLOR= #007700];[/COLOR]
?>


Nou en dat werkt ook niet... Ik weet het niet meer.
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je kan ook zo doen toch?

[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]1[/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]"admin"[/COLOR][COLOR= #007700]) {[/COLOR]  
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Wachtwoord klopt niet"[/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]Je bent ingelogd, klik <a href="">hier</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]<div align="right">  
                <form action="" method="post">  
                    <input name="pass" type="password" value="" size="9"><br />  
                    <input type="submit" value="Log in">  
                </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]

?>
<style type="text/css"> 
    body {
        font-family: Verdana;
        font-size: 11px;
    }
    body,td,tr {
        font-size: 11px;
        font-family: Verdana, Arial;
        margin-top:0px;
    }
</style>
<center><form action="------" method="post">
<br><br>Tekst in tweet: <br><textarea style="font-family:Verdana; font-size:11px;" name="tekst" cols="48" rows="10"></textarea>
<br><input type="submit" value="Tweet versturen" />
</form></center>
<center><form action="----" method="post">
<br>Tweets weergeven van: <br><input type="text" name="weergeven" />
<br><input type="submit" value="Tweets ophalen" />
</form>
    <br />
    <a href="?a=uitloggen">Uitloggen</a>
</center>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]

?>
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_destroy"]session_destroy[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Location: index.php[/COLOR][COLOR= #007700]);[/COLOR]
?>


dan?
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thommity schreef:
Je kan ook zo doen toch?

[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]1[/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]"admin"[/COLOR][COLOR= #007700]) {[/COLOR]  
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Wachtwoord klopt niet"[/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]Je bent ingelogd, klik <a href="">hier</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]<div align="right">  
                <form action="" method="post">  
                    <input name="pass" type="password" value="" size="9"><br />  
                    <input type="submit" value="Log in">  
                </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]

?>
<style type="text/css"> 
    body {
        font-family: Verdana;
        font-size: 11px;
    }
    body,td,tr {
        font-size: 11px;
        font-family: Verdana, Arial;
        margin-top:0px;
    }
</style>
<center><form action="------" method="post">
<br><br>Tekst in tweet: <br><textarea style="font-family:Verdana; font-size:11px;" name="tekst" cols="48" rows="10"></textarea>
<br><input type="submit" value="Tweet versturen" />
</form></center>
<center><form action="----" method="post">
<br>Tweets weergeven van: <br><input type="text" name="weergeven" />
<br><input type="submit" value="Tweets ophalen" />
</form>
    <br />
    <a href="?a=uitloggen">Uitloggen</a>
</center>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]

?>
Werkt ook niet cry
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nickjexx schreef:
Eerdere citaten tonen
Thommity schreef:
Je kan ook zo doen toch?
[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]1[/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]"admin"[/COLOR][COLOR= #007700]) {[/COLOR]  
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Wachtwoord klopt niet"[/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]Je bent ingelogd, klik <a href="">hier</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]<div align="right">  
                <form action="" method="post">  
                    <input name="pass" type="password" value="" size="9"><br />  
                    <input type="submit" value="Log in">  
                </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]

?>
<style type="text/css"> 
    body {
        font-family: Verdana;
        font-size: 11px;
    }
    body,td,tr {
        font-size: 11px;
        font-family: Verdana, Arial;
        margin-top:0px;
    }
</style>
<center><form action="------" method="post">
<br><br>Tekst in tweet: <br><textarea style="font-family:Verdana; font-size:11px;" name="tekst" cols="48" rows="10"></textarea>
<br><input type="submit" value="Tweet versturen" />
</form></center>
<center><form action="----" method="post">
<br>Tweets weergeven van: <br><input type="text" name="weergeven" />
<br><input type="submit" value="Tweets ophalen" />
</form>
    <br />
    <a href="?a=uitloggen">Uitloggen</a>
</center>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]

?>

Werkt ook niet cry
Wat krijg je dan..............
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nickjexx schreef:
Eerdere citaten tonen
Thommity schreef:
Je kan ook zo doen toch?
[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]1[/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]"admin"[/COLOR][COLOR= #007700]) {[/COLOR]  
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Wachtwoord klopt niet"[/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]Je bent ingelogd, klik <a href="">hier</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]<div align="right">  
                <form action="" method="post">  
                    <input name="pass" type="password" value="" size="9"><br />  
                    <input type="submit" value="Log in">  
                </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]

?>
<style type="text/css"> 
    body {
        font-family: Verdana;
        font-size: 11px;
    }
    body,td,tr {
        font-size: 11px;
        font-family: Verdana, Arial;
        margin-top:0px;
    }
</style>
<center><form action="------" method="post">
<br><br>Tekst in tweet: <br><textarea style="font-family:Verdana; font-size:11px;" name="tekst" cols="48" rows="10"></textarea>
<br><input type="submit" value="Tweet versturen" />
</form></center>
<center><form action="----" method="post">
<br>Tweets weergeven van: <br><input type="text" name="weergeven" />
<br><input type="submit" value="Tweets ophalen" />
</form>
    <br />
    <a href="?a=uitloggen">Uitloggen</a>
</center>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]

?>

Werkt ook niet cry
Je controleert of hij is ingelogd, en toont dan, indien ingelogd, het form om in te loggen emo
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nou niks? Het uitloggen werkt gewoon niet yummie De sessie blijft... cry
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