PC kiezen ipv gebruiker

Gestart doorSanderc8 reacties10 weergaven

9 berichten · pagina 1 van 1

Sanderc

Lid · Topicstarter

Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
De code nu:

if(!$_POST[logout]) {
$count_sessions = mysql_query("SELECT COUNT(*) FROM sessions WHERE userid = ".sqlsafe($_COOKIE[id])." ");
$sessionscounted = mysql_result($count_sessions,0);

if ($sessionscounted == 1) { $browserstring = "browser"; } else { $browserstring = "browsers"; }

echo "<p>Je bent op dit moment ingelogd op <b>".$sessionscounted."</b> ".$browserstring.".<br />Maak een keuze uit een van de volgende opties:</p>";
echo "<form method="POST" action="">";
echo "<input name="logoutmode" type="radio" value="onlythissession">Alleen deze PC.<br />";
echo "<input name="logoutmode" type="radio" value="allsessions">Alle PCs.<br />";
echo "<input name="logoutmode" type="radio" value="choosesession" id="logout_by_session">Kies een sessie:<br />";
echo "<table border="1">";
        ?>
       <tr>
       <td>&nbsp;</td>
       <td>SessID</td>
       <td>Datum / tijd</td>
      </tr>
[COLOR= #0000BB]<?php
$sessioninfo[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessioninfo[/COLOR][COLOR= #007700])){[/COLOR]
?>
      <tr>
       <td><input name="sessionid[]" type="checkbox" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?>" onChange="document.getElementById(logout_by_session).checked = true"></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logintime[/COLOR][COLOR= #007700]];[/COLOR]?></td>
      </tr>
       [COLOR= #0000BB]<?php[/COLOR]
       [COLOR= #007700]}[/COLOR]
       ?>
     </table>
     <input type="submit" name="logout" value="Uitloggen">
     [COLOR= #0000BB]<?php[/COLOR]
     [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</form>"[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"onlythissession"[/COLOR][COLOR= #007700]) {[/COLOR]
               [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je huidige sessie is uitgelogd"[/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]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allsessions"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Al je sessies zijn nu uitgelogd"[/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]"Je sessies zijn niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allothersession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Deze functie werkt nog niet."[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"choosesession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je geselecteerde sessie(s) zijn nu uitgelogd"[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sessionid[/COLOR][COLOR= #007700]] as[/COLOR] [COLOR= #0000BB]$index[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700]) {[/COLOR]
                 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
                       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
                       }
                }


            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je ben vergeten een keuze te maken uit de uitlogopties."[/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]"Deze uitlogoptie is niet bekend."[/COLOR][COLOR= #007700];
            }








   }
}[/COLOR] 
?>


Ik wil dat er staat gewoon een button: Uitloggen en dat de PC kiest voor Alle PCs

Ik heb met dit geprobeerd maar het lukt eniet.



Kan iemand me helpen?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Zou als ik zo zie wel moeten werken.
Hoe implementeer je het?
0
Sanderc

Lid · Topicstarter

Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Euhm, zo;

if(!$_POST[logout]) {
$count_sessions = mysql_query("SELECT COUNT(*) FROM sessions WHERE userid = ".sqlsafe($_COOKIE[id])." ");
$sessionscounted = mysql_result($count_sessions,0);

if ($sessionscounted == 1) { $browserstring = "browser"; } else { $browserstring = "browsers"; }
[COLOR= #0000BB]<?php
$sessioninfo[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessioninfo[/COLOR][COLOR= #007700])){[/COLOR]
?>
      <tr>
       <td><input name="sessionid[]" type="checkbox" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?>" onChange="document.getElementById(logout_by_session).checked = true"></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logintime[/COLOR][COLOR= #007700]];[/COLOR]?></td>
      </tr>
       [COLOR= #0000BB]<?php[/COLOR]
       [COLOR= #007700]}[/COLOR]
       ?>
     </table>
     <input type="hidden" name="logoutmode" value="allsessions" />
     [COLOR= #0000BB]<?php[/COLOR]
     [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</form>"[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"onlythissession"[/COLOR][COLOR= #007700]) {[/COLOR]
               [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je huidige sessie is uitgelogd"[/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]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allsessions"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Al je sessies zijn nu uitgelogd"[/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]"Je sessies zijn niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allothersession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Deze functie werkt nog niet."[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"choosesession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je geselecteerde sessie(s) zijn nu uitgelogd"[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sessionid[/COLOR][COLOR= #007700]] as[/COLOR] [COLOR= #0000BB]$index[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700]) {[/COLOR]
                 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
                       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
                       }
                }


            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je ben vergeten een keuze te maken uit de uitlogopties."[/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]"Deze uitlogoptie is niet bekend."[/COLOR][COLOR= #007700];
            }








   }
}[/COLOR] 
?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
if(!$_POST[logout]) {
$count_sessions = mysql_query("SELECT COUNT(*) FROM sessions WHERE userid = ".sqlsafe($_COOKIE[id])." ");
$sessionscounted = mysql_result($count_sessions,0);

if ($sessionscounted == 1) { $browserstring = "browser"; } else { $browserstring = "browsers"; }
[COLOR= #0000BB]<?php
$sessioninfo[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessioninfo[/COLOR][COLOR= #007700])){[/COLOR]
?>
      <form action="" method="POST">
      <table>
      <tr>
       <td><input name="sessionid[]" type="checkbox" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?>" onChange="document.getElementById(logout_by_session).checked = true"></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logintime[/COLOR][COLOR= #007700]];[/COLOR]?></td>
      </tr>
       [COLOR= #0000BB]<?php[/COLOR]
       [COLOR= #007700]}[/COLOR]
       ?>
     </table>
     <input type="hidden" name="logoutmode" value="allsessions" />
     </form>
     [COLOR= #0000BB]<?php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"onlythissession"[/COLOR][COLOR= #007700]) {[/COLOR]
               [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je huidige sessie is uitgelogd"[/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]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allsessions"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Al je sessies zijn nu uitgelogd"[/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]"Je sessies zijn niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allothersession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Deze functie werkt nog niet."[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"choosesession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je geselecteerde sessie(s) zijn nu uitgelogd"[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sessionid[/COLOR][COLOR= #007700]] as[/COLOR] [COLOR= #0000BB]$index[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700]) {[/COLOR]
                 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
                       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
                       }
                }


            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je ben vergeten een keuze te maken uit de uitlogopties."[/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]"Deze uitlogoptie is niet bekend."[/COLOR][COLOR= #007700];
            }








   }
}[/COLOR] 
?>


toevoeging op 11 april 2012, 08:47:16:
Uitlijning etc. moet je zelf maar doen, de code ziet er niet uit sadley.
En gebruik bijvoorbeeld ook if server[request_method] i.p.v. if post[logout]
0
Sanderc

Lid · Topicstarter

Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan geef hij deze foutcode:

Parse error: syntax error, unexpected < in /home/mrmitchel/domains/mrmitchel.s3.one2xs.com/public_html/uitloggen.php on line 23

DIt is zo:

Lijn 22: if ($sessionscounted == 1) { $browserstring = "browser"; } else { $browserstring = "browsers"; }
Lijn 23:Lijn 24:$sessioninfo = mysql_query("SELECT * FROM sessions WHERE userid = ".sqlsafe($_COOKIE[id])."");

Ik zie de fout niet?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Ik mis een wink
Ik vraag me af of het niet raadzamer is om eerst PHP te leren voordat je hiermee aan de slag gaat?
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zo dus:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logout[/COLOR][COLOR= #007700]]) {[/COLOR]
[COLOR= #0000BB]$count_sessions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(*) FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sessionscounted[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$count_sessions[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessionscounted[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #0000BB]$browserstring[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"browser"[/COLOR][COLOR= #007700]; }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [COLOR= #0000BB]$browserstring[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"browsers"[/COLOR][COLOR= #007700]; }[/COLOR]
?>
[COLOR= #0000BB]<?php
$sessioninfo[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessioninfo[/COLOR][COLOR= #007700])){[/COLOR]
?>
      <form action="" method="POST">
      <table>
      <tr>
       <td><input name="sessionid[]" type="checkbox" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?>" onChange="document.getElementById(logout_by_session).checked = true"></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logintime[/COLOR][COLOR= #007700]];[/COLOR]?></td>
      </tr>
       [COLOR= #0000BB]<?php[/COLOR]
       [COLOR= #007700]}[/COLOR]
       ?>
     </table>
     <input type="hidden" name="logoutmode" value="allsessions" />
     </form>
     [COLOR= #0000BB]<?php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"onlythissession"[/COLOR][COLOR= #007700]) {[/COLOR]
               [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je huidige sessie is uitgelogd"[/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]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allsessions"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Al je sessies zijn nu uitgelogd"[/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]"Je sessies zijn niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allothersession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Deze functie werkt nog niet."[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"choosesession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je geselecteerde sessie(s) zijn nu uitgelogd"[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sessionid[/COLOR][COLOR= #007700]] as[/COLOR] [COLOR= #0000BB]$index[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700]) {[/COLOR]
                 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
                       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
                       }
                }


            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je ben vergeten een keuze te maken uit de uitlogopties."[/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]"Deze uitlogoptie is niet bekend."[/COLOR][COLOR= #007700];
            }








   }
}[/COLOR] 
?>
0
Sanderc

Lid · Topicstarter

Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Iki wil gewoon dat ze op de button Uitloggen moeten klikken en dat ze dan uitloggen op Alle PCs.

EN dat weet ik nie hoe dat moet
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
if(!$_POST[logout]) {
$count_sessions = mysql_query("SELECT COUNT(*) FROM sessions WHERE userid = ".sqlsafe($_COOKIE[id])." ");
$sessionscounted = mysql_result($count_sessions,0);

if ($sessionscounted == 1) { $browserstring = "browser"; } else { $browserstring = "browsers"; }
$sessioninfo = mysql_query("SELECT * FROM sessions WHERE userid = ".sqlsafe($_COOKIE[id])."");
while($sessions = mysql_fetch_assoc($sessioninfo)){
?>
      <form action="" method="POST">
      <table>
      <tr>
       <td><input name="sessionid[]" type="checkbox" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?>" onChange="document.getElementById(logout_by_session).checked = true"></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logintime[/COLOR][COLOR= #007700]];[/COLOR]?></td>
      </tr>
       [COLOR= #0000BB]<?php[/COLOR]
       [COLOR= #007700]}[/COLOR]
       ?>
     </table>
     <input type="hidden" name="logoutmode" value="allsessions" />
     </form>
     [COLOR= #0000BB]<?php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"onlythissession"[/COLOR][COLOR= #007700]) {[/COLOR]
               [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je huidige sessie is uitgelogd"[/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]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allsessions"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Al je sessies zijn nu uitgelogd"[/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]"Je sessies zijn niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
               }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allothersession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Deze functie werkt nog niet."[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"choosesession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je geselecteerde sessie(s) zijn nu uitgelogd"[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sessionid[/COLOR][COLOR= #007700]] as[/COLOR] [COLOR= #0000BB]$index[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700]) {[/COLOR]
                 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
                       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je sessie is niet uitgelogd wegens een fout:<br />"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
                       }
                }


            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je ben vergeten een keuze te maken uit de uitlogopties."[/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]"Deze uitlogoptie is niet bekend."[/COLOR][COLOR= #007700];
            }








   }
}[/COLOR] 
?>


Je kan toch zelf ook wel een beetje kijken..

en dan zeg jij:

Quote:
Lijn 22: if ($sessionscounted == 1) { $browserstring = "browser"; } else { $browserstring = "browsers"; }
Lijn 23:Lijn 24bloossessioninfo = mysql_query("SELECT * FROM sessions WHERE userid = ".sqlsafe($_COOKIE[id])."");

De error is een onverwachte <..
Dan ga je toch kijken waar er op lijn 23 een
Dan zie je dat je op lijn 22 php code gebruikt, en op 23 open je nog een php tag?
Dan heb je dus net zoiets als
$hoi = hoi;
echo $hoi;
?>

Dat klopt niet? Snap je toch zelf ook wel aah
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