3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); //research the use of this session_start(); //needed to create sessions - maintaining state is discussed above. ini_set('display_errors', 1); //turn on errors, use for debugging. $username = $_POST['username']; //refer to the superglobal arrays section above $password = $_POST['password']; $authorized = false; require ('dbconnection.php'); $sql = 'SELECT * from Login'; $rs = $conn->Execute($sql); //Using a While looping structure to check each record in the database while (!$rs->EOF) { if ($rs->Fields["UserName"]->Value=="$username" && $rs->Fields["Password"]->Value=="$password") { $_SESSION['auth'] = $rs->Fields['Auth']->Value; $_SESSION['username'] = $rs->Fields['UserName']->Value; $authorized = true; } $rs->MoveNext(); } # close the connection $rs->Close(); $conn->Close(); $rs = null; $conn = null; if (!$authorized) { header('loginInvalid.php'); // see pseudocode for authorize.php exit(); } else { header('index.php'); exit(); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 22
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 66
Branch analysis from position: 61
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 66
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 28, Position 2 = 34
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 48
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 22
Branch analysis from position: 53
Branch analysis from position: 22
Branch analysis from position: 48
Branch analysis from position: 34
filename:       /in/7X1aS
function name:  (null)
number of ops:  71
compiled vars:  !0 = $username, !1 = $password, !2 = $authorized, !3 = $sql, !4 = $rs, !5 = $conn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'ob_start'
          1        DO_ICALL                                                 
    3     2        INIT_FCALL                                               'session_start'
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'ini_set'
          5        SEND_VAL                                                 'display_errors'
          6        SEND_VAL                                                 1
          7        DO_ICALL                                                 
    6     8        FETCH_R                      global              ~9      '_POST'
          9        FETCH_DIM_R                                      ~10     ~9, 'username'
         10        ASSIGN                                                   !0, ~10
    7    11        FETCH_R                      global              ~12     '_POST'
         12        FETCH_DIM_R                                      ~13     ~12, 'password'
         13        ASSIGN                                                   !1, ~13
    8    14        ASSIGN                                                   !2, <false>
   10    15        INCLUDE_OR_EVAL                                          'dbconnection.php', REQUIRE
   12    16        ASSIGN                                                   !3, 'SELECT+%2A+from+Login'
   14    17        INIT_METHOD_CALL                                         !5, 'Execute'
         18        SEND_VAR_EX                                              !3
         19        DO_FCALL                                      0  $18     
         20        ASSIGN                                                   !4, $18
   18    21      > JMP                                                      ->50
   19    22    >   FETCH_OBJ_R                                      ~20     !4, 'Fields'
         23        FETCH_DIM_R                                      ~21     ~20, 'UserName'
         24        FETCH_OBJ_R                                      ~22     ~21, 'Value'
         25        CAST                                          6  ~23     !0
         26        IS_EQUAL                                         ~24     ~22, ~23
         27      > JMPZ_EX                                          ~24     ~24, ->34
         28    >   FETCH_OBJ_R                                      ~25     !4, 'Fields'
         29        FETCH_DIM_R                                      ~26     ~25, 'Password'
         30        FETCH_OBJ_R                                      ~27     ~26, 'Value'
         31        CAST                                          6  ~28     !1
         32        IS_EQUAL                                         ~29     ~27, ~28
         33        BOOL                                             ~24     ~29
         34    > > JMPZ                                                     ~24, ->48
   20    35    >   FETCH_OBJ_R                                      ~32     !4, 'Fields'
         36        FETCH_DIM_R                                      ~33     ~32, 'Auth'
         37        FETCH_OBJ_R                                      ~34     ~33, 'Value'
         38        FETCH_W                      global              $30     '_SESSION'
         39        ASSIGN_DIM                                               $30, 'auth'
         40        OP_DATA                                                  ~34
   21    41        FETCH_OBJ_R                                      ~37     !4, 'Fields'
         42        FETCH_DIM_R                                      ~38     ~37, 'UserName'
         43        FETCH_OBJ_R                                      ~39     ~38, 'Value'
         44        FETCH_W                      global              $35     '_SESSION'
         45        ASSIGN_DIM                                               $35, 'username'
         46        OP_DATA                                                  ~39
   22    47        ASSIGN                                                   !2, <true>
   24    48    >   INIT_METHOD_CALL                                         !4, 'MoveNext'
         49        DO_FCALL                                      0          
   18    50    >   FETCH_OBJ_R                                      ~42     !4, 'EOF'
         51        BOOL_NOT                                         ~43     ~42
         52      > JMPNZ                                                    ~43, ->22
   27    53    >   INIT_METHOD_CALL                                         !4, 'Close'
         54        DO_FCALL                                      0          
   28    55        INIT_METHOD_CALL                                         !5, 'Close'
         56        DO_FCALL                                      0          
   30    57        ASSIGN                                                   !4, null
   31    58        ASSIGN                                                   !5, null
   33    59        BOOL_NOT                                         ~48     !2
         60      > JMPZ                                                     ~48, ->66
   34    61    >   INIT_FCALL                                               'header'
         62        SEND_VAL                                                 'loginInvalid.php'
         63        DO_ICALL                                                 
   35    64      > EXIT                                                     
         65*       JMP                                                      ->70
   37    66    >   INIT_FCALL                                               'header'
         67        SEND_VAL                                                 'index.php'
         68        DO_ICALL                                                 
   38    69      > EXIT                                                     
   41    70*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.74 ms | 1400 KiB | 21 Q