3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); //Load latest update //error_reporting(0); // include db here include('db.php'); include_once 'includes/functions.php'; include_once 'includes/tolink.php'; include_once 'includes/time_stamp.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); $uid = $row_id['id']; // id of the user $Wall = new Wall_Updates(); if(isSet($_POST['update'])) { $update=$_POST['update']; $privacy=$_POST['privacy']; if($privacy=='0'){ $privacy=$privacy; } elseif( $privacy=='2' ) {$privacy=$privacy;} else { $privacy='1';} if(isSet($_FILES['photo'])) { $photo = $_FILES['photo']; $photoname = stripslashes($photo['name']); $photopath = "uploads/photos/".$uid."_" . basename($photoname); $ext = pathinfo($photo['tmp_name'], PATHINFO_EXTENSION); $ext = strtolower($ext); if (move_uploaded_file($photo['tmp_name'], $photopath)) { // Move succeed. list($width,$height)=getimagesize($photopath); if($width > 400 || $height > 300) { $photo = "<img src=\"".$photopath."\" width=\"400\" height=\"300\" />"; } else { $photo = "<img src=\"".$photopath."\" />"; } $data=$Wall->Insert_Photo($uid,$update,$photo,$privacy); } else { // Move failed. Possible duplicate? header("Location: wall.php?msg=Invalid image name!"); } } elseif(isSet($_FILES['file'])) { $file = $_FILES['file']; $filename = stripslashes($file['name']); $filepath = "uploads/docs/".$uid."_" . basename($filename); $ext = pathinfo($file['tmp_name'], PATHINFO_EXTENSION); $ext = strtolower($ext); if (move_uploaded_file($file['tmp_name'], $filepath)) { // Move succeed. $filepath="http://nitofa.com/$filepath"; $data=$Wall->Insert_Doc($uid,$update,$filepath,$privacy); } else { // Move failed. Possible duplicate? header("Location: wall.php?msg=Not valid file name!"); } } else { $data=$Wall->Insert_Update($uid,$update,$privacy); } if($data) { $msg_id=$data['msg_id']; $message=tolink(htmlentities($data['message'])); $time=$data['created']; $uid=$data['uid_fk']; $resultname = mysql_query("SELECT * FROM `tbluser` WHERE `id` = '$uid'") or die(mysql_error()); $row_name = mysql_fetch_assoc($resultname); $fullname = $row_name['fname'].' '.$row_name['lname']; // full name of user $face=$Wall->Avatar($uid); //$commentsarray=$Wall->Comments($msg_id); ?> <?php if(!$_GET['mode']=='ajax') { header("Location: wall.php?msg=Posted successfully!"); } ?> <div class="stimg"> <img src="<?php echo $face;?>" class='big_face'/> </div> <div class="sttext"> <a class="stdelete" href="#" id="<?php echo $msg_id;?>" title='Delete update'>X</a> <b><a href="<?php echo 'http://nitofa.com/browse-user.php?fid='.$uid;?>"><?php echo $fullname;?></a></b> <?php echo $message;?> <div class="sttime"><?php time_stamp($time);?> | <a href='#' class='commentopen' id='<?php echo $msg_id;?>' title='Comment'>Comment </a> | <?php include('likeunlike.php'); ?></div> <div id="stexpandbox"> <div id="stexpand"></div> </div> <div class="commentcontainer" id="commentload<?php echo $msg_id;?>"> <?php // include('load_comments.php') ?> </div> <div class="commentupdate" style='display:none' id='commentbox<?php echo $msg_id;?>'> <div class="stcommentimg"> <img src="<?php echo $face;?>" class='small_face'/> </div> <div class="stcommenttext" > <form method="post" action=""> <textarea name="comment" class="comment" maxlength="200" id="ctextarea<?php echo $msg_id;?>"></textarea> <br /> <input type="submit" value=" Comment " id="<?php echo $msg_id;?>" class="comment_button"/> </form> </div> </div> </div> </div> <?php } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 248
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 114
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 110
Branch analysis from position: 82
2 jumps found. (Code = 47) Position 1 = 92, Position 2 = 94
Branch analysis from position: 92
2 jumps found. (Code = 43) Position 1 = 95, Position 2 = 99
Branch analysis from position: 95
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
1 jumps found. (Code = 42) Position 1 = 113
Branch analysis from position: 113
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
2 jumps found. (Code = 43) Position 1 = 170, Position 2 = 248
Branch analysis from position: 170
2 jumps found. (Code = 47) Position 1 = 192, Position 2 = 196
Branch analysis from position: 192
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 196
2 jumps found. (Code = 43) Position 1 = 214, Position 2 = 217
Branch analysis from position: 214
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 217
Branch analysis from position: 248
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 113
Branch analysis from position: 113
Branch analysis from position: 94
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
Branch analysis from position: 114
2 jumps found. (Code = 43) Position 1 = 117, Position 2 = 163
Branch analysis from position: 117
2 jumps found. (Code = 43) Position 1 = 148, Position 2 = 159
Branch analysis from position: 148
1 jumps found. (Code = 42) Position 1 = 162
Branch analysis from position: 162
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
Branch analysis from position: 159
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
Branch analysis from position: 163
2 jumps found. (Code = 43) Position 1 = 170, Position 2 = 248
Branch analysis from position: 170
Branch analysis from position: 248
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 114
Branch analysis from position: 51
Branch analysis from position: 114
Branch analysis from position: 248
filename:       /in/XAq4U
function name:  (null)
number of ops:  249
compiled vars:  !0 = $user_email, !1 = $resultuid, !2 = $row_id, !3 = $uid, !4 = $Wall, !5 = $update, !6 = $privacy, !7 = $photo, !8 = $photoname, !9 = $photopath, !10 = $ext, !11 = $width, !12 = $height, !13 = $data, !14 = $file, !15 = $filename, !16 = $filepath, !17 = $msg_id, !18 = $message, !19 = $time, !20 = $resultname, !21 = $row_name, !22 = $fullname, !23 = $face
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    8     2        INCLUDE_OR_EVAL                                          'db.php', INCLUDE
    9     3        INCLUDE_OR_EVAL                                          'includes%2Ffunctions.php', INCLUDE_ONCE
   10     4        INCLUDE_OR_EVAL                                          'includes%2Ftolink.php', INCLUDE_ONCE
   11     5        INCLUDE_OR_EVAL                                          'includes%2Ftime_stamp.php', INCLUDE_ONCE
   13     6        FETCH_R                      global              ~29     '_SESSION'
          7        FETCH_DIM_R                                      ~30     ~29, 'email'
          8        ASSIGN                                                   !0, ~30
   15     9        INIT_FCALL_BY_NAME                                       'mysql_query'
         10        ROPE_INIT                                     3  ~33     'SELECT+%60id%60+FROM+%60tbluser%60+WHERE+%60email%60+%3D+%27'
         11        ROPE_ADD                                      1  ~33     ~33, !0
         12        ROPE_END                                      2  ~32     ~33, '%27'
         13        SEND_VAL_EX                                              ~32
         14        DO_FCALL                                      0  $35     
         15        ASSIGN                                           ~36     !1, $35
         16      > JMPNZ_EX                                         ~36     ~36, ->21
         17    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         18        DO_FCALL                                      0  $37     
         19      > EXIT                                                     $37
         20*       BOOL                                             ~36     <true>
   17    21    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_assoc'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0  $38     
         24        ASSIGN                                                   !2, $38
   19    25        FETCH_DIM_R                                      ~40     !2, 'id'
         26        ASSIGN                                                   !3, ~40
   21    27        NEW                                              $42     'Wall_Updates'
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !4, $42
   22    30        FETCH_IS                                         ~45     '_POST'
         31        ISSET_ISEMPTY_DIM_OBJ                         0          ~45, 'update'
         32      > JMPZ                                                     ~46, ->248
   24    33    >   FETCH_R                      global              ~47     '_POST'
         34        FETCH_DIM_R                                      ~48     ~47, 'update'
         35        ASSIGN                                                   !5, ~48
   25    36        FETCH_R                      global              ~50     '_POST'
         37        FETCH_DIM_R                                      ~51     ~50, 'privacy'
         38        ASSIGN                                                   !6, ~51
   26    39        IS_EQUAL                                                 !6, '0'
         40      > JMPZ                                                     ~53, ->43
         41    >   ASSIGN                                                   !6, !6
         42      > JMP                                                      ->48
         43    >   IS_EQUAL                                                 !6, '2'
         44      > JMPZ                                                     ~55, ->47
         45    >   ASSIGN                                                   !6, !6
         46      > JMP                                                      ->48
         47    >   ASSIGN                                                   !6, '1'
   27    48    >   FETCH_IS                                         ~58     '_FILES'
         49        ISSET_ISEMPTY_DIM_OBJ                         0          ~58, 'photo'
         50      > JMPZ                                                     ~59, ->114
   30    51    >   FETCH_R                      global              ~60     '_FILES'
         52        FETCH_DIM_R                                      ~61     ~60, 'photo'
         53        ASSIGN                                                   !7, ~61
   31    54        INIT_FCALL                                               'stripslashes'
         55        FETCH_DIM_R                                      ~63     !7, 'name'
         56        SEND_VAL                                                 ~63
         57        DO_ICALL                                         $64     
         58        ASSIGN                                                   !8, $64
   32    59        CONCAT                                           ~66     'uploads%2Fphotos%2F', !3
         60        CONCAT                                           ~67     ~66, '_'
         61        INIT_FCALL                                               'basename'
         62        SEND_VAR                                                 !8
         63        DO_ICALL                                         $68     
         64        CONCAT                                           ~69     ~67, $68
         65        ASSIGN                                                   !9, ~69
   33    66        INIT_FCALL                                               'pathinfo'
         67        FETCH_DIM_R                                      ~71     !7, 'tmp_name'
         68        SEND_VAL                                                 ~71
         69        SEND_VAL                                                 4
         70        DO_ICALL                                         $72     
         71        ASSIGN                                                   !10, $72
   34    72        INIT_FCALL                                               'strtolower'
         73        SEND_VAR                                                 !10
         74        DO_ICALL                                         $74     
         75        ASSIGN                                                   !10, $74
   35    76        INIT_FCALL                                               'move_uploaded_file'
         77        FETCH_DIM_R                                      ~76     !7, 'tmp_name'
         78        SEND_VAL                                                 ~76
         79        SEND_VAR                                                 !9
         80        DO_ICALL                                         $77     
         81      > JMPZ                                                     $77, ->110
   37    82    >   INIT_FCALL                                               'getimagesize'
         83        SEND_VAR                                                 !9
         84        DO_ICALL                                         $78     
         85        FETCH_LIST_R                                     $79     $78, 0
         86        ASSIGN                                                   !11, $79
         87        FETCH_LIST_R                                     $81     $78, 1
         88        ASSIGN                                                   !12, $81
         89        FREE                                                     $78
   38    90        IS_SMALLER                                       ~83     400, !11
         91      > JMPNZ_EX                                         ~83     ~83, ->94
         92    >   IS_SMALLER                                       ~84     300, !12
         93        BOOL                                             ~83     ~84
         94    > > JMPZ                                                     ~83, ->99
   39    95    >   CONCAT                                           ~85     '%3Cimg+src%3D%22', !9
         96        CONCAT                                           ~86     ~85, '%22+width%3D%22400%22+height%3D%22300%22+%2F%3E'
         97        ASSIGN                                                   !7, ~86
         98      > JMP                                                      ->102
   41    99    >   CONCAT                                           ~88     '%3Cimg+src%3D%22', !9
        100        CONCAT                                           ~89     ~88, '%22+%2F%3E'
        101        ASSIGN                                                   !7, ~89
   43   102    >   INIT_METHOD_CALL                                         !4, 'Insert_Photo'
        103        SEND_VAR_EX                                              !3
        104        SEND_VAR_EX                                              !5
        105        SEND_VAR_EX                                              !7
        106        SEND_VAR_EX                                              !6
        107        DO_FCALL                                      0  $91     
        108        ASSIGN                                                   !13, $91
        109      > JMP                                                      ->113
   46   110    >   INIT_FCALL                                               'header'
        111        SEND_VAL                                                 'Location%3A+wall.php%3Fmsg%3DInvalid+image+name%21'
        112        DO_ICALL                                                 
        113    > > JMP                                                      ->169
   48   114    >   FETCH_IS                                         ~94     '_FILES'
        115        ISSET_ISEMPTY_DIM_OBJ                         0          ~94, 'file'
        116      > JMPZ                                                     ~95, ->163
   50   117    >   FETCH_R                      global              ~96     '_FILES'
        118        FETCH_DIM_R                                      ~97     ~96, 'file'
        119        ASSIGN                                                   !14, ~97
   51   120        INIT_FCALL                                               'stripslashes'
        121        FETCH_DIM_R                                      ~99     !14, 'name'
        122        SEND_VAL                                                 ~99
        123        DO_ICALL                                         $100    
        124        ASSIGN                                                   !15, $100
   52   125        CONCAT                                           ~102    'uploads%2Fdocs%2F', !3
        126        CONCAT                                           ~103    ~102, '_'
        127        INIT_FCALL                                               'basename'
        128        SEND_VAR                                                 !15
        129        DO_ICALL                                         $104    
        130        CONCAT                                           ~105    ~103, $104
        131        ASSIGN                                                   !16, ~105
   53   132        INIT_FCALL                                               'pathinfo'
        133        FETCH_DIM_R                                      ~107    !14, 'tmp_name'
        134        SEND_VAL                                                 ~107
        135        SEND_VAL                                                 4
        136        DO_ICALL                                         $108    
        137        ASSIGN                                                   !10, $108
   54   138        INIT_FCALL                                               'strtolower'
        139        SEND_VAR                                                 !10
        140        DO_ICALL                                         $110    
        141        ASSIGN                                                   !10, $110
   55   142        INIT_FCALL                                               'move_uploaded_file'
        143        FETCH_DIM_R                                      ~112    !14, 'tmp_name'
        144        SEND_VAL                                                 ~112
        145        SEND_VAR                                                 !16
        146        DO_ICALL                                         $113    
        147      > JMPZ                                                     $113, ->159
   57   148    >   NOP                                                      
        149        FAST_CONCAT                                      ~114    'http%3A%2F%2Fnitofa.com%2F', !16
        150        ASSIGN                                                   !16, ~114
   58   151        INIT_METHOD_CALL                                         !4, 'Insert_Doc'
        152        SEND_VAR_EX                                              !3
        153        SEND_VAR_EX                                              !5
        154        SEND_VAR_EX                                              !16
        155        SEND_VAR_EX                                              !6
        156        DO_FCALL                                      0  $116    
        157        ASSIGN                                                   !13, $116
        158      > JMP                                                      ->162
   61   159    >   INIT_FCALL                                               'header'
        160        SEND_VAL                                                 'Location%3A+wall.php%3Fmsg%3DNot+valid+file+name%21'
        161        DO_ICALL                                                 
        162    > > JMP                                                      ->169
   64   163    >   INIT_METHOD_CALL                                         !4, 'Insert_Update'
        164        SEND_VAR_EX                                              !3
        165        SEND_VAR_EX                                              !5
        166        SEND_VAR_EX                                              !6
        167        DO_FCALL                                      0  $119    
        168        ASSIGN                                                   !13, $119
   66   169    > > JMPZ                                                     !13, ->248
   68   170    >   FETCH_DIM_R                                      ~121    !13, 'msg_id'
        171        ASSIGN                                                   !17, ~121
   69   172        INIT_FCALL_BY_NAME                                       'tolink'
        173        INIT_FCALL                                               'htmlentities'
        174        FETCH_DIM_R                                      ~123    !13, 'message'
        175        SEND_VAL                                                 ~123
        176        DO_ICALL                                         $124    
        177        SEND_VAR_NO_REF_EX                                       $124
        178        DO_FCALL                                      0  $125    
        179        ASSIGN                                                   !18, $125
   70   180        FETCH_DIM_R                                      ~127    !13, 'created'
        181        ASSIGN                                                   !19, ~127
   71   182        FETCH_DIM_R                                      ~129    !13, 'uid_fk'
        183        ASSIGN                                                   !3, ~129
   72   184        INIT_FCALL_BY_NAME                                       'mysql_query'
        185        ROPE_INIT                                     3  ~132    'SELECT+%2A+FROM+%60tbluser%60+WHERE+%60id%60+%3D+%27'
        186        ROPE_ADD                                      1  ~132    ~132, !3
        187        ROPE_END                                      2  ~131    ~132, '%27'
        188        SEND_VAL_EX                                              ~131
        189        DO_FCALL                                      0  $134    
        190        ASSIGN                                           ~135    !20, $134
        191      > JMPNZ_EX                                         ~135    ~135, ->196
        192    >   INIT_FCALL_BY_NAME                                       'mysql_error'
        193        DO_FCALL                                      0  $136    
        194      > EXIT                                                     $136
        195*       BOOL                                             ~135    <true>
   73   196    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_assoc'
        197        SEND_VAR_EX                                              !20
        198        DO_FCALL                                      0  $137    
        199        ASSIGN                                                   !21, $137
   74   200        FETCH_DIM_R                                      ~139    !21, 'fname'
        201        CONCAT                                           ~140    ~139, '+'
        202        FETCH_DIM_R                                      ~141    !21, 'lname'
        203        CONCAT                                           ~142    ~140, ~141
        204        ASSIGN                                                   !22, ~142
   75   205        INIT_METHOD_CALL                                         !4, 'Avatar'
        206        SEND_VAR_EX                                              !3
        207        DO_FCALL                                      0  $144    
        208        ASSIGN                                                   !23, $144
   79   209        FETCH_R                      global              ~146    '_GET'
        210        FETCH_DIM_R                                      ~147    ~146, 'mode'
        211        BOOL_NOT                                         ~148    ~147
        212        IS_EQUAL                                                 ~148, 'ajax'
        213      > JMPZ                                                     ~149, ->217
   80   214    >   INIT_FCALL                                               'header'
        215        SEND_VAL                                                 'Location%3A+wall.php%3Fmsg%3DPosted+successfully%21'
        216        DO_ICALL                                                 
   82   217    >   ECHO                                                     '%3Cdiv+class%3D%22stimg%22%3E%0A%3Cimg+src%3D%22'
   83   218        ECHO                                                     !23
        219        ECHO                                                     '%22+class%3D%27big_face%27%2F%3E%0A%3C%2Fdiv%3E+%0A%3Cdiv+class%3D%22sttext%22%3E%0A%3Ca+class%3D%22stdelete%22+href%3D%22%23%22+id%3D%22'
   86   220        ECHO                                                     !17
        221        ECHO                                                     '%22+title%3D%27Delete+update%27%3EX%3C%2Fa%3E%0A%3Cb%3E%3Ca+href%3D%22'
   87   222        CONCAT                                           ~151    'http%3A%2F%2Fnitofa.com%2Fbrowse-user.php%3Ffid%3D', !3
        223        ECHO                                                     ~151
        224        ECHO                                                     '%22%3E'
        225        ECHO                                                     !22
        226        ECHO                                                     '%3C%2Fa%3E%3C%2Fb%3E+'
        227        ECHO                                                     !18
   88   228        ECHO                                                     '%3Cdiv+class%3D%22sttime%22%3E'
        229        INIT_FCALL_BY_NAME                                       'time_stamp'
        230        SEND_VAR_EX                                              !19
        231        DO_FCALL                                      0          
        232        ECHO                                                     '+%7C+%3Ca+href%3D%27%23%27+class%3D%27commentopen%27+id%3D%27'
        233        ECHO                                                     !17
        234        ECHO                                                     '%27+title%3D%27Comment%27%3EComment+%3C%2Fa%3E+%7C+'
        235        INCLUDE_OR_EVAL                                          'likeunlike.php', INCLUDE
        236        ECHO                                                     '%3C%2Fdiv%3E+%0A%3Cdiv+id%3D%22stexpandbox%22%3E%0A%3Cdiv+id%3D%22stexpand%22%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3Cdiv+class%3D%22commentcontainer%22+id%3D%22commentload'
   92   237        ECHO                                                     !17
        238        ECHO                                                     '%22%3E%0A'
   94   239        ECHO                                                     '%3C%2Fdiv%3E%0A%3Cdiv+class%3D%22commentupdate%22+style%3D%27display%3Anone%27+id%3D%27commentbox'
   95   240        ECHO                                                     !17
        241        ECHO                                                     '%27%3E%0A%3Cdiv+class%3D%22stcommentimg%22%3E%0A%3Cimg+src%3D%22'
   97   242        ECHO                                                     !23
        243        ECHO                                                     '%22+class%3D%27small_face%27%2F%3E%0A%3C%2Fdiv%3E+%0A%3Cdiv+class%3D%22stcommenttext%22+%3E%0A%3Cform+method%3D%22post%22+action%3D%22%22%3E%0A%3Ctextarea+name%3D%22comment%22+class%3D%22comment%22+maxlength%3D%22200%22++id%3D%22ctextarea'
  101   244        ECHO                                                     !17
        245        ECHO                                                     '%22%3E%3C%2Ftextarea%3E%0A%3Cbr+%2F%3E%0A%3Cinput+type%3D%22submit%22++value%3D%22+Comment+%22++id%3D%22'
  103   246        ECHO                                                     !17
        247        ECHO                                                     '%22+class%3D%22comment_button%22%2F%3E%0A%3C%2Fform%3E%0A%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3C%2Fdiv%3E+%0A%3C%2Fdiv%3E%0A'
  112   248    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.86 ms | 1420 KiB | 31 Q