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['comment'])){ $gid=$_GET['gid']; $comment=$_POST['comment']; $msg_id=$_POST['msg_id']; $ip=$_SERVER['REMOTE_ADDR']; $comment=htmlentities($comment); $time=time(); $ip=$_SERVER['REMOTE_ADDR']; $query = mysql_query("SELECT id,comment FROM `group_comments` WHERE uid='$user_id' and msg_id='$msg_id' order by id desc limit 1 ") or die(mysql_error()); $result = mysql_fetch_array($query); if ($comment!=$result['comment']) { $query = mysql_query("INSERT INTO `group_comments` (comment, uid, msg_id, created) VALUES ('$comment', '$uid','$msg_id', '$time')") or die(mysql_error()); $newquery = mysql_query("SELECT id, uid, comment, msg_id, created FROM group_comments WHERE uid='$user_id' AND msg_id='$msg_id' order by id desc limit 1 "); $result = mysql_fetch_array($newquery); $com_id=result['id']; $comment=tolink(htmlentities($result['comment'] )); $time=$result['created']; $uid=$result['uid']; $uinf = mysql_query("SELECT * FROM `tbluser` WHERE `id` = '$uid'") or die(mysql_error()); $row_user = mysql_fetch_array($uinf); $fullname = $row_user['fname'].' '.$row_user['lname']; // full name of user $user_photo = $row_user['photo']; $user_photo="http://nitofa.com/user_pics/users/$user_photo"; header("Location: /groups/?id=".$gid."&msg=Comment posted!#stcommentbody".$com_id); ?> <div class="stcommentbody" id="stcommentbody<?php echo $com_id; ?>"> <div class="stcommentimg"> <img src="<?php echo $user_photo; ?>" class='small_face'/> </div> <div class="stcommenttext"> <!-- <a class="stcommentdelete" href="#" id='<?php echo $com_id; ?>'>X</a> --> <b><a href="<?php echo 'http://nitofa.com/browse-user.php?fid='.$uid;?>"><?php echo $fullname; ?></a></b> <?php echo $comment; ?> <div class="stcommenttime"><?php time_stamp($time); ?></div> </div> </div> <?php } } ?>
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 = 43) Position 1 = 27, Position 2 = 166
Branch analysis from position: 27
2 jumps found. (Code = 47) Position 1 = 59, Position 2 = 63
Branch analysis from position: 59
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 166
Branch analysis from position: 70
2 jumps found. (Code = 47) Position 1 = 84, Position 2 = 88
Branch analysis from position: 84
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 88
2 jumps found. (Code = 47) Position 1 = 124, Position 2 = 128
Branch analysis from position: 124
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 128
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 166
Branch analysis from position: 166
filename:       /in/WcpaI
function name:  (null)
number of ops:  167
compiled vars:  !0 = $user_email, !1 = $resultuid, !2 = $row_id, !3 = $user_id, !4 = $gid, !5 = $comment, !6 = $msg_id, !7 = $ip, !8 = $time, !9 = $query, !10 = $result, !11 = $uid, !12 = $newquery, !13 = $com_id, !14 = $uinf, !15 = $row_user, !16 = $fullname, !17 = $user_photo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    5     2        INCLUDE_OR_EVAL                                          'db.php', INCLUDE_ONCE
    7     3        FETCH_R                      global              ~20     '_SESSION'
          4        FETCH_DIM_R                                      ~21     ~20, 'email'
          5        ASSIGN                                                   !0, ~21
    9     6        INIT_FCALL_BY_NAME                                       'mysql_query'
          7        ROPE_INIT                                     3  ~24     'SELECT+%60id%60+FROM+%60tbluser%60+WHERE+%60email%60+%3D+%27'
          8        ROPE_ADD                                      1  ~24     ~24, !0
          9        ROPE_END                                      2  ~23     ~24, '%27'
         10        SEND_VAL_EX                                              ~23
         11        DO_FCALL                                      0  $26     
         12        ASSIGN                                           ~27     !1, $26
         13      > JMPNZ_EX                                         ~27     ~27, ->18
         14    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         15        DO_FCALL                                      0  $28     
         16      > EXIT                                                     $28
         17*       BOOL                                             ~27     <true>
   11    18    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_assoc'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $29     
         21        ASSIGN                                                   !2, $29
   13    22        FETCH_DIM_R                                      ~31     !2, 'id'
         23        ASSIGN                                                   !3, ~31
   16    24        FETCH_IS                                         ~33     '_POST'
         25        ISSET_ISEMPTY_DIM_OBJ                         0          ~33, 'comment'
         26      > JMPZ                                                     ~34, ->166
   17    27    >   FETCH_R                      global              ~35     '_GET'
         28        FETCH_DIM_R                                      ~36     ~35, 'gid'
         29        ASSIGN                                                   !4, ~36
   18    30        FETCH_R                      global              ~38     '_POST'
         31        FETCH_DIM_R                                      ~39     ~38, 'comment'
         32        ASSIGN                                                   !5, ~39
   19    33        FETCH_R                      global              ~41     '_POST'
         34        FETCH_DIM_R                                      ~42     ~41, 'msg_id'
         35        ASSIGN                                                   !6, ~42
   20    36        FETCH_R                      global              ~44     '_SERVER'
         37        FETCH_DIM_R                                      ~45     ~44, 'REMOTE_ADDR'
         38        ASSIGN                                                   !7, ~45
   21    39        INIT_FCALL                                               'htmlentities'
         40        SEND_VAR                                                 !5
         41        DO_ICALL                                         $47     
         42        ASSIGN                                                   !5, $47
   22    43        INIT_FCALL                                               'time'
         44        DO_ICALL                                         $49     
         45        ASSIGN                                                   !8, $49
   23    46        FETCH_R                      global              ~51     '_SERVER'
         47        FETCH_DIM_R                                      ~52     ~51, 'REMOTE_ADDR'
         48        ASSIGN                                                   !7, ~52
   24    49        INIT_FCALL_BY_NAME                                       'mysql_query'
         50        ROPE_INIT                                     5  ~55     'SELECT+id%2Ccomment+FROM+%60group_comments%60+WHERE+uid%3D%27'
         51        ROPE_ADD                                      1  ~55     ~55, !3
         52        ROPE_ADD                                      2  ~55     ~55, '%27+and+msg_id%3D%27'
         53        ROPE_ADD                                      3  ~55     ~55, !6
         54        ROPE_END                                      4  ~54     ~55, '%27+order+by+id+desc+limit+1+'
         55        SEND_VAL_EX                                              ~54
         56        DO_FCALL                                      0  $58     
         57        ASSIGN                                           ~59     !9, $58
         58      > JMPNZ_EX                                         ~59     ~59, ->63
         59    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         60        DO_FCALL                                      0  $60     
         61      > EXIT                                                     $60
         62*       BOOL                                             ~59     <true>
   25    63    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         64        SEND_VAR_EX                                              !9
         65        DO_FCALL                                      0  $61     
         66        ASSIGN                                                   !10, $61
   27    67        FETCH_DIM_R                                      ~63     !10, 'comment'
         68        IS_NOT_EQUAL                                             !5, ~63
         69      > JMPZ                                                     ~64, ->166
   28    70    >   INIT_FCALL_BY_NAME                                       'mysql_query'
         71        ROPE_INIT                                     9  ~66     'INSERT+INTO+%60group_comments%60+%28comment%2C+uid%2C+msg_id%2C+created%29+VALUES+%28%27'
         72        ROPE_ADD                                      1  ~66     ~66, !5
         73        ROPE_ADD                                      2  ~66     ~66, '%27%2C+%27'
         74        ROPE_ADD                                      3  ~66     ~66, !11
         75        ROPE_ADD                                      4  ~66     ~66, '%27%2C%27'
         76        ROPE_ADD                                      5  ~66     ~66, !6
         77        ROPE_ADD                                      6  ~66     ~66, '%27%2C+%27'
         78        ROPE_ADD                                      7  ~66     ~66, !8
         79        ROPE_END                                      8  ~65     ~66, '%27%29'
         80        SEND_VAL_EX                                              ~65
         81        DO_FCALL                                      0  $71     
         82        ASSIGN                                           ~72     !9, $71
         83      > JMPNZ_EX                                         ~72     ~72, ->88
         84    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         85        DO_FCALL                                      0  $73     
         86      > EXIT                                                     $73
         87*       BOOL                                             ~72     <true>
   29    88    >   INIT_FCALL_BY_NAME                                       'mysql_query'
         89        ROPE_INIT                                     5  ~75     'SELECT+id%2C+uid%2C+comment%2C+msg_id%2C+created+FROM+group_comments+WHERE+uid%3D%27'
         90        ROPE_ADD                                      1  ~75     ~75, !3
         91        ROPE_ADD                                      2  ~75     ~75, '%27+AND+msg_id%3D%27'
         92        ROPE_ADD                                      3  ~75     ~75, !6
         93        ROPE_END                                      4  ~74     ~75, '%27+order+by+id+desc+limit+1+'
         94        SEND_VAL_EX                                              ~74
         95        DO_FCALL                                      0  $78     
         96        ASSIGN                                                   !12, $78
   30    97        INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         98        SEND_VAR_EX                                              !12
         99        DO_FCALL                                      0  $80     
        100        ASSIGN                                                   !10, $80
   32   101        FETCH_CONSTANT                                   ~82     'result'
        102        FETCH_DIM_R                                      ~83     ~82, 'id'
        103        ASSIGN                                                   !13, ~83
   33   104        INIT_FCALL_BY_NAME                                       'tolink'
        105        INIT_FCALL                                               'htmlentities'
        106        FETCH_DIM_R                                      ~85     !10, 'comment'
        107        SEND_VAL                                                 ~85
        108        DO_ICALL                                         $86     
        109        SEND_VAR_NO_REF_EX                                       $86
        110        DO_FCALL                                      0  $87     
        111        ASSIGN                                                   !5, $87
   34   112        FETCH_DIM_R                                      ~89     !10, 'created'
        113        ASSIGN                                                   !8, ~89
   35   114        FETCH_DIM_R                                      ~91     !10, 'uid'
        115        ASSIGN                                                   !11, ~91
   36   116        INIT_FCALL_BY_NAME                                       'mysql_query'
        117        ROPE_INIT                                     3  ~94     'SELECT+%2A+FROM+%60tbluser%60+WHERE+%60id%60+%3D+%27'
        118        ROPE_ADD                                      1  ~94     ~94, !11
        119        ROPE_END                                      2  ~93     ~94, '%27'
        120        SEND_VAL_EX                                              ~93
        121        DO_FCALL                                      0  $96     
        122        ASSIGN                                           ~97     !14, $96
        123      > JMPNZ_EX                                         ~97     ~97, ->128
        124    >   INIT_FCALL_BY_NAME                                       'mysql_error'
        125        DO_FCALL                                      0  $98     
        126      > EXIT                                                     $98
        127*       BOOL                                             ~97     <true>
   37   128    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        129        SEND_VAR_EX                                              !14
        130        DO_FCALL                                      0  $99     
        131        ASSIGN                                                   !15, $99
   38   132        FETCH_DIM_R                                      ~101    !15, 'fname'
        133        CONCAT                                           ~102    ~101, '+'
        134        FETCH_DIM_R                                      ~103    !15, 'lname'
        135        CONCAT                                           ~104    ~102, ~103
        136        ASSIGN                                                   !16, ~104
   39   137        FETCH_DIM_R                                      ~106    !15, 'photo'
        138        ASSIGN                                                   !17, ~106
   40   139        NOP                                                      
        140        FAST_CONCAT                                      ~108    'http%3A%2F%2Fnitofa.com%2Fuser_pics%2Fusers%2F', !17
        141        ASSIGN                                                   !17, ~108
   41   142        INIT_FCALL                                               'header'
        143        CONCAT                                           ~110    'Location%3A+%2Fgroups%2F%3Fid%3D', !4
        144        CONCAT                                           ~111    ~110, '%26msg%3DComment+posted%21%23stcommentbody'
        145        CONCAT                                           ~112    ~111, !13
        146        SEND_VAL                                                 ~112
        147        DO_ICALL                                                 
   43   148        ECHO                                                     '%3Cdiv+class%3D%22stcommentbody%22+id%3D%22stcommentbody'
        149        ECHO                                                     !13
        150        ECHO                                                     '%22%3E%0A%3Cdiv+class%3D%22stcommentimg%22%3E%0A%3Cimg+src%3D%22'
   45   151        ECHO                                                     !17
        152        ECHO                                                     '%22+class%3D%27small_face%27%2F%3E%0A%3C%2Fdiv%3E+%0A%3Cdiv+class%3D%22stcommenttext%22%3E%0A%3C%21--+%3Ca+class%3D%22stcommentdelete%22+href%3D%22%23%22+id%3D%27'
   48   153        ECHO                                                     !13
        154        ECHO                                                     '%27%3EX%3C%2Fa%3E+--%3E%0A%3Cb%3E%3Ca+href%3D%22'
   49   155        CONCAT                                           ~114    'http%3A%2F%2Fnitofa.com%2Fbrowse-user.php%3Ffid%3D', !11
        156        ECHO                                                     ~114
        157        ECHO                                                     '%22%3E'
        158        ECHO                                                     !16
        159        ECHO                                                     '%3C%2Fa%3E%3C%2Fb%3E+'
        160        ECHO                                                     !5
   50   161        ECHO                                                     '%3Cdiv+class%3D%22stcommenttime%22%3E'
        162        INIT_FCALL_BY_NAME                                       'time_stamp'
        163        SEND_VAR_EX                                              !8
        164        DO_FCALL                                      0          
        165        ECHO                                                     '%3C%2Fdiv%3E+%0A%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A'
   56   166    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.58 ms | 1412 KiB | 21 Q