3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); //db include_once('db.php'); $user_email = $_SESSION['email']; $resultuid = mysql_query("SELECT `id` FROM `tbluser` WHERE `email` = '$user_email'") or die(mysql_error()); $row_id = mysql_fetch_assoc($resultuid); $user_id = $row_id['id']; // id of the user if(isset($_POST['delete_user']) && !empty($_POST['delete_user'])) { $gid = $_POST['gid']; $query4admin = mysql_query("SELECT * FROM groups WHERE id = '$gid' AND admin = '$user_id' AND active = '1'"); $admin = mysql_num_rows($query4admin); if($admin==1){ $delete_user = mysql_real_escape_string($_POST['delete_user']); mysql_query("UPDATE groupmembers SET flag = '0' WHERE `member`='$delete_user' AND `id`='$gid'") or die("Error occured!"); header('Location: /groups/?id='.$gid.'&msg=The user has been kicked out or deleted from the group!'); } else { echo "<b>You are not admin of this group</b> or this group is a deleted/suspended one!"; } } elseif(isset($_POST['group']) && !empty($$_POST['group'])) { $gid = mysql_real_escape_string($_POST['group']); $query4admin = mysql_query("SELECT * FROM groups WHERE id = '$gid' AND admin = '$user_id' AND active = '1'"); $admin = mysql_num_rows($query4admin); if($admin==1){ mysql_query("UPDATE groups SET active = '0' WHERE `id`='$gid' AND `admin`='$user_id'") or die("Error occured!"); header('Location: /groups/?msg=You group has been deleted!'); } else { echo "<b>You are not admin of this group</b> or this group is already deleted!"; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 76
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 74
Branch analysis from position: 50
2 jumps found. (Code = 47) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
Branch analysis from position: 76
2 jumps found. (Code = 46) Position 1 = 79, Position 2 = 84
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 123
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 107, Position 2 = 122
Branch analysis from position: 107
2 jumps found. (Code = 47) Position 1 = 116, Position 2 = 118
Branch analysis from position: 116
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 118
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
Branch analysis from position: 122
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 123
Branch analysis from position: 84
Branch analysis from position: 31
filename:       /in/VYlYj
function name:  (null)
number of ops:  124
compiled vars:  !0 = $user_email, !1 = $resultuid, !2 = $row_id, !3 = $user_id, !4 = $gid, !5 = $query4admin, !6 = $admin, !7 = $delete_user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    4     2        INCLUDE_OR_EVAL                                          'db.php', INCLUDE_ONCE
    6     3        FETCH_R                      global              ~10     '_SESSION'
          4        FETCH_DIM_R                                      ~11     ~10, 'email'
          5        ASSIGN                                                   !0, ~11
    8     6        INIT_FCALL_BY_NAME                                       'mysql_query'
          7        ROPE_INIT                                     3  ~14     'SELECT+%60id%60+FROM+%60tbluser%60+WHERE+%60email%60+%3D+%27'
          8        ROPE_ADD                                      1  ~14     ~14, !0
          9        ROPE_END                                      2  ~13     ~14, '%27'
         10        SEND_VAL_EX                                              ~13
         11        DO_FCALL                                      0  $16     
         12        ASSIGN                                           ~17     !1, $16
         13      > JMPNZ_EX                                         ~17     ~17, ->18
         14    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         15        DO_FCALL                                      0  $18     
         16      > EXIT                                                     $18
         17*       BOOL                                             ~17     <true>
   10    18    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_assoc'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $19     
         21        ASSIGN                                                   !2, $19
   12    22        FETCH_DIM_R                                      ~21     !2, 'id'
         23        ASSIGN                                                   !3, ~21
   14    24        FETCH_IS                                         ~23     '_POST'
         25        ISSET_ISEMPTY_DIM_OBJ                         0  ~24     ~23, 'delete_user'
         26      > JMPZ_EX                                          ~24     ~24, ->31
         27    >   FETCH_IS                                         ~25     '_POST'
         28        ISSET_ISEMPTY_DIM_OBJ                         1  ~26     ~25, 'delete_user'
         29        BOOL_NOT                                         ~27     ~26
         30        BOOL                                             ~24     ~27
         31    > > JMPZ                                                     ~24, ->76
   15    32    >   FETCH_R                      global              ~28     '_POST'
         33        FETCH_DIM_R                                      ~29     ~28, 'gid'
         34        ASSIGN                                                   !4, ~29
   16    35        INIT_FCALL_BY_NAME                                       'mysql_query'
         36        ROPE_INIT                                     5  ~32     'SELECT+%2A+FROM+groups+WHERE+id+%3D+%27'
         37        ROPE_ADD                                      1  ~32     ~32, !4
         38        ROPE_ADD                                      2  ~32     ~32, '%27+AND+admin+%3D+%27'
         39        ROPE_ADD                                      3  ~32     ~32, !3
         40        ROPE_END                                      4  ~31     ~32, '%27+AND+active+%3D+%271%27'
         41        SEND_VAL_EX                                              ~31
         42        DO_FCALL                                      0  $35     
         43        ASSIGN                                                   !5, $35
   17    44        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         45        SEND_VAR_EX                                              !5
         46        DO_FCALL                                      0  $37     
         47        ASSIGN                                                   !6, $37
   18    48        IS_EQUAL                                                 !6, 1
         49      > JMPZ                                                     ~39, ->74
   19    50    >   INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         51        CHECK_FUNC_ARG                                           
         52        FETCH_FUNC_ARG               global              $40     '_POST'
         53        FETCH_DIM_FUNC_ARG                               $41     $40, 'delete_user'
         54        SEND_FUNC_ARG                                            $41
         55        DO_FCALL                                      0  $42     
         56        ASSIGN                                                   !7, $42
   20    57        INIT_FCALL_BY_NAME                                       'mysql_query'
         58        ROPE_INIT                                     5  ~45     'UPDATE+groupmembers+SET+flag+%3D+%270%27+WHERE+%60member%60%3D%27'
         59        ROPE_ADD                                      1  ~45     ~45, !7
         60        ROPE_ADD                                      2  ~45     ~45, '%27+AND+%60id%60%3D%27'
         61        ROPE_ADD                                      3  ~45     ~45, !4
         62        ROPE_END                                      4  ~44     ~45, '%27'
         63        SEND_VAL_EX                                              ~44
         64        DO_FCALL                                      0  $48     
         65      > JMPNZ_EX                                         ~49     $48, ->68
         66    > > EXIT                                                     'Error+occured%21'
         67*       BOOL                                             ~49     <true>
   21    68    >   INIT_FCALL                                               'header'
         69        CONCAT                                           ~50     'Location%3A+%2Fgroups%2F%3Fid%3D', !4
         70        CONCAT                                           ~51     ~50, '%26msg%3DThe+user+has+been+kicked+out+or+deleted+from+the+group%21'
         71        SEND_VAL                                                 ~51
         72        DO_ICALL                                                 
         73      > JMP                                                      ->75
   23    74    >   ECHO                                                     '%3Cb%3EYou+are+not+admin+of+this+group%3C%2Fb%3E+or+this+group+is+a+deleted%2Fsuspended+one%21'
         75    > > JMP                                                      ->123
   25    76    >   FETCH_IS                                         ~53     '_POST'
         77        ISSET_ISEMPTY_DIM_OBJ                         0  ~54     ~53, 'group'
         78      > JMPZ_EX                                          ~54     ~54, ->84
         79    >   FETCH_R                      global              ~55     '_POST'
         80        FETCH_IS                                         ~56     ~55
         81        ISSET_ISEMPTY_DIM_OBJ                         1  ~57     ~56, 'group'
         82        BOOL_NOT                                         ~58     ~57
         83        BOOL                                             ~54     ~58
         84    > > JMPZ                                                     ~54, ->123
   27    85    >   INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         86        CHECK_FUNC_ARG                                           
         87        FETCH_FUNC_ARG               global              $59     '_POST'
         88        FETCH_DIM_FUNC_ARG                               $60     $59, 'group'
         89        SEND_FUNC_ARG                                            $60
         90        DO_FCALL                                      0  $61     
         91        ASSIGN                                                   !4, $61
   28    92        INIT_FCALL_BY_NAME                                       'mysql_query'
         93        ROPE_INIT                                     5  ~64     'SELECT+%2A+FROM+groups+WHERE+id+%3D+%27'
         94        ROPE_ADD                                      1  ~64     ~64, !4
         95        ROPE_ADD                                      2  ~64     ~64, '%27+AND+admin+%3D+%27'
         96        ROPE_ADD                                      3  ~64     ~64, !3
         97        ROPE_END                                      4  ~63     ~64, '%27+AND+active+%3D+%271%27'
         98        SEND_VAL_EX                                              ~63
         99        DO_FCALL                                      0  $67     
        100        ASSIGN                                                   !5, $67
   29   101        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
        102        SEND_VAR_EX                                              !5
        103        DO_FCALL                                      0  $69     
        104        ASSIGN                                                   !6, $69
   30   105        IS_EQUAL                                                 !6, 1
        106      > JMPZ                                                     ~71, ->122
   31   107    >   INIT_FCALL_BY_NAME                                       'mysql_query'
        108        ROPE_INIT                                     5  ~73     'UPDATE+groups+SET+active+%3D+%270%27+WHERE+%60id%60%3D%27'
        109        ROPE_ADD                                      1  ~73     ~73, !4
        110        ROPE_ADD                                      2  ~73     ~73, '%27+AND+%60admin%60%3D%27'
        111        ROPE_ADD                                      3  ~73     ~73, !3
        112        ROPE_END                                      4  ~72     ~73, '%27'
        113        SEND_VAL_EX                                              ~72
        114        DO_FCALL                                      0  $76     
        115      > JMPNZ_EX                                         ~77     $76, ->118
        116    > > EXIT                                                     'Error+occured%21'
        117*       BOOL                                             ~77     <true>
   32   118    >   INIT_FCALL                                               'header'
        119        SEND_VAL                                                 'Location%3A+%2Fgroups%2F%3Fmsg%3DYou+group+has+been+deleted%21'
        120        DO_ICALL                                                 
        121      > JMP                                                      ->123
   34   122    >   ECHO                                                     '%3Cb%3EYou+are+not+admin+of+this+group%3C%2Fb%3E+or+this+group+is+already+deleted%21'
   43   123    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.06 ms | 1400 KiB | 17 Q