3v4l.org

run code in 300+ PHP versions simultaneously
<?php // connect to database //db_host = "localhost" ; $db_name = "maffeij_art" ; //$db_user = "maffeij" ; //$db_password = "a1yorkie" ; //@ $db = mysql_pconnect('localhost','maffeij_maffeij','sheepish1986'); $db = mysqli_connect('localhost', 'maffeij_maffeij', 'sheepish1986', 'maffeij_art'); if(!$db) { echo 'Could not connect to the database'; exit; } // select table mysql_select_db ('maffeij_art'); // see if we should be showing the category or the sub category $sub = trim($_POST['sub']); if(empty($sub)) { // we didn't come from an edit record, we came from a results page // so grab the id appended to the url $sub = $_GET['sub']; } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>Contents</title> </head> <!-- <body text="#000000" link="#666666" vlink="#808080" alink="#000000" bgcolor="#CCCCCC"> --> <body text="#000000" link="#666666" vlink="#808080" alink="#000000" bgcolor="#666666"> <p align="center">&nbsp;</p> <p align="center"> <?php if($sub == '') { echo "<a href='detail.php?id=179&home=1' target ='mainframe'><img border='0' src='images/home.gif' width='140' height='40'></a>"; } else { //echo "<a href='contents.php' target ='menuframe'><img border='0' src='images/back.gif' width='140' height='40'></a>"; echo "<a href='contents.php'><img border='0' src='images/return.gif' width='140' height='40'></a>"; } echo "<img border='0' src='images/line.gif'>"; if($sub == '') { $query = 'select * from category order by catorder'; } else { $query = "select * from subcategory where parentid = ".$sub." order by subcatorder"; } $result = mysql_query($query); $num_results = mysql_num_rows($result); for($i=0; $i < $num_results; $i++) { $row = mysql_fetch_array($result); $id = htmlspecialchars(stripslashes($row['id'])); $parentid = htmlspecialchars(stripslashes($row['parentid'])); $name = htmlspecialchars(stripslashes($row['name'])); $url = htmlspecialchars(stripslashes($row['url'])); $image = htmlspecialchars(stripslashes($row['image'])); $target = htmlspecialchars(stripslashes($row['target'])); if($image != '') { if($url != '') { if($target == '') { echo "<a href='$url'><img border='0' src='images/$image' width='140' height='40'></a>"; } else { echo "<a href='$url' target = '$target'><img border='0' src='images/$image' width='140' height='40'></a>"; } } else { echo "<img border='0' src='images/$image' width='140' height='40'>"; } } else { if($url != '') { if($target == '') { echo "<a href='$url'>".$name."</a>"; } else { echo "<font color='#666666' size='1' face='Arial Special G1'><a href='$url' target = '$target'>".$name."</a>"; } } else { echo $name; } } //echo $name; } ?> <!-- <base target="mainframe"> <CENTER> <form action="browse.php" method="post"> &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="keyword" SIZE="10"> &nbsp;&nbsp;&nbsp;&nbsp;<input type="image" src="images/search.gif"> </form> </CENTER> <p align="center">&nbsp;</p> --> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 151
Branch analysis from position: 151
2 jumps found. (Code = 44) Position 1 = 153, Position 2 = 50
Branch analysis from position: 153
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 104, Position 2 = 129
Branch analysis from position: 104
2 jumps found. (Code = 43) Position 1 = 106, Position 2 = 124
Branch analysis from position: 106
2 jumps found. (Code = 43) Position 1 = 108, Position 2 = 115
Branch analysis from position: 108
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
2 jumps found. (Code = 44) Position 1 = 153, Position 2 = 50
Branch analysis from position: 153
Branch analysis from position: 50
Branch analysis from position: 115
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 124
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
Branch analysis from position: 129
2 jumps found. (Code = 43) Position 1 = 131, Position 2 = 149
Branch analysis from position: 131
2 jumps found. (Code = 43) Position 1 = 133, Position 2 = 140
Branch analysis from position: 133
1 jumps found. (Code = 42) Position 1 = 148
Branch analysis from position: 148
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
Branch analysis from position: 140
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
Branch analysis from position: 149
2 jumps found. (Code = 44) Position 1 = 153, Position 2 = 50
Branch analysis from position: 153
Branch analysis from position: 50
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 151
Branch analysis from position: 151
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
Branch analysis from position: 37
Branch analysis from position: 26
filename:       /in/74FGD
function name:  (null)
number of ops:  155
compiled vars:  !0 = $db_name, !1 = $db, !2 = $sub, !3 = $query, !4 = $result, !5 = $num_results, !6 = $i, !7 = $row, !8 = $id, !9 = $parentid, !10 = $name, !11 = $url, !12 = $image, !13 = $target
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'maffeij_art'
   14     1        INIT_FCALL_BY_NAME                                       'mysqli_connect'
          2        SEND_VAL_EX                                              'localhost'
          3        SEND_VAL_EX                                              'maffeij_maffeij'
          4        SEND_VAL_EX                                              'sheepish1986'
          5        SEND_VAL_EX                                              'maffeij_art'
          6        DO_FCALL                                      0  $15     
          7        ASSIGN                                                   !1, $15
   17     8        BOOL_NOT                                         ~17     !1
          9      > JMPZ                                                     ~17, ->12
   21    10    >   ECHO                                                     'Could+not+connect+to+the+database'
   23    11      > EXIT                                                     
   29    12    >   INIT_FCALL_BY_NAME                                       'mysql_select_db'
         13        SEND_VAL_EX                                              'maffeij_art'
         14        DO_FCALL                                      0          
   35    15        INIT_FCALL                                               'trim'
         16        FETCH_R                      global              ~19     '_POST'
         17        FETCH_DIM_R                                      ~20     ~19, 'sub'
         18        SEND_VAL                                                 ~20
         19        DO_ICALL                                         $21     
         20        ASSIGN                                                   !2, $21
   37    21        ISSET_ISEMPTY_CV                                         !2
         22      > JMPZ                                                     ~23, ->26
   45    23    >   FETCH_R                      global              ~24     '_GET'
         24        FETCH_DIM_R                                      ~25     ~24, 'sub'
         25        ASSIGN                                                   !2, ~25
   50    26    >   ECHO                                                     '%0A%0A%3Chtml%3E%0A%0A%3Chead%3E%0A%0A%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3B+charset%3Dwindows-1252%22%3E%0A%0A%3Cmeta+name%3D%22GENERATOR%22+content%3D%22Microsoft+FrontPage+4.0%22%3E%0A%0A%3Cmeta+name%3D%22ProgId%22+content%3D%22FrontPage.Editor.Document%22%3E%0A%0A%3Ctitle%3EContents%3C%2Ftitle%3E%0A%0A%3C%2Fhead%3E%0A%0A%3C%21--+%3Cbody+text%3D%22%23000000%22+link%3D%22%23666666%22+vlink%3D%22%23808080%22+alink%3D%22%23000000%22+bgcolor%3D%22%23CCCCCC%22%3E+--%3E%0A%3Cbody+text%3D%22%23000000%22+link%3D%22%23666666%22+vlink%3D%22%23808080%22+alink%3D%22%23000000%22+bgcolor%3D%22%23666666%22%3E%0A%0A%3Cp+align%3D%22center%22%3E%26nbsp%3B%3C%2Fp%3E%0A%0A%3Cp+align%3D%22center%22%3E%0A%0A%0A'
   77    27        IS_EQUAL                                                 !2, ''
         28      > JMPZ                                                     ~27, ->31
   81    29    >   ECHO                                                     '%3Ca+href%3D%27detail.php%3Fid%3D179%26home%3D1%27+target+%3D%27mainframe%27%3E%3Cimg+border%3D%270%27+src%3D%27images%2Fhome.gif%27+width%3D%27140%27+height%3D%2740%27%3E%3C%2Fa%3E'
         30      > JMP                                                      ->32
   91    31    >   ECHO                                                     '%3Ca+href%3D%27contents.php%27%3E%3Cimg+border%3D%270%27+src%3D%27images%2Freturn.gif%27+width%3D%27140%27+height%3D%2740%27%3E%3C%2Fa%3E'
   95    32    >   ECHO                                                     '%3Cimg+border%3D%270%27+src%3D%27images%2Fline.gif%27%3E'
   98    33        IS_EQUAL                                                 !2, ''
         34      > JMPZ                                                     ~28, ->37
  102    35    >   ASSIGN                                                   !3, 'select+%2A+from+category+order+by+catorder'
         36      > JMP                                                      ->40
  110    37    >   CONCAT                                           ~30     'select+%2A+from+subcategory+where+parentid+%3D+', !2
         38        CONCAT                                           ~31     ~30, '+order+by+subcatorder'
         39        ASSIGN                                                   !3, ~31
  115    40    >   INIT_FCALL_BY_NAME                                       'mysql_query'
         41        SEND_VAR_EX                                              !3
         42        DO_FCALL                                      0  $33     
         43        ASSIGN                                                   !4, $33
  117    44        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         45        SEND_VAR_EX                                              !4
         46        DO_FCALL                                      0  $35     
         47        ASSIGN                                                   !5, $35
  120    48        ASSIGN                                                   !6, 0
         49      > JMP                                                      ->151
  124    50    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         51        SEND_VAR_EX                                              !4
         52        DO_FCALL                                      0  $38     
         53        ASSIGN                                                   !7, $38
  127    54        INIT_FCALL                                               'htmlspecialchars'
         55        INIT_FCALL                                               'stripslashes'
         56        FETCH_DIM_R                                      ~40     !7, 'id'
         57        SEND_VAL                                                 ~40
         58        DO_ICALL                                         $41     
         59        SEND_VAR                                                 $41
         60        DO_ICALL                                         $42     
         61        ASSIGN                                                   !8, $42
  129    62        INIT_FCALL                                               'htmlspecialchars'
         63        INIT_FCALL                                               'stripslashes'
         64        FETCH_DIM_R                                      ~44     !7, 'parentid'
         65        SEND_VAL                                                 ~44
         66        DO_ICALL                                         $45     
         67        SEND_VAR                                                 $45
         68        DO_ICALL                                         $46     
         69        ASSIGN                                                   !9, $46
  131    70        INIT_FCALL                                               'htmlspecialchars'
         71        INIT_FCALL                                               'stripslashes'
         72        FETCH_DIM_R                                      ~48     !7, 'name'
         73        SEND_VAL                                                 ~48
         74        DO_ICALL                                         $49     
         75        SEND_VAR                                                 $49
         76        DO_ICALL                                         $50     
         77        ASSIGN                                                   !10, $50
  133    78        INIT_FCALL                                               'htmlspecialchars'
         79        INIT_FCALL                                               'stripslashes'
         80        FETCH_DIM_R                                      ~52     !7, 'url'
         81        SEND_VAL                                                 ~52
         82        DO_ICALL                                         $53     
         83        SEND_VAR                                                 $53
         84        DO_ICALL                                         $54     
         85        ASSIGN                                                   !11, $54
  135    86        INIT_FCALL                                               'htmlspecialchars'
         87        INIT_FCALL                                               'stripslashes'
         88        FETCH_DIM_R                                      ~56     !7, 'image'
         89        SEND_VAL                                                 ~56
         90        DO_ICALL                                         $57     
         91        SEND_VAR                                                 $57
         92        DO_ICALL                                         $58     
         93        ASSIGN                                                   !12, $58
  137    94        INIT_FCALL                                               'htmlspecialchars'
         95        INIT_FCALL                                               'stripslashes'
         96        FETCH_DIM_R                                      ~60     !7, 'target'
         97        SEND_VAL                                                 ~60
         98        DO_ICALL                                         $61     
         99        SEND_VAR                                                 $61
        100        DO_ICALL                                         $62     
        101        ASSIGN                                                   !13, $62
  140   102        IS_NOT_EQUAL                                             !12, ''
        103      > JMPZ                                                     ~64, ->129
  144   104    >   IS_NOT_EQUAL                                             !11, ''
        105      > JMPZ                                                     ~65, ->124
  148   106    >   IS_EQUAL                                                 !13, ''
        107      > JMPZ                                                     ~66, ->115
  152   108    >   ROPE_INIT                                     5  ~68     '%3Ca+href%3D%27'
        109        ROPE_ADD                                      1  ~68     ~68, !11
        110        ROPE_ADD                                      2  ~68     ~68, '%27%3E%3Cimg+border%3D%270%27+src%3D%27images%2F'
        111        ROPE_ADD                                      3  ~68     ~68, !12
        112        ROPE_END                                      4  ~67     ~68, '%27+width%3D%27140%27+height%3D%2740%27%3E%3C%2Fa%3E'
        113        ECHO                                                     ~67
        114      > JMP                                                      ->123
  160   115    >   ROPE_INIT                                     7  ~72     '%3Ca+href%3D%27'
        116        ROPE_ADD                                      1  ~72     ~72, !11
        117        ROPE_ADD                                      2  ~72     ~72, '%27+target+%3D+%27'
        118        ROPE_ADD                                      3  ~72     ~72, !13
        119        ROPE_ADD                                      4  ~72     ~72, '%27%3E%3Cimg+border%3D%270%27+src%3D%27images%2F'
        120        ROPE_ADD                                      5  ~72     ~72, !12
        121        ROPE_END                                      6  ~71     ~72, '%27+width%3D%27140%27+height%3D%2740%27%3E%3C%2Fa%3E'
        122        ECHO                                                     ~71
        123    > > JMP                                                      ->128
  170   124    >   ROPE_INIT                                     3  ~77     '%3Cimg+border%3D%270%27+src%3D%27images%2F'
        125        ROPE_ADD                                      1  ~77     ~77, !12
        126        ROPE_END                                      2  ~76     ~77, '%27+width%3D%27140%27+height%3D%2740%27%3E'
        127        ECHO                                                     ~76
        128    > > JMP                                                      ->150
  180   129    >   IS_NOT_EQUAL                                             !11, ''
        130      > JMPZ                                                     ~79, ->149
  184   131    >   IS_EQUAL                                                 !13, ''
        132      > JMPZ                                                     ~80, ->140
  188   133    >   ROPE_INIT                                     3  ~82     '%3Ca+href%3D%27'
        134        ROPE_ADD                                      1  ~82     ~82, !11
        135        ROPE_END                                      2  ~81     ~82, '%27%3E'
        136        CONCAT                                           ~84     ~81, !10
        137        CONCAT                                           ~85     ~84, '%3C%2Fa%3E'
        138        ECHO                                                     ~85
        139      > JMP                                                      ->148
  196   140    >   ROPE_INIT                                     5  ~87     '%3Cfont+color%3D%27%23666666%27+size%3D%271%27+face%3D%27Arial+Special+G1%27%3E%3Ca+href%3D%27'
        141        ROPE_ADD                                      1  ~87     ~87, !11
        142        ROPE_ADD                                      2  ~87     ~87, '%27+target+%3D+%27'
        143        ROPE_ADD                                      3  ~87     ~87, !13
        144        ROPE_END                                      4  ~86     ~87, '%27%3E'
        145        CONCAT                                           ~90     ~86, !10
        146        CONCAT                                           ~91     ~90, '%3C%2Fa%3E'
        147        ECHO                                                     ~91
        148    > > JMP                                                      ->150
  206   149    >   ECHO                                                     !10
  120   150    >   PRE_INC                                                  !6
        151    >   IS_SMALLER                                               !6, !5
        152      > JMPNZ                                                    ~93, ->50
  217   153    >   ECHO                                                     '%0A%0A%3C%21--+%3Cbase+target%3D%22mainframe%22%3E%0A%0A%3CCENTER%3E%0A%0A%3Cform+action%3D%22browse.php%22+method%3D%22post%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3Cinput+type%3D%22text%22+name%3D%22keyword%22+SIZE%3D%2210%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3Cinput+type%3D%22image%22+src%3D%22images%2Fsearch.gif%22%3E%0A%0A%3C%2Fform%3E%0A%0A%3C%2FCENTER%3E%0A%0A%0A%3Cp+align%3D%22center%22%3E%26nbsp%3B%3C%2Fp%3E+--%3E%0A%0A%3C%2Fbody%3E%0A%0A%0A%3C%2Fhtml%3E'
  239   154      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.68 ms | 1412 KiB | 19 Q