3v4l.org

run code in 300+ PHP versions simultaneously
<?php // rnmessages.php include_once 'rnheader.php'; if (!isset($_SESSION['user'])) die("<br /><br />You need to login to view this page"); $user = $_SESSION['user']; if (isset($_GET['view'])) $view = sanitizeString($_GET['view']); else $view = $user; if (isset($_POST['text'])) { $text = sanitizeString($_POST['text']); if ($text != "") { $pm = substr(sanitizeString($_POST['pm']),0,1); $time = time(); mysqli_query($con,"INSERT INTO rnmessages VALUES(NULL, '$user', '$view', '$pm', $time, '$text')"); } } if ($view != "") { if ($view == $user) { $name1 = "Your"; $name2 = "Your"; } else { $name1 = "<a href='rnmembers.php?view=$view'>$view</a>'s"; $name2 = "$view's"; } echo "<h3>$name1 Messages</h3>"; showProfile($view); echo "<form method='post' action='rnmessages.php?view=$view'> Type here to leave a message:<br /> <textarea name='text' cols='40' rows='3'></textarea><br /> Public<input type='radio' name='pm' value='0' checked='checked' /> Private<input type='radio' name='pm' value='1' /> <input type='submit' value='Post Message' /></form>"; if (isset($_GET['erase'])) { $erase = sanitizeString($_GET['erase']); mysqli_query($con,"DELETE FROM rnmessages WHERE id=$erase AND recip='$user'"); } $query = mysqli_query($con,"SELECT * FROM rnmessages WHERE recip='$view' ORDER BY time DESC"); //$result = queryMysql($query); $num = mysqli_num_rows($query); for ($j = 0 ; $j < $num ; ++$j) { $row = mysqli_fetch_row($query); if ($row[3] == 0 || $row[1] == $user || $row[2] == $user) { echo date('M jS \'y g:sa:', $row[4]); echo " <a href='rnmessages.php?"; echo "view=$row[1]'>$row[1]</a> "; if ($row[3] == 0) { echo "wrote: &quot;$row[5]&quot; "; } else { echo "whispered: <i><font color='#006600'>&quot;$row[5]&quot;</font></i> "; } if ($row[2] == $user) { echo "[<a href='rnmessages.php?view=$view"; echo "&erase=$row[0]'>erase</a>]"; } echo "<br>"; } } } if (!$num) echo "<li>No messages yet</li><br />"; echo "<br><a href='rnmessages.php?view=$view'>Refresh messages</a>"; echo " | <a href='rnfriends.php?view=$view'>View $name2 friends</a>"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 63
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 63
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 182
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 70
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 109
Branch analysis from position: 93
1 jumps found. (Code = 42) Position 1 = 180
Branch analysis from position: 180
2 jumps found. (Code = 44) Position 1 = 182, Position 2 = 123
Branch analysis from position: 182
2 jumps found. (Code = 43) Position 1 = 184, Position 2 = 185
Branch analysis from position: 184
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 185
Branch analysis from position: 123
2 jumps found. (Code = 47) Position 1 = 130, Position 2 = 133
Branch analysis from position: 130
2 jumps found. (Code = 47) Position 1 = 134, Position 2 = 137
Branch analysis from position: 134
2 jumps found. (Code = 43) Position 1 = 138, Position 2 = 179
Branch analysis from position: 138
2 jumps found. (Code = 43) Position 1 = 156, Position 2 = 162
Branch analysis from position: 156
1 jumps found. (Code = 42) Position 1 = 167
Branch analysis from position: 167
2 jumps found. (Code = 43) Position 1 = 170, Position 2 = 178
Branch analysis from position: 170
2 jumps found. (Code = 44) Position 1 = 182, Position 2 = 123
Branch analysis from position: 182
Branch analysis from position: 123
Branch analysis from position: 178
Branch analysis from position: 162
2 jumps found. (Code = 43) Position 1 = 170, Position 2 = 178
Branch analysis from position: 170
Branch analysis from position: 178
Branch analysis from position: 179
Branch analysis from position: 137
Branch analysis from position: 133
Branch analysis from position: 109
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 109
Branch analysis from position: 93
Branch analysis from position: 109
Branch analysis from position: 182
Branch analysis from position: 63
Branch analysis from position: 63
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 63
Branch analysis from position: 24
Branch analysis from position: 63
filename:       /in/cSURt
function name:  (null)
number of ops:  196
compiled vars:  !0 = $user, !1 = $view, !2 = $text, !3 = $pm, !4 = $time, !5 = $con, !6 = $name1, !7 = $name2, !8 = $erase, !9 = $query, !10 = $num, !11 = $j, !12 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'rnheader.php', INCLUDE_ONCE
    3     1        FETCH_IS                                         ~14     '_SESSION'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~15     ~14, 'user'
          3        BOOL_NOT                                         ~16     ~15
          4      > JMPZ                                                     ~16, ->6
    4     5    > > EXIT                                                     '%3Cbr+%2F%3E%3Cbr+%2F%3EYou+need+to+login+to+view+this+page'
    5     6    >   FETCH_R                      global              ~17     '_SESSION'
          7        FETCH_DIM_R                                      ~18     ~17, 'user'
          8        ASSIGN                                                   !0, ~18
    6     9        FETCH_IS                                         ~20     '_GET'
         10        ISSET_ISEMPTY_DIM_OBJ                         0          ~20, 'view'
         11      > JMPZ                                                     ~21, ->20
    7    12    >   INIT_FCALL_BY_NAME                                       'sanitizeString'
         13        CHECK_FUNC_ARG                                           
         14        FETCH_FUNC_ARG               global              $22     '_GET'
         15        FETCH_DIM_FUNC_ARG                               $23     $22, 'view'
         16        SEND_FUNC_ARG                                            $23
         17        DO_FCALL                                      0  $24     
         18        ASSIGN                                                   !1, $24
         19      > JMP                                                      ->21
    8    20    >   ASSIGN                                                   !1, !0
    9    21    >   FETCH_IS                                         ~27     '_POST'
         22        ISSET_ISEMPTY_DIM_OBJ                         0          ~27, 'text'
         23      > JMPZ                                                     ~28, ->63
   11    24    >   INIT_FCALL_BY_NAME                                       'sanitizeString'
         25        CHECK_FUNC_ARG                                           
         26        FETCH_FUNC_ARG               global              $29     '_POST'
         27        FETCH_DIM_FUNC_ARG                               $30     $29, 'text'
         28        SEND_FUNC_ARG                                            $30
         29        DO_FCALL                                      0  $31     
         30        ASSIGN                                                   !2, $31
   13    31        IS_NOT_EQUAL                                             !2, ''
         32      > JMPZ                                                     ~33, ->63
   15    33    >   INIT_FCALL                                               'substr'
         34        INIT_FCALL_BY_NAME                                       'sanitizeString'
         35        CHECK_FUNC_ARG                                           
         36        FETCH_FUNC_ARG               global              $34     '_POST'
         37        FETCH_DIM_FUNC_ARG                               $35     $34, 'pm'
         38        SEND_FUNC_ARG                                            $35
         39        DO_FCALL                                      0  $36     
         40        SEND_VAR                                                 $36
         41        SEND_VAL                                                 0
         42        SEND_VAL                                                 1
         43        DO_ICALL                                         $37     
         44        ASSIGN                                                   !3, $37
   16    45        INIT_FCALL                                               'time'
         46        DO_ICALL                                         $39     
         47        ASSIGN                                                   !4, $39
   17    48        INIT_FCALL_BY_NAME                                       'mysqli_query'
         49        SEND_VAR_EX                                              !5
         50        ROPE_INIT                                    11  ~42     'INSERT+INTO+rnmessages+VALUES%28NULL%2C%0A++++++++++++%27'
   18    51        ROPE_ADD                                      1  ~42     ~42, !0
         52        ROPE_ADD                                      2  ~42     ~42, '%27%2C+%27'
         53        ROPE_ADD                                      3  ~42     ~42, !1
         54        ROPE_ADD                                      4  ~42     ~42, '%27%2C+%27'
         55        ROPE_ADD                                      5  ~42     ~42, !3
         56        ROPE_ADD                                      6  ~42     ~42, '%27%2C+'
         57        ROPE_ADD                                      7  ~42     ~42, !4
         58        ROPE_ADD                                      8  ~42     ~42, '%2C+%27'
         59        ROPE_ADD                                      9  ~42     ~42, !2
         60        ROPE_END                                     10  ~41     ~42, '%27%29'
         61        SEND_VAL_EX                                              ~41
         62        DO_FCALL                                      0          
   21    63    >   IS_NOT_EQUAL                                             !1, ''
         64      > JMPZ                                                     ~49, ->182
   24    65    >   IS_EQUAL                                                 !1, !0
         66      > JMPZ                                                     ~50, ->70
   26    67    >   ASSIGN                                                   !6, 'Your'
   27    68        ASSIGN                                                   !7, 'Your'
         69      > JMP                                                      ->79
   31    70    >   ROPE_INIT                                     5  ~54     '%3Ca+href%3D%27rnmembers.php%3Fview%3D'
         71        ROPE_ADD                                      1  ~54     ~54, !1
         72        ROPE_ADD                                      2  ~54     ~54, '%27%3E'
         73        ROPE_ADD                                      3  ~54     ~54, !1
         74        ROPE_END                                      4  ~53     ~54, '%3C%2Fa%3E%27s'
         75        ASSIGN                                                   !6, ~53
   32    76        NOP                                                      
         77        FAST_CONCAT                                      ~58     !1, '%27s'
         78        ASSIGN                                                   !7, ~58
   34    79    >   ROPE_INIT                                     3  ~61     '%3Ch3%3E'
         80        ROPE_ADD                                      1  ~61     ~61, !6
         81        ROPE_END                                      2  ~60     ~61, '+Messages%3C%2Fh3%3E'
         82        ECHO                                                     ~60
   35    83        INIT_FCALL_BY_NAME                                       'showProfile'
         84        SEND_VAR_EX                                              !1
         85        DO_FCALL                                      0          
   36    86        ROPE_INIT                                     3  ~65     '%3Cform+method%3D%27post%27+action%3D%27rnmessages.php%3Fview%3D'
         87        ROPE_ADD                                      1  ~65     ~65, !1
         88        ROPE_END                                      2  ~64     ~65, '%27%3E%0A+++++++++Type+here+to+leave+a+message%3A%3Cbr+%2F%3E%0A++++++++%3Ctextarea+name%3D%27text%27+cols%3D%2740%27+rows%3D%273%27%3E%3C%2Ftextarea%3E%3Cbr+%2F%3E%0A++++++++Public%3Cinput+type%3D%27radio%27+name%3D%27pm%27+value%3D%270%27+checked%3D%27checked%27+%2F%3E%0A+++++Private%3Cinput+type%3D%27radio%27+name%3D%27pm%27+value%3D%271%27+%2F%3E%0A++++++++%3Cinput+type%3D%27submit%27+value%3D%27Post+Message%27+%2F%3E%3C%2Fform%3E'
         89        ECHO                                                     ~64
   43    90        FETCH_IS                                         ~67     '_GET'
         91        ISSET_ISEMPTY_DIM_OBJ                         0          ~67, 'erase'
         92      > JMPZ                                                     ~68, ->109
   45    93    >   INIT_FCALL_BY_NAME                                       'sanitizeString'
         94        CHECK_FUNC_ARG                                           
         95        FETCH_FUNC_ARG               global              $69     '_GET'
         96        FETCH_DIM_FUNC_ARG                               $70     $69, 'erase'
         97        SEND_FUNC_ARG                                            $70
         98        DO_FCALL                                      0  $71     
         99        ASSIGN                                                   !8, $71
   46   100        INIT_FCALL_BY_NAME                                       'mysqli_query'
        101        SEND_VAR_EX                                              !5
        102        ROPE_INIT                                     5  ~74     'DELETE+FROM+rnmessages+WHERE+id%3D'
        103        ROPE_ADD                                      1  ~74     ~74, !8
        104        ROPE_ADD                                      2  ~74     ~74, '%0A++++++++++++AND+recip%3D%27'
   47   105        ROPE_ADD                                      3  ~74     ~74, !0
        106        ROPE_END                                      4  ~73     ~74, '%27'
        107        SEND_VAL_EX                                              ~73
        108        DO_FCALL                                      0          
   49   109    >   INIT_FCALL_BY_NAME                                       'mysqli_query'
        110        SEND_VAR_EX                                              !5
        111        ROPE_INIT                                     3  ~79     'SELECT+%2A+FROM+rnmessages+WHERE+recip%3D%27'
        112        ROPE_ADD                                      1  ~79     ~79, !1
        113        ROPE_END                                      2  ~78     ~79, '%27%0A+++++++++ORDER+BY+time+DESC'
        114        SEND_VAL_EX                                              ~78
        115        DO_FCALL                                      0  $81     
        116        ASSIGN                                                   !9, $81
   52   117        INIT_FCALL_BY_NAME                                       'mysqli_num_rows'
        118        SEND_VAR_EX                                              !9
        119        DO_FCALL                                      0  $83     
        120        ASSIGN                                                   !10, $83
   53   121        ASSIGN                                                   !11, 0
        122      > JMP                                                      ->180
   55   123    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_row'
        124        SEND_VAR_EX                                              !9
        125        DO_FCALL                                      0  $86     
        126        ASSIGN                                                   !12, $86
   56   127        FETCH_DIM_R                                      ~88     !12, 3
        128        IS_EQUAL                                         ~89     ~88, 0
        129      > JMPNZ_EX                                         ~89     ~89, ->133
   57   130    >   FETCH_DIM_R                                      ~90     !12, 1
        131        IS_EQUAL                                         ~91     !0, ~90
        132        BOOL                                             ~89     ~91
        133    > > JMPNZ_EX                                         ~89     ~89, ->137
   58   134    >   FETCH_DIM_R                                      ~92     !12, 2
        135        IS_EQUAL                                         ~93     !0, ~92
        136        BOOL                                             ~89     ~93
        137    > > JMPZ                                                     ~89, ->179
   60   138    >   INIT_FCALL                                               'date'
        139        SEND_VAL                                                 'M+jS+%27y+g%3Asa%3A'
        140        FETCH_DIM_R                                      ~94     !12, 4
        141        SEND_VAL                                                 ~94
        142        DO_ICALL                                         $95     
        143        ECHO                                                     $95
   61   144        ECHO                                                     '+%3Ca+href%3D%27rnmessages.php%3F'
   62   145        ROPE_INIT                                     5  ~99     'view%3D'
        146        FETCH_DIM_R                                      ~96     !12, 1
        147        ROPE_ADD                                      1  ~99     ~99, ~96
        148        ROPE_ADD                                      2  ~99     ~99, '%27%3E'
        149        FETCH_DIM_R                                      ~97     !12, 1
        150        ROPE_ADD                                      3  ~99     ~99, ~97
        151        ROPE_END                                      4  ~98     ~99, '%3C%2Fa%3E+'
        152        ECHO                                                     ~98
   63   153        FETCH_DIM_R                                      ~102    !12, 3
        154        IS_EQUAL                                                 ~102, 0
        155      > JMPZ                                                     ~103, ->162
   65   156    >   ROPE_INIT                                     3  ~106    'wrote%3A+%26quot%3B'
        157        FETCH_DIM_R                                      ~104    !12, 5
        158        ROPE_ADD                                      1  ~106    ~106, ~104
        159        ROPE_END                                      2  ~105    ~106, '%26quot%3B+'
        160        ECHO                                                     ~105
        161      > JMP                                                      ->167
   69   162    >   ROPE_INIT                                     3  ~110    'whispered%3A+%3Ci%3E%3Cfont%0A++++++++++++++++++++++++color%3D%27%23006600%27%3E%26quot%3B'
   70   163        FETCH_DIM_R                                      ~108    !12, 5
        164        ROPE_ADD                                      1  ~110    ~110, ~108
        165        ROPE_END                                      2  ~109    ~110, '%26quot%3B%3C%2Ffont%3E%3C%2Fi%3E+'
        166        ECHO                                                     ~109
   72   167    >   FETCH_DIM_R                                      ~112    !12, 2
        168        IS_EQUAL                                                 !0, ~112
        169      > JMPZ                                                     ~113, ->178
   74   170    >   NOP                                                      
        171        FAST_CONCAT                                      ~114    '%5B%3Ca+href%3D%27rnmessages.php%3Fview%3D', !1
        172        ECHO                                                     ~114
   75   173        ROPE_INIT                                     3  ~117    '%26erase%3D'
        174        FETCH_DIM_R                                      ~115    !12, 0
        175        ROPE_ADD                                      1  ~117    ~117, ~115
        176        ROPE_END                                      2  ~116    ~117, '%27%3Eerase%3C%2Fa%3E%5D'
        177        ECHO                                                     ~116
   77   178    >   ECHO                                                     '%3Cbr%3E'
   53   179    >   PRE_INC                                                  !11
        180    >   IS_SMALLER                                               !11, !10
        181      > JMPNZ                                                    ~120, ->123
   81   182    >   BOOL_NOT                                         ~121    !10
        183      > JMPZ                                                     ~121, ->185
        184    >   ECHO                                                     '%3Cli%3ENo+messages+yet%3C%2Fli%3E%3Cbr+%2F%3E'
   82   185    >   ROPE_INIT                                     3  ~123    '%3Cbr%3E%3Ca+href%3D%27rnmessages.php%3Fview%3D'
        186        ROPE_ADD                                      1  ~123    ~123, !1
        187        ROPE_END                                      2  ~122    ~123, '%27%3ERefresh+messages%3C%2Fa%3E'
        188        ECHO                                                     ~122
   83   189        ROPE_INIT                                     5  ~126    '+%7C+%3Ca+href%3D%27rnfriends.php%3Fview%3D'
        190        ROPE_ADD                                      1  ~126    ~126, !1
        191        ROPE_ADD                                      2  ~126    ~126, '%27%3EView+'
        192        ROPE_ADD                                      3  ~126    ~126, !7
        193        ROPE_END                                      4  ~125    ~126, '+friends%3C%2Fa%3E'
        194        ECHO                                                     ~125
   84   195      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.89 ms | 1421 KiB | 19 Q