3v4l.org

run code in 300+ PHP versions simultaneously
<?php include 'conf.php'; include 'phpScripts/genCode.php'; include 'phpScripts/SxGeo.php'; $SxGeo = new SxGeo('phpScripts/SxGeo.dat', SXGEO_BATCH | SXGEO_MEMORY); $ip = $_SERVER['REMOTE_ADDR']; $country = $SxGeo->getCountry($ip); if(isset($_COOKIE['sid']) && (isset($_COOKIE['ssid']))){ if(!isset($_COOKIE['substitutioncookie'])){header('Location: phpScripts/logincheck.php');} } if(!isset($_COOKIE['lang']) && (isset($_COOKIE['checkcookie']))){setcookie('lang', 1); header('Location: index.php');} if(isset($_COOKIE['lang'])){ if($_COOKIE['lang'] == 1){ include 'localizations/en_US.php'; }elseif($_COOKIE['lang'] == 2){ include 'localizations/ru_RU.php'; }elseif($_COOKIE['lang'] == 3){ include 'localizations/de_DE.php'; } } if(!isset($_COOKIE['checkcookie'])){ include 'localizations/en_US.php'; } if (isset($_POST['log_in'])) { $login_query = mysqli_query($link, "SELECT email, password, id, folder FROM users WHERE email='".mysqli_real_escape_string($link, $_POST['email'])."' LIMIT 1"); $login_result = mysqli_fetch_assoc($login_query); if ($login_result['password'] === md5(sha1(md5($_POST['password'])).sha1($_POST['password']))) { $_SESSION['user_id'] = $login_result['id']; $hash = md5(generateCode(10)); $id = $login_result['id']; $time = ""; $browser = user_browser($agent); $password = md5(sha1(md5($_POST['password'])).sha1($_POST['password'])); mysqli_query($link, "INSERT INTO sessions SET id='".$id."', browser='".$browser."', sid='".$hash."', country='".$country."'"); setcookie("sid", $hash, time() + 60 * 60 * 24 * 365); setcookie("ssid", $password, time() + 60 * 60 * 24 * 365); if ($login_result['folder'] == 0) { mkdir("images/photos/u".$data['id'].""); mysqli_query($link, "UPDATE users SET folder=1 WHERE email='" . $data['email'] . "'"); } header("Location: loginScript.php"); } else { $err = "<div class='card-panel card-in-card red' style='margin-bottom: 40px;'><center><h5 style=\"font-size: 22px; padding-left: 0px;\" class=\"light white-text text-darken-3 offset-l3\">".$l['incorrect']."</div>"; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 39
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 47
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 67
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 72
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 201
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 113, Position 2 = 197
Branch analysis from position: 113
2 jumps found. (Code = 43) Position 1 = 180, Position 2 = 193
Branch analysis from position: 180
1 jumps found. (Code = 42) Position 1 = 201
Branch analysis from position: 201
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 193
Branch analysis from position: 197
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 201
Branch analysis from position: 72
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 67
Branch analysis from position: 66
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 72
Branch analysis from position: 71
Branch analysis from position: 72
Branch analysis from position: 67
Branch analysis from position: 67
Branch analysis from position: 47
Branch analysis from position: 39
Branch analysis from position: 32
Branch analysis from position: 32
Branch analysis from position: 24
filename:       /in/gic17
function name:  (null)
number of ops:  202
compiled vars:  !0 = $SxGeo, !1 = $ip, !2 = $country, !3 = $login_query, !4 = $link, !5 = $login_result, !6 = $hash, !7 = $id, !8 = $time, !9 = $browser, !10 = $agent, !11 = $password, !12 = $data, !13 = $err, !14 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'conf.php', INCLUDE
    3     1        INCLUDE_OR_EVAL                                          'phpScripts%2FgenCode.php', INCLUDE
    4     2        INCLUDE_OR_EVAL                                          'phpScripts%2FSxGeo.php', INCLUDE
    5     3        NEW                                              $18     'SxGeo'
          4        SEND_VAL_EX                                              'phpScripts%2FSxGeo.dat'
          5        FETCH_CONSTANT                                   ~19     'SXGEO_BATCH'
          6        FETCH_CONSTANT                                   ~20     'SXGEO_MEMORY'
          7        BW_OR                                            ~21     ~19, ~20
          8        SEND_VAL_EX                                              ~21
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !0, $18
    6    11        FETCH_R                      global              ~24     '_SERVER'
         12        FETCH_DIM_R                                      ~25     ~24, 'REMOTE_ADDR'
         13        ASSIGN                                                   !1, ~25
    7    14        INIT_METHOD_CALL                                         !0, 'getCountry'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0  $27     
         17        ASSIGN                                                   !2, $27
    8    18        FETCH_IS                                         ~29     '_COOKIE'
         19        ISSET_ISEMPTY_DIM_OBJ                         0  ~30     ~29, 'sid'
         20      > JMPZ_EX                                          ~30     ~30, ->24
         21    >   FETCH_IS                                         ~31     '_COOKIE'
         22        ISSET_ISEMPTY_DIM_OBJ                         0  ~32     ~31, 'ssid'
         23        BOOL                                             ~30     ~32
         24    > > JMPZ                                                     ~30, ->32
    9    25    >   FETCH_IS                                         ~33     '_COOKIE'
         26        ISSET_ISEMPTY_DIM_OBJ                         0  ~34     ~33, 'substitutioncookie'
         27        BOOL_NOT                                         ~35     ~34
         28      > JMPZ                                                     ~35, ->32
         29    >   INIT_FCALL                                               'header'
         30        SEND_VAL                                                 'Location%3A+phpScripts%2Flogincheck.php'
         31        DO_ICALL                                                 
   11    32    >   FETCH_IS                                         ~37     '_COOKIE'
         33        ISSET_ISEMPTY_DIM_OBJ                         0  ~38     ~37, 'lang'
         34        BOOL_NOT                                         ~39     ~38
         35      > JMPZ_EX                                          ~39     ~39, ->39
         36    >   FETCH_IS                                         ~40     '_COOKIE'
         37        ISSET_ISEMPTY_DIM_OBJ                         0  ~41     ~40, 'checkcookie'
         38        BOOL                                             ~39     ~41
         39    > > JMPZ                                                     ~39, ->47
         40    >   INIT_FCALL                                               'setcookie'
         41        SEND_VAL                                                 'lang'
         42        SEND_VAL                                                 1
         43        DO_ICALL                                                 
         44        INIT_FCALL                                               'header'
         45        SEND_VAL                                                 'Location%3A+index.php'
         46        DO_ICALL                                                 
   12    47    >   FETCH_IS                                         ~44     '_COOKIE'
         48        ISSET_ISEMPTY_DIM_OBJ                         0          ~44, 'lang'
         49      > JMPZ                                                     ~45, ->67
   13    50    >   FETCH_R                      global              ~46     '_COOKIE'
         51        FETCH_DIM_R                                      ~47     ~46, 'lang'
         52        IS_EQUAL                                                 ~47, 1
         53      > JMPZ                                                     ~48, ->56
   14    54    >   INCLUDE_OR_EVAL                                          'localizations%2Fen_US.php', INCLUDE
         55      > JMP                                                      ->67
   15    56    >   FETCH_R                      global              ~50     '_COOKIE'
         57        FETCH_DIM_R                                      ~51     ~50, 'lang'
         58        IS_EQUAL                                                 ~51, 2
         59      > JMPZ                                                     ~52, ->62
   16    60    >   INCLUDE_OR_EVAL                                          'localizations%2Fru_RU.php', INCLUDE
         61      > JMP                                                      ->67
   17    62    >   FETCH_R                      global              ~54     '_COOKIE'
         63        FETCH_DIM_R                                      ~55     ~54, 'lang'
         64        IS_EQUAL                                                 ~55, 3
         65      > JMPZ                                                     ~56, ->67
   18    66    >   INCLUDE_OR_EVAL                                          'localizations%2Fde_DE.php', INCLUDE
   21    67    >   FETCH_IS                                         ~58     '_COOKIE'
         68        ISSET_ISEMPTY_DIM_OBJ                         0  ~59     ~58, 'checkcookie'
         69        BOOL_NOT                                         ~60     ~59
         70      > JMPZ                                                     ~60, ->72
   22    71    >   INCLUDE_OR_EVAL                                          'localizations%2Fen_US.php', INCLUDE
   24    72    >   FETCH_IS                                         ~62     '_POST'
         73        ISSET_ISEMPTY_DIM_OBJ                         0          ~62, 'log_in'
         74      > JMPZ                                                     ~63, ->201
   25    75    >   INIT_FCALL_BY_NAME                                       'mysqli_query'
         76        SEND_VAR_EX                                              !4
         77        INIT_FCALL_BY_NAME                                       'mysqli_real_escape_string'
         78        SEND_VAR_EX                                              !4
         79        CHECK_FUNC_ARG                                           
         80        FETCH_FUNC_ARG               global              $64     '_POST'
         81        FETCH_DIM_FUNC_ARG                               $65     $64, 'email'
         82        SEND_FUNC_ARG                                            $65
         83        DO_FCALL                                      0  $66     
         84        CONCAT                                           ~67     'SELECT+email%2C+password%2C+id%2C+folder+FROM+users+WHERE+email%3D%27', $66
         85        CONCAT                                           ~68     ~67, '%27+LIMIT+1'
         86        SEND_VAL_EX                                              ~68
         87        DO_FCALL                                      0  $69     
         88        ASSIGN                                                   !3, $69
   26    89        INIT_FCALL_BY_NAME                                       'mysqli_fetch_assoc'
         90        SEND_VAR_EX                                              !3
         91        DO_FCALL                                      0  $71     
         92        ASSIGN                                                   !5, $71
   27    93        FETCH_DIM_R                                      ~73     !5, 'password'
         94        INIT_FCALL                                               'md5'
         95        INIT_FCALL                                               'sha1'
         96        INIT_FCALL                                               'md5'
         97        FETCH_R                      global              ~74     '_POST'
         98        FETCH_DIM_R                                      ~75     ~74, 'password'
         99        SEND_VAL                                                 ~75
        100        DO_ICALL                                         $76     
        101        SEND_VAR                                                 $76
        102        DO_ICALL                                         $77     
        103        INIT_FCALL                                               'sha1'
        104        FETCH_R                      global              ~78     '_POST'
        105        FETCH_DIM_R                                      ~79     ~78, 'password'
        106        SEND_VAL                                                 ~79
        107        DO_ICALL                                         $80     
        108        CONCAT                                           ~81     $77, $80
        109        SEND_VAL                                                 ~81
        110        DO_ICALL                                         $82     
        111        IS_IDENTICAL                                             $82, ~73
        112      > JMPZ                                                     ~83, ->197
   28   113    >   FETCH_DIM_R                                      ~86     !5, 'id'
        114        FETCH_W                      global              $84     '_SESSION'
        115        ASSIGN_DIM                                               $84, 'user_id'
        116        OP_DATA                                                  ~86
   29   117        INIT_FCALL                                               'md5'
        118        INIT_FCALL_BY_NAME                                       'generateCode'
        119        SEND_VAL_EX                                              10
        120        DO_FCALL                                      0  $87     
        121        SEND_VAR                                                 $87
        122        DO_ICALL                                         $88     
        123        ASSIGN                                                   !6, $88
   30   124        FETCH_DIM_R                                      ~90     !5, 'id'
        125        ASSIGN                                                   !7, ~90
   31   126        ASSIGN                                                   !8, ''
   32   127        INIT_FCALL_BY_NAME                                       'user_browser'
        128        SEND_VAR_EX                                              !10
        129        DO_FCALL                                      0  $93     
        130        ASSIGN                                                   !9, $93
   33   131        INIT_FCALL                                               'md5'
        132        INIT_FCALL                                               'sha1'
        133        INIT_FCALL                                               'md5'
        134        FETCH_R                      global              ~95     '_POST'
        135        FETCH_DIM_R                                      ~96     ~95, 'password'
        136        SEND_VAL                                                 ~96
        137        DO_ICALL                                         $97     
        138        SEND_VAR                                                 $97
        139        DO_ICALL                                         $98     
        140        INIT_FCALL                                               'sha1'
        141        FETCH_R                      global              ~99     '_POST'
        142        FETCH_DIM_R                                      ~100    ~99, 'password'
        143        SEND_VAL                                                 ~100
        144        DO_ICALL                                         $101    
        145        CONCAT                                           ~102    $98, $101
        146        SEND_VAL                                                 ~102
        147        DO_ICALL                                         $103    
        148        ASSIGN                                                   !11, $103
   34   149        INIT_FCALL_BY_NAME                                       'mysqli_query'
        150        SEND_VAR_EX                                              !4
        151        CONCAT                                           ~105    'INSERT+INTO+sessions+SET+id%3D%27', !7
        152        CONCAT                                           ~106    ~105, '%27%2C+browser%3D%27'
        153        CONCAT                                           ~107    ~106, !9
        154        CONCAT                                           ~108    ~107, '%27%2C+sid%3D%27'
        155        CONCAT                                           ~109    ~108, !6
        156        CONCAT                                           ~110    ~109, '%27%2C+country%3D%27'
        157        CONCAT                                           ~111    ~110, !2
        158        CONCAT                                           ~112    ~111, '%27'
        159        SEND_VAL_EX                                              ~112
        160        DO_FCALL                                      0          
   35   161        INIT_FCALL                                               'setcookie'
        162        SEND_VAL                                                 'sid'
        163        SEND_VAR                                                 !6
        164        INIT_FCALL                                               'time'
        165        DO_ICALL                                         $114    
        166        ADD                                              ~115    $114, 31536000
        167        SEND_VAL                                                 ~115
        168        DO_ICALL                                                 
   36   169        INIT_FCALL                                               'setcookie'
        170        SEND_VAL                                                 'ssid'
        171        SEND_VAR                                                 !11
        172        INIT_FCALL                                               'time'
        173        DO_ICALL                                         $117    
        174        ADD                                              ~118    $117, 31536000
        175        SEND_VAL                                                 ~118
        176        DO_ICALL                                                 
   37   177        FETCH_DIM_R                                      ~120    !5, 'folder'
        178        IS_EQUAL                                                 ~120, 0
        179      > JMPZ                                                     ~121, ->193
   38   180    >   INIT_FCALL                                               'mkdir'
        181        FETCH_DIM_R                                      ~122    !12, 'id'
        182        CONCAT                                           ~123    'images%2Fphotos%2Fu', ~122
        183        CONCAT                                           ~124    ~123, ''
        184        SEND_VAL                                                 ~124
        185        DO_ICALL                                                 
   39   186        INIT_FCALL_BY_NAME                                       'mysqli_query'
        187        SEND_VAR_EX                                              !4
        188        FETCH_DIM_R                                      ~126    !12, 'email'
        189        CONCAT                                           ~127    'UPDATE+users+SET+folder%3D1+WHERE+email%3D%27', ~126
        190        CONCAT                                           ~128    ~127, '%27'
        191        SEND_VAL_EX                                              ~128
        192        DO_FCALL                                      0          
   41   193    >   INIT_FCALL                                               'header'
        194        SEND_VAL                                                 'Location%3A+loginScript.php'
        195        DO_ICALL                                                 
        196      > JMP                                                      ->201
   47   197    >   FETCH_DIM_R                                      ~131    !14, 'incorrect'
        198        CONCAT                                           ~132    '%3Cdiv+class%3D%27card-panel+card-in-card+red%27+style%3D%27margin-bottom%3A+40px%3B%27%3E%3Ccenter%3E%3Ch5+style%3D%22font-size%3A+22px%3B+padding-left%3A+0px%3B%22+class%3D%22light+white-text+text-darken-3+offset-l3%22%3E', ~131
        199        CONCAT                                           ~133    ~132, '%3C%2Fdiv%3E'
        200        ASSIGN                                                   !13, ~133
   52   201    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.5 ms | 1412 KiB | 25 Q