PHP - Iemand raad?

Gestart doorDigital5 reacties42 weergaven

6 berichten · pagina 1 van 1

Digital

Lid · Topicstarter

Berichten
326
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit is de foutcode.
Spoiler tonen
Notice: Undefined index: name in C:Users*******nerdDesktopWebserver
ootprocessing.php on line 140

Notice: Undefined index: password in C:Users******DesktopWebserver
ootprocessing.php on line 141

Notice: Undefined variable: id in C:Users*****DesktopWebserver
ootprocessing.php on line 142

Notice: Undefined variable: name in C:Users****DesktopWebserver
ootprocessing.php on line 142
Afmelden was een succes
case Logout:
      /*Stop sessie en vernietig het.*/
      session_start();
      session_unset();
      session_destroy();
      mysql_query("UPDATE `users` SET `status`=0 WHERE (`id`=". $_SESSION[id] . ") AND (`name`=". $_SESSION[name] . ")");

      header (refresh: 3; url=index.php);
      echo (Afmelden was een succes);
      break;
0
Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb je config wel Include gedaan.
0
Digital

Lid · Topicstarter

Berichten
326
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja, iets met isset. Wat ik mis? Maar ik raak er niet wijs uit confused
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Eerst doe je session destroy en alles. Vervolgens ga je $_SESSION variabelen gebruiken in je mysql querie. Omdat er geen sessie meer bestaat zijn deze variabelen leeg, en krijg je dus een foutmelding.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
    [COLOR= #007700]case[/COLOR] [COLOR= #DD0000]Logout[/COLOR][COLOR= #007700]:[/COLOR]
      [COLOR= #FF8000]/*Stop sessie en vernietig het.*/[/COLOR]
      [URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
      [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `users` SET `status`=0 WHERE (`id`="[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]") AND (`name`="[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/session_unset"]session_unset[/URL][COLOR= #007700]();[/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]refresh: 3; url=index.php[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]Afmelden was een succes[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/break"]break[/URL][COLOR= #007700];[/COLOR]
?>
0
Digital

Lid · Topicstarter

Berichten
326
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Xjessex schreef:
[COLOR= #0000BB]<?php[/COLOR]
    [COLOR= #007700]case[/COLOR] [COLOR= #DD0000]Logout[/COLOR][COLOR= #007700]:[/COLOR]
      [COLOR= #FF8000]/*Stop sessie en vernietig het.*/[/COLOR]
      [URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
      [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `users` SET `status`=0 WHERE (`id`="[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]") AND (`name`="[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/session_unset"]session_unset[/URL][COLOR= #007700]();[/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]refresh: 3; url=index.php[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]Afmelden was een succes[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/break"]break[/URL][COLOR= #007700];[/COLOR]
?>
Dankje biggrin
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