3v4l.org

run code in 300+ PHP versions simultaneously
<? include "db_info.php"; if(!$_COOKIE['level']){ echo "<script>alert('error');history.back(-1)</script>"; } $page_size=10; $page_list_size=10; $no = $_GET[no]; $search = $_GET['search']; if(!$no || $no<0) $no =0; if($search){ $query = "select * from board where title like '%$search%' or content like '%$search%' order by id desc limit $no, $page_size"; $result_count=mysql_query("select count(*) from board where title like '%$search%' or content like '%$search%'", $conn); }else{ $query = "select * from board order by id desc limit $no, $page_size"; $result_count=mysql_query("select count(*) from board", $conn); } echo "$query<br><br><br>"; $result = mysql_query($query, $conn); $result_row = mysql_fetch_row($result_count); $total_row = $result_row[0]; if($total_row <= 0) $total_row = 0; $total_page = ceil($total_row / $page_size); $current_page = ceil(($no+1)/$page_size); ?> <html> <head> <title>board</title> <br> <table> <tr> <td><a font size=2>yeonghoo2.com</a></td> <td width=280></td> <td align=left><form action=list.php method=get> <input type=text name=search> <input type=submit value=search> </form> </td> <table witdh=500 border=1 cellpadding=0 cellspacing=0> <tr height=20> <td width=30 align=center>no</td> <td width=370 align=center>title</td> <td width=50 align=center>user</td> <td width=60 align=center>date</td> <td width=40 align=center>view</td> </tr> <? while($row=mysql_fetch_array($result)){ ?> <tr> <td height=20 align=center> <a href="read.php?id=<?=$row[id]?>&no=<?=$no?>"> <?=$row[id]?></a> </td> <td height=20>&nbsp;<a href="read.php?id=<?=$row[id]?>&no=<?=$no?>"> <?=strip_tags($row[title],'<b><i>');?></a> </td> <td align=center height=20> <a href="mailto:<?=$row[email]?>"> <?=$row[name]?></a> </td> <td align=center height=20><?=$row[wdate]?> </td> <td align=center height=20><?=$row[view]?> </td> </tr> <? } mysql_close($conn); ?> </table> <table border=0> <tr> <td width=600 height=20 align=center rowspan=4> <? $start_page = floor(($current_page -1 ) / $page_list_size) * $page_list_size + 1; $end_page = $start_page + $page_list_size -1; if($total_page < $end_page) $end_page = $total_page; if(start_page >= $page_list_size){ $prev_list = ($start_page - 2) * $page_size; echo "<a href='$PHP_SELF?no=prev_list'><</a>"; } for($i=$start_page; $i<=$end_page; $i++){ $page= ($i-1)*$page_size; if($no != $page){ if(!$search){ echo "<a href='$PHP_SELF?no=$page'>"; }else{ echo "<a href='$PHP_SELF?no=$page&search=$search'>"; } } echo "$i&nbsp;"; if($no != $page ){ echo "</a>"; } } if($total_page > $end_page){ $next_list = $end_page * $page_size; echo "<a href=$PHP_SELF?no=$next_list>></a><p>"; } ?> </td> </tr> </table> <a href=write.php>write</a> <a href=logout.php>logout</a> </center> <? if($_COOKIE['level']==99){ echo "<a href=adm.php>adminpage</a>"; } ?> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
2 jumps found. (Code = 47) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 42
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 69
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
2 jumps found. (Code = 44) Position 1 = 128, Position 2 = 82
Branch analysis from position: 128
2 jumps found. (Code = 43) Position 1 = 145, Position 2 = 146
Branch analysis from position: 145
2 jumps found. (Code = 43) Position 1 = 149, Position 2 = 156
Branch analysis from position: 149
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
2 jumps found. (Code = 44) Position 1 = 189, Position 2 = 158
Branch analysis from position: 189
2 jumps found. (Code = 43) Position 1 = 191, Position 2 = 199
Branch analysis from position: 191
2 jumps found. (Code = 43) Position 1 = 204, Position 2 = 205
Branch analysis from position: 204
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 205
Branch analysis from position: 199
Branch analysis from position: 158
2 jumps found. (Code = 43) Position 1 = 163, Position 2 = 180
Branch analysis from position: 163
2 jumps found. (Code = 43) Position 1 = 165, Position 2 = 172
Branch analysis from position: 165
1 jumps found. (Code = 42) Position 1 = 180
Branch analysis from position: 180
2 jumps found. (Code = 43) Position 1 = 185, Position 2 = 186
Branch analysis from position: 185
2 jumps found. (Code = 44) Position 1 = 189, Position 2 = 158
Branch analysis from position: 189
Branch analysis from position: 158
Branch analysis from position: 186
Branch analysis from position: 172
2 jumps found. (Code = 43) Position 1 = 185, Position 2 = 186
Branch analysis from position: 185
Branch analysis from position: 186
Branch analysis from position: 180
Branch analysis from position: 156
Branch analysis from position: 146
Branch analysis from position: 82
2 jumps found. (Code = 44) Position 1 = 128, Position 2 = 82
Branch analysis from position: 128
Branch analysis from position: 82
Branch analysis from position: 69
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 69
Branch analysis from position: 68
Branch analysis from position: 69
Branch analysis from position: 21
Branch analysis from position: 19
Branch analysis from position: 6
filename:       /in/QPhKW
function name:  (null)
number of ops:  207
compiled vars:  !0 = $page_size, !1 = $page_list_size, !2 = $no, !3 = $search, !4 = $query, !5 = $result_count, !6 = $conn, !7 = $result, !8 = $result_row, !9 = $total_row, !10 = $total_page, !11 = $current_page, !12 = $row, !13 = $start_page, !14 = $end_page, !15 = $prev_list, !16 = $PHP_SELF, !17 = $i, !18 = $page, !19 = $next_list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'db_info.php', INCLUDE
    4     1        FETCH_R                      global              ~21     '_COOKIE'
          2        FETCH_DIM_R                                      ~22     ~21, 'level'
          3        BOOL_NOT                                         ~23     ~22
          4      > JMPZ                                                     ~23, ->6
    5     5    >   ECHO                                                     '%3Cscript%3Ealert%28%27error%27%29%3Bhistory.back%28-1%29%3C%2Fscript%3E'
    8     6    >   ASSIGN                                                   !0, 10
    9     7        ASSIGN                                                   !1, 10
   10     8        FETCH_CONSTANT                                   ~27     'no'
          9        FETCH_R                      global              ~26     '_GET'
         10        FETCH_DIM_R                                      ~28     ~26, ~27
         11        ASSIGN                                                   !2, ~28
   11    12        FETCH_R                      global              ~30     '_GET'
         13        FETCH_DIM_R                                      ~31     ~30, 'search'
         14        ASSIGN                                                   !3, ~31
   13    15        BOOL_NOT                                         ~33     !2
         16      > JMPNZ_EX                                         ~33     ~33, ->19
         17    >   IS_SMALLER                                       ~34     !2, 0
         18        BOOL                                             ~33     ~34
         19    > > JMPZ                                                     ~33, ->21
         20    >   ASSIGN                                                   !2, 0
   17    21    > > JMPZ                                                     !3, ->42
   18    22    >   ROPE_INIT                                     8  ~37     'select+%2A+from+board+where+title+like+%27%25'
         23        ROPE_ADD                                      1  ~37     ~37, !3
         24        ROPE_ADD                                      2  ~37     ~37, '%25%27+or+content+like+%27%25'
         25        ROPE_ADD                                      3  ~37     ~37, !3
         26        ROPE_ADD                                      4  ~37     ~37, '%25%27+order+by+id+desc+limit+'
         27        ROPE_ADD                                      5  ~37     ~37, !2
         28        ROPE_ADD                                      6  ~37     ~37, '%2C+'
         29        ROPE_END                                      7  ~36     ~37, !0
         30        ASSIGN                                                   !4, ~36
   19    31        INIT_FCALL_BY_NAME                                       'mysql_query'
         32        ROPE_INIT                                     5  ~43     'select+count%28%2A%29+from+board+where+title+like+%27%25'
         33        ROPE_ADD                                      1  ~43     ~43, !3
         34        ROPE_ADD                                      2  ~43     ~43, '%25%27+or+content+like+%27%25'
         35        ROPE_ADD                                      3  ~43     ~43, !3
         36        ROPE_END                                      4  ~42     ~43, '%25%27'
         37        SEND_VAL_EX                                              ~42
         38        SEND_VAR_EX                                              !6
         39        DO_FCALL                                      0  $46     
         40        ASSIGN                                                   !5, $46
         41      > JMP                                                      ->52
   21    42    >   ROPE_INIT                                     4  ~49     'select+%2A+from+board+order+by+id+desc+limit+'
         43        ROPE_ADD                                      1  ~49     ~49, !2
         44        ROPE_ADD                                      2  ~49     ~49, '%2C+'
         45        ROPE_END                                      3  ~48     ~49, !0
         46        ASSIGN                                                   !4, ~48
   22    47        INIT_FCALL_BY_NAME                                       'mysql_query'
         48        SEND_VAL_EX                                              'select+count%28%2A%29+from+board'
         49        SEND_VAR_EX                                              !6
         50        DO_FCALL                                      0  $52     
         51        ASSIGN                                                   !5, $52
   24    52    >   NOP                                                      
         53        FAST_CONCAT                                      ~54     !4, '%3Cbr%3E%3Cbr%3E%3Cbr%3E'
         54        ECHO                                                     ~54
   25    55        INIT_FCALL_BY_NAME                                       'mysql_query'
         56        SEND_VAR_EX                                              !4
         57        SEND_VAR_EX                                              !6
         58        DO_FCALL                                      0  $55     
         59        ASSIGN                                                   !7, $55
   27    60        INIT_FCALL_BY_NAME                                       'mysql_fetch_row'
         61        SEND_VAR_EX                                              !5
         62        DO_FCALL                                      0  $57     
         63        ASSIGN                                                   !8, $57
   28    64        FETCH_DIM_R                                      ~59     !8, 0
         65        ASSIGN                                                   !9, ~59
   30    66        IS_SMALLER_OR_EQUAL                                      !9, 0
         67      > JMPZ                                                     ~61, ->69
         68    >   ASSIGN                                                   !9, 0
   31    69    >   INIT_FCALL                                               'ceil'
         70        DIV                                              ~63     !9, !0
         71        SEND_VAL                                                 ~63
         72        DO_ICALL                                         $64     
         73        ASSIGN                                                   !10, $64
   33    74        INIT_FCALL                                               'ceil'
         75        ADD                                              ~66     !2, 1
         76        DIV                                              ~67     ~66, !0
         77        SEND_VAL                                                 ~67
         78        DO_ICALL                                         $68     
         79        ASSIGN                                                   !11, $68
   36    80        ECHO                                                     '%3Chtml%3E%0A%3Chead%3E%0A%3Ctitle%3Eboard%3C%2Ftitle%3E%0A%3Cbr%3E%0A%3Ctable%3E%0A%3Ctr%3E%0A%3Ctd%3E%3Ca+font+size%3D2%3Eyeonghoo2.com%3C%2Fa%3E%3C%2Ftd%3E%0A%3Ctd+width%3D280%3E%3C%2Ftd%3E%0A%3Ctd+align%3Dleft%3E%3Cform+action%3Dlist.php+method%3Dget%3E%0A%3Cinput+type%3Dtext+name%3Dsearch%3E%0A%3Cinput+type%3Dsubmit+value%3Dsearch%3E%0A%3C%2Fform%3E%0A%3C%2Ftd%3E%0A%3Ctable+witdh%3D500+border%3D1+cellpadding%3D0+cellspacing%3D0%3E%0A%3Ctr+height%3D20%3E%0A%3Ctd+width%3D30+align%3Dcenter%3Eno%3C%2Ftd%3E%0A%3Ctd+width%3D370+align%3Dcenter%3Etitle%3C%2Ftd%3E%0A%3Ctd+width%3D50+align%3Dcenter%3Euser%3C%2Ftd%3E%0A%3Ctd+width%3D60+align%3Dcenter%3Edate%3C%2Ftd%3E%0A%3Ctd+width%3D40+align%3Dcenter%3Eview%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A'
   58    81      > JMP                                                      ->123
   60    82    >   ECHO                                                     '%3Ctr%3E%0A%3Ctd+height%3D20+align%3Dcenter%3E%0A%3Ca+href%3D%22read.php%3Fid%3D'
   62    83        FETCH_CONSTANT                                   ~70     'id'
         84        FETCH_DIM_R                                      ~71     !12, ~70
         85        ECHO                                                     ~71
         86        ECHO                                                     '%26no%3D'
         87        ECHO                                                     !2
         88        ECHO                                                     '%22%3E%0A'
   63    89        FETCH_CONSTANT                                   ~72     'id'
         90        FETCH_DIM_R                                      ~73     !12, ~72
         91        ECHO                                                     ~73
         92        ECHO                                                     '%3C%2Fa%3E%0A%3C%2Ftd%3E%0A%3Ctd+height%3D20%3E%26nbsp%3B%3Ca+href%3D%22read.php%3Fid%3D'
   65    93        FETCH_CONSTANT                                   ~74     'id'
         94        FETCH_DIM_R                                      ~75     !12, ~74
         95        ECHO                                                     ~75
         96        ECHO                                                     '%26no%3D'
         97        ECHO                                                     !2
         98        ECHO                                                     '%22%3E%0A'
   66    99        INIT_FCALL                                               'strip_tags'
        100        FETCH_CONSTANT                                   ~76     'title'
        101        FETCH_DIM_R                                      ~77     !12, ~76
        102        SEND_VAL                                                 ~77
        103        SEND_VAL                                                 '%3Cb%3E%3Ci%3E'
        104        DO_ICALL                                         $78     
        105        ECHO                                                     $78
        106        ECHO                                                     '%3C%2Fa%3E%0A%3C%2Ftd%3E%0A%3Ctd+align%3Dcenter+height%3D20%3E%0A%3Ca+href%3D%22mailto%3A'
   69   107        FETCH_CONSTANT                                   ~79     'email'
        108        FETCH_DIM_R                                      ~80     !12, ~79
        109        ECHO                                                     ~80
        110        ECHO                                                     '%22%3E%0A'
   70   111        FETCH_CONSTANT                                   ~81     'name'
        112        FETCH_DIM_R                                      ~82     !12, ~81
        113        ECHO                                                     ~82
        114        ECHO                                                     '%3C%2Fa%3E%0A%3C%2Ftd%3E%0A%3Ctd+align%3Dcenter+height%3D20%3E'
   72   115        FETCH_CONSTANT                                   ~83     'wdate'
        116        FETCH_DIM_R                                      ~84     !12, ~83
        117        ECHO                                                     ~84
   73   118        ECHO                                                     '%3C%2Ftd%3E%0A%3Ctd+align%3Dcenter+height%3D20%3E'
   74   119        FETCH_CONSTANT                                   ~85     'view'
        120        FETCH_DIM_R                                      ~86     !12, ~85
        121        ECHO                                                     ~86
   75   122        ECHO                                                     '%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A'
   58   123    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        124        SEND_VAR_EX                                              !7
        125        DO_FCALL                                      0  $87     
        126        ASSIGN                                           ~88     !12, $87
        127      > JMPNZ                                                    ~88, ->82
   79   128    >   INIT_FCALL_BY_NAME                                       'mysql_close'
        129        SEND_VAR_EX                                              !6
        130        DO_FCALL                                      0          
   81   131        ECHO                                                     '%3C%2Ftable%3E%0A%3Ctable+border%3D0%3E%0A%3Ctr%3E%0A%3Ctd+width%3D600+height%3D20+align%3Dcenter+rowspan%3D4%3E%0A'
   86   132        INIT_FCALL                                               'floor'
        133        SUB                                              ~90     !11, 1
        134        DIV                                              ~91     ~90, !1
        135        SEND_VAL                                                 ~91
        136        DO_ICALL                                         $92     
        137        MUL                                              ~93     !1, $92
        138        ADD                                              ~94     ~93, 1
        139        ASSIGN                                                   !13, ~94
   87   140        ADD                                              ~96     !13, !1
        141        SUB                                              ~97     ~96, 1
        142        ASSIGN                                                   !14, ~97
   89   143        IS_SMALLER                                               !10, !14
        144      > JMPZ                                                     ~99, ->146
        145    >   ASSIGN                                                   !14, !10
   90   146    >   FETCH_CONSTANT                                   ~101    'start_page'
        147        IS_SMALLER_OR_EQUAL                                      !1, ~101
        148      > JMPZ                                                     ~102, ->156
   91   149    >   SUB                                              ~103    !13, 2
        150        MUL                                              ~104    !0, ~103
        151        ASSIGN                                                   !15, ~104
   92   152        ROPE_INIT                                     3  ~107    '%3Ca+href%3D%27'
        153        ROPE_ADD                                      1  ~107    ~107, !16
        154        ROPE_END                                      2  ~106    ~107, '%3Fno%3Dprev_list%27%3E%3C%3C%2Fa%3E'
        155        ECHO                                                     ~106
   95   156    >   ASSIGN                                                   !17, !13
        157      > JMP                                                      ->187
   96   158    >   SUB                                              ~110    !17, 1
        159        MUL                                              ~111    !0, ~110
        160        ASSIGN                                                   !18, ~111
   97   161        IS_NOT_EQUAL                                             !2, !18
        162      > JMPZ                                                     ~113, ->180
   98   163    >   BOOL_NOT                                         ~114    !3
        164      > JMPZ                                                     ~114, ->172
   99   165    >   ROPE_INIT                                     5  ~116    '%3Ca+href%3D%27'
        166        ROPE_ADD                                      1  ~116    ~116, !16
        167        ROPE_ADD                                      2  ~116    ~116, '%3Fno%3D'
        168        ROPE_ADD                                      3  ~116    ~116, !18
        169        ROPE_END                                      4  ~115    ~116, '%27%3E'
        170        ECHO                                                     ~115
        171      > JMP                                                      ->180
  101   172    >   ROPE_INIT                                     7  ~120    '%3Ca+href%3D%27'
        173        ROPE_ADD                                      1  ~120    ~120, !16
        174        ROPE_ADD                                      2  ~120    ~120, '%3Fno%3D'
        175        ROPE_ADD                                      3  ~120    ~120, !18
        176        ROPE_ADD                                      4  ~120    ~120, '%26search%3D'
        177        ROPE_ADD                                      5  ~120    ~120, !3
        178        ROPE_END                                      6  ~119    ~120, '%27%3E'
        179        ECHO                                                     ~119
  104   180    >   NOP                                                      
        181        FAST_CONCAT                                      ~124    !17, '%26nbsp%3B'
        182        ECHO                                                     ~124
  105   183        IS_NOT_EQUAL                                             !2, !18
        184      > JMPZ                                                     ~125, ->186
  106   185    >   ECHO                                                     '%3C%2Fa%3E'
   95   186    >   PRE_INC                                                  !17
        187    >   IS_SMALLER_OR_EQUAL                                      !17, !14
        188      > JMPNZ                                                    ~127, ->158
  109   189    >   IS_SMALLER                                               !14, !10
        190      > JMPZ                                                     ~128, ->199
  110   191    >   MUL                                              ~129    !14, !0
        192        ASSIGN                                                   !19, ~129
  111   193        ROPE_INIT                                     5  ~132    '%3Ca+href%3D'
        194        ROPE_ADD                                      1  ~132    ~132, !16
        195        ROPE_ADD                                      2  ~132    ~132, '%3Fno%3D'
        196        ROPE_ADD                                      3  ~132    ~132, !19
        197        ROPE_END                                      4  ~131    ~132, '%3E%3E%3C%2Fa%3E%3Cp%3E'
        198        ECHO                                                     ~131
  114   199    >   ECHO                                                     '%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A%3C%2Ftable%3E%0A%3Ca+href%3Dwrite.php%3Ewrite%3C%2Fa%3E%0A%3Ca+href%3Dlogout.php%3Elogout%3C%2Fa%3E%0A%3C%2Fcenter%3E%0A'
  121   200        FETCH_R                      global              ~135    '_COOKIE'
        201        FETCH_DIM_R                                      ~136    ~135, 'level'
        202        IS_EQUAL                                                 ~136, 99
        203      > JMPZ                                                     ~137, ->205
  122   204    >   ECHO                                                     '%3Ca+href%3Dadm.php%3Eadminpage%3C%2Fa%3E'
  125   205    >   ECHO                                                     '%3C%2Fhtml%3E'
        206      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.99 ms | 1416 KiB | 19 Q