3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Zugangsdaten $benutzername = 'Otto'; $passwort = 'geheim'; // Session starten session_start(); // Variablen deklarieren $_SESSION['angemeldet'] = false; $fehlermeldung = ''; // Wurde das Formular abgeschickt? if (isset( $_POST['login'] )) { // Maskierende Slashes aus POST Array entfernen if (get_magic_quotes_gpc()) { $_POST = array_map( 'stripslashes', $_POST ); } // Benutzereingabe mit Zugangsdaten vergleichen if (strtolower( $benutzername ) == strtolower( trim( $_POST['benutzer'] )) && $passwort == trim( $_POST['passwort'] )) { // Wenn die Anmeldung korrekt war Session Variable setzen // und auf die geheime Seite weiterleiten $_SESSION['angemeldet'] = true; header( 'location: geheim_einfach.php' ); exit; } else { // Wenn die Anmeldung fehlerhaft war, Fehlermeldung setzen $fehlermeldung = '<h3>Die Anmeldung war fehlerhaft!</h3>'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>phpBuddy.eu - Login Script</title> </head> <body> <?php // Falls die Fehlermeldung gesetzt ist if ($fehlermeldung) echo $fehlermeldung; ?> <form id="loginform" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <label for="benutzer">Benutzer: </label><input type="text" name="benutzer" id="benutzer" value="" /><br /> <label for="passwort">Passwort: </label><input type="password" name="passwort" id="passwort" value="" /><br /> <input type="submit" name="login" id="login" value="Anmelden" /> </form> </body> </html><?php
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 51
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 34, Position 2 = 41
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 50
Branch analysis from position: 42
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 54
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 41
Branch analysis from position: 21
Branch analysis from position: 51
filename:       /in/h6b3v
function name:  (null)
number of ops:  60
compiled vars:  !0 = $benutzername, !1 = $passwort, !2 = $fehlermeldung
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'Otto'
    5     1        ASSIGN                                                   !1, 'geheim'
    8     2        INIT_FCALL                                               'session_start'
          3        DO_ICALL                                                 
   11     4        FETCH_W                      global              $6      '_SESSION'
          5        ASSIGN_DIM                                               $6, 'angemeldet'
          6        OP_DATA                                                  <false>
   12     7        ASSIGN                                                   !2, ''
   15     8        FETCH_IS                                         ~9      '_POST'
          9        ISSET_ISEMPTY_DIM_OBJ                         0          ~9, 'login'
         10      > JMPZ                                                     ~10, ->51
   18    11    >   INIT_FCALL_BY_NAME                                       'get_magic_quotes_gpc'
         12        DO_FCALL                                      0  $11     
         13      > JMPZ                                                     $11, ->21
   20    14    >   INIT_FCALL                                               'array_map'
         15        SEND_VAL                                                 'stripslashes'
         16        FETCH_R                      global              ~13     '_POST'
         17        SEND_VAL                                                 ~13
         18        DO_ICALL                                         $14     
         19        FETCH_W                      global              $12     '_POST'
         20        ASSIGN                                                   $12, $14
   23    21    >   INIT_FCALL                                               'strtolower'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $16     
         24        INIT_FCALL                                               'strtolower'
         25        INIT_FCALL                                               'trim'
         26        FETCH_R                      global              ~17     '_POST'
         27        FETCH_DIM_R                                      ~18     ~17, 'benutzer'
         28        SEND_VAL                                                 ~18
         29        DO_ICALL                                         $19     
         30        SEND_VAR                                                 $19
         31        DO_ICALL                                         $20     
         32        IS_EQUAL                                         ~21     $16, $20
         33      > JMPZ_EX                                          ~21     ~21, ->41
   24    34    >   INIT_FCALL                                               'trim'
         35        FETCH_R                      global              ~22     '_POST'
         36        FETCH_DIM_R                                      ~23     ~22, 'passwort'
         37        SEND_VAL                                                 ~23
         38        DO_ICALL                                         $24     
         39        IS_EQUAL                                         ~25     !1, $24
         40        BOOL                                             ~21     ~25
         41    > > JMPZ                                                     ~21, ->50
   28    42    >   FETCH_W                      global              $26     '_SESSION'
         43        ASSIGN_DIM                                               $26, 'angemeldet'
         44        OP_DATA                                                  <true>
   29    45        INIT_FCALL                                               'header'
         46        SEND_VAL                                                 'location%3A+geheim_einfach.php'
         47        DO_ICALL                                                 
   30    48      > EXIT                                                     
         49*       JMP                                                      ->51
   35    50    >   ASSIGN                                                   !2, '%3Ch3%3EDie+Anmeldung+war+fehlerhaft%21%3C%2Fh3%3E'
   40    51    >   ECHO                                                     '%3C%21DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Transitional%2F%2FEN%22+%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-transitional.dtd%22%3E%0A%3Chtml+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22+xml%3Alang%3D%22de%22+lang%3D%22de%22%3E%0A%3Chead%3E%0A%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3B+charset%3Dutf-8%22+%2F%3E%0A%3Ctitle%3EphpBuddy.eu+-+Login+Script%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%0A%3Cbody%3E%0A%0A'
   51    52      > JMPZ                                                     !2, ->54
         53    >   ECHO                                                     !2
   53    54    >   ECHO                                                     '%0A%3Cform+id%3D%22loginform%22+method%3D%22post%22+action%3D%22'
   54    55        FETCH_R                      global              ~30     '_SERVER'
         56        FETCH_DIM_R                                      ~31     ~30, 'PHP_SELF'
         57        ECHO                                                     ~31
         58        ECHO                                                     '%22%3E%0A++++%3Clabel+for%3D%22benutzer%22%3EBenutzer%3A+%3C%2Flabel%3E%3Cinput+type%3D%22text%22+name%3D%22benutzer%22+id%3D%22benutzer%22+value%3D%22%22+%2F%3E%3Cbr+%2F%3E%0A++++%3Clabel+for%3D%22passwort%22%3EPasswort%3A+%3C%2Flabel%3E%3Cinput+type%3D%22password%22+name%3D%22passwort%22+id%3D%22passwort%22+value%3D%22%22+%2F%3E%3Cbr+%2F%3E%0A++++%3Cinput+type%3D%22submit%22+name%3D%22login%22+id%3D%22login%22+value%3D%22Anmelden%22+%2F%3E%0A%3C%2Fform%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   61    59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.02 ms | 1400 KiB | 23 Q