3v4l.org

run code in 300+ PHP versions simultaneously
<Html> <Head> <Title>登録状況確認</Title> </Head> <Body> <?php session_start(); // セッションを開始 // 管理者かどうかを$_SESSION["user_class"]により確認 // ログインせず直接アクセスした場合(内容未定) if( $_SESSION["user_class"] == ""){ } // 一般ユーザが直接アクセスした場合(内容未定) elseif( $_SESSION["user_class"] == "0"){ } // 管理者がアクセスした場合(以下の処理を開始) elseif( $_SESSION["user_class"] == "1"){ // ホーム画面からイベントIDを引き継ぎ(未完成) //(ホームでも$_SESSION["event_id"]を使ってもらえば再定義不要?) $_SESSION["event_id"] = 002; // 仮の数値 // DB $url = "localhost"; $user = "root"; $pass = ""; $db = "test"; // MySQLへ接続する $link = mysql_connect($url,$user,$pass) or die("MySQLへの接続に失敗しました。"); // データベースを選択する $sdb = mysql_select_db($db,$link) or die("データベースの選択に失敗しました。"); // クエリを送信する // ①イベント名の取得…ホーム画面から引き継いだイベントIDの列を選択、event_nameを取得 $sql = "select event_title from event "; $sql.= "where event_id= " . $_SESSION["event_id"] ; $result = mysql_query($sql, $link) or die("クエリの送信に失敗しました。<br/>SQL:".$sql); $row = mysql_fetch_assoc($result); $event_title = $row["event_title"]; // イベントタイトル表示 echo $event_title; //HTML文を出力 テーブルの開始を指定 print("<table border=1><tr><td></td>"); // 日付 //calenderからdate_idの一致する列を選択 $sql = "SELECT date, except FROM calendar "; $sql .="WHERE event_id =002 ORDER BY date_id"; //SQL文を実行する $rs = mysql_db_query($db,$sql); //列数を取得する $num = mysql_num_fields($rs); //選択した列数分だけ繰り返す while($row=mysql_fetch_array($rs)){ //HTML文を出力 日付を <td>で囲んで出力 print("<td>".date( 'm月d日', $row["date"] )."</td>"); } //氏名・参加可否 //ユーザID・氏名を取得 $sql ="select user_name from user "; $sql.="order by user_id"; //test表の行数と同じ回数を繰り返す while($row=mysql_fetch_array($rs)){ //HTML文を出力 表の行の開始<tr> を出力 氏名 print("<tr>".$row["user_name"]."</tr>"); //attendからユーザIDの一致する列を取得 $sql ="select attendance from attend "; $sql.="where user_id=".$row["user_name"]; $sql.="order by date_id"; //日数分( と同じ回数)繰り返す  for($j=0;$j<$num;$j++){ //HTML文を出力 列の内容を <td>で囲んで出力+参加可否(0=×、1=△、2=○) print("<td>".$row[$j]."</td>"); } //HTML文を出力 表の改行</tr> を出力 print("</tr>"); } //HTML文を出力 テーブルの終了を指定 print("</table>"); // MySQLへの接続を閉じる mysql_close($link) or die("MySQL切断に失敗しました。"); } //管理者アクセスの動作、ここまで ?> <br> <button type="button" onclick="location.href='top.php'">ホームへ戻る</button> </Body> </Html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 122
Branch analysis from position: 122
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 122
Branch analysis from position: 122
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 122
Branch analysis from position: 17
2 jumps found. (Code = 47) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 47) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 47) Position 1 = 52, Position 2 = 55
Branch analysis from position: 52
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
2 jumps found. (Code = 44) Position 1 = 88, Position 2 = 75
Branch analysis from position: 88
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
2 jumps found. (Code = 44) Position 1 = 115, Position 2 = 91
Branch analysis from position: 115
2 jumps found. (Code = 47) Position 1 = 120, Position 2 = 122
Branch analysis from position: 120
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 122
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 107
Branch analysis from position: 107
2 jumps found. (Code = 44) Position 1 = 109, Position 2 = 102
Branch analysis from position: 109
2 jumps found. (Code = 44) Position 1 = 115, Position 2 = 91
Branch analysis from position: 115
Branch analysis from position: 91
Branch analysis from position: 102
2 jumps found. (Code = 44) Position 1 = 109, Position 2 = 102
Branch analysis from position: 109
Branch analysis from position: 102
Branch analysis from position: 75
2 jumps found. (Code = 44) Position 1 = 88, Position 2 = 75
Branch analysis from position: 88
Branch analysis from position: 75
Branch analysis from position: 122
filename:       /in/LRt37
function name:  (null)
number of ops:  124
compiled vars:  !0 = $url, !1 = $user, !2 = $pass, !3 = $db, !4 = $link, !5 = $sdb, !6 = $sql, !7 = $result, !8 = $row, !9 = $event_title, !10 = $rs, !11 = $num, !12 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3CHtml%3E%0A%3CHead%3E%0A%3CTitle%3E%E7%99%BB%E9%8C%B2%E7%8A%B6%E6%B3%81%E7%A2%BA%E8%AA%8D%3C%2FTitle%3E%0A%3C%2FHead%3E%0A%3CBody%3E%0A%0A'
    8     1        INIT_FCALL                                               'session_start'
          2        DO_ICALL                                                 
   13     3        FETCH_R                      global              ~14     '_SESSION'
          4        FETCH_DIM_R                                      ~15     ~14, 'user_class'
          5        IS_EQUAL                                                 ~15, ''
          6      > JMPZ                                                     ~16, ->8
          7    > > JMP                                                      ->122
   17     8    >   FETCH_R                      global              ~17     '_SESSION'
          9        FETCH_DIM_R                                      ~18     ~17, 'user_class'
         10        IS_EQUAL                                                 ~18, '0'
         11      > JMPZ                                                     ~19, ->13
         12    > > JMP                                                      ->122
   21    13    >   FETCH_R                      global              ~20     '_SESSION'
         14        FETCH_DIM_R                                      ~21     ~20, 'user_class'
         15        IS_EQUAL                                                 ~21, '1'
         16      > JMPZ                                                     ~22, ->122
   25    17    >   FETCH_W                      global              $23     '_SESSION'
         18        ASSIGN_DIM                                               $23, 'event_id'
         19        OP_DATA                                                  2
   29    20        ASSIGN                                                   !0, 'localhost'
   30    21        ASSIGN                                                   !1, 'root'
   31    22        ASSIGN                                                   !2, ''
   32    23        ASSIGN                                                   !3, 'test'
   35    24        INIT_FCALL_BY_NAME                                       'mysql_connect'
         25        SEND_VAR_EX                                              !0
         26        SEND_VAR_EX                                              !1
         27        SEND_VAR_EX                                              !2
         28        DO_FCALL                                      0  $29     
         29        ASSIGN                                           ~30     !4, $29
         30      > JMPNZ_EX                                         ~30     ~30, ->33
         31    > > EXIT                                                     'MySQL%E3%81%B8%E3%81%AE%E6%8E%A5%E7%B6%9A%E3%81%AB%E5%A4%B1%E6%95%97%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82'
         32*       BOOL                                             ~30     <true>
   38    33    >   INIT_FCALL_BY_NAME                                       'mysql_select_db'
         34        SEND_VAR_EX                                              !3
         35        SEND_VAR_EX                                              !4
         36        DO_FCALL                                      0  $31     
         37        ASSIGN                                           ~32     !5, $31
         38      > JMPNZ_EX                                         ~32     ~32, ->41
         39    > > EXIT                                                     '%E3%83%87%E3%83%BC%E3%82%BF%E3%83%99%E3%83%BC%E3%82%B9%E3%81%AE%E9%81%B8%E6%8A%9E%E3%81%AB%E5%A4%B1%E6%95%97%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82'
         40*       BOOL                                             ~32     <true>
   42    41    >   ASSIGN                                                   !6, 'select+event_title+from+event+'
   43    42        FETCH_R                      global              ~34     '_SESSION'
         43        FETCH_DIM_R                                      ~35     ~34, 'event_id'
         44        CONCAT                                           ~36     'where+event_id%3D+', ~35
         45        ASSIGN_OP                                     8          !6, ~36
   45    46        INIT_FCALL_BY_NAME                                       'mysql_query'
         47        SEND_VAR_EX                                              !6
         48        SEND_VAR_EX                                              !4
         49        DO_FCALL                                      0  $38     
         50        ASSIGN                                           ~39     !7, $38
         51      > JMPNZ_EX                                         ~39     ~39, ->55
         52    >   CONCAT                                           ~40     '%E3%82%AF%E3%82%A8%E3%83%AA%E3%81%AE%E9%80%81%E4%BF%A1%E3%81%AB%E5%A4%B1%E6%95%97%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3Cbr%2F%3ESQL%3A', !6
         53      > EXIT                                                     ~40
         54*       BOOL                                             ~39     <true>
   46    55    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_assoc'
         56        SEND_VAR_EX                                              !7
         57        DO_FCALL                                      0  $41     
         58        ASSIGN                                                   !8, $41
   47    59        FETCH_DIM_R                                      ~43     !8, 'event_title'
         60        ASSIGN                                                   !9, ~43
   50    61        ECHO                                                     !9
   54    62        ECHO                                                     '%3Ctable+border%3D1%3E%3Ctr%3E%3Ctd%3E%3C%2Ftd%3E'
   58    63        ASSIGN                                                   !6, 'SELECT+date%2C+except+FROM+calendar+'
   59    64        ASSIGN_OP                                     8          !6, 'WHERE+event_id+%3D002+ORDER+BY+date_id'
   62    65        INIT_FCALL_BY_NAME                                       'mysql_db_query'
         66        SEND_VAR_EX                                              !3
         67        SEND_VAR_EX                                              !6
         68        DO_FCALL                                      0  $47     
         69        ASSIGN                                                   !10, $47
   65    70        INIT_FCALL_BY_NAME                                       'mysql_num_fields'
         71        SEND_VAR_EX                                              !10
         72        DO_FCALL                                      0  $49     
         73        ASSIGN                                                   !11, $49
   68    74      > JMP                                                      ->83
   71    75    >   INIT_FCALL                                               'date'
         76        SEND_VAL                                                 'm%E6%9C%88d%E6%97%A5'
         77        FETCH_DIM_R                                      ~51     !8, 'date'
         78        SEND_VAL                                                 ~51
         79        DO_ICALL                                         $52     
         80        CONCAT                                           ~53     '%3Ctd%3E', $52
         81        CONCAT                                           ~54     ~53, '%3C%2Ftd%3E'
         82        ECHO                                                     ~54
   68    83    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         84        SEND_VAR_EX                                              !10
         85        DO_FCALL                                      0  $55     
         86        ASSIGN                                           ~56     !8, $55
         87      > JMPNZ                                                    ~56, ->75
   77    88    >   ASSIGN                                                   !6, 'select+user_name+from+user+'
   78    89        ASSIGN_OP                                     8          !6, 'order+by+user_id'
   81    90      > JMP                                                      ->110
   84    91    >   FETCH_DIM_R                                      ~59     !8, 'user_name'
         92        CONCAT                                           ~60     '%3Ctr%3E', ~59
         93        CONCAT                                           ~61     ~60, '%3C%2Ftr%3E'
         94        ECHO                                                     ~61
   87    95        ASSIGN                                                   !6, 'select+attendance+from+attend+'
   88    96        FETCH_DIM_R                                      ~63     !8, 'user_name'
         97        CONCAT                                           ~64     'where+user_id%3D', ~63
         98        ASSIGN_OP                                     8          !6, ~64
   89    99        ASSIGN_OP                                     8          !6, 'order+by+date_id'
   92   100        ASSIGN                                                   !12, 0
        101      > JMP                                                      ->107
   95   102    >   FETCH_DIM_R                                      ~68     !8, !12
        103        CONCAT                                           ~69     '%3Ctd%3E', ~68
        104        CONCAT                                           ~70     ~69, '%3C%2Ftd%3E'
        105        ECHO                                                     ~70
   92   106        PRE_INC                                                  !12
        107    >   IS_SMALLER                                               !12, !11
        108      > JMPNZ                                                    ~72, ->102
   99   109    >   ECHO                                                     '%3C%2Ftr%3E'
   81   110    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        111        SEND_VAR_EX                                              !10
        112        DO_FCALL                                      0  $73     
        113        ASSIGN                                           ~74     !8, $73
        114      > JMPNZ                                                    ~74, ->91
  103   115    >   ECHO                                                     '%3C%2Ftable%3E'
  106   116        INIT_FCALL_BY_NAME                                       'mysql_close'
        117        SEND_VAR_EX                                              !4
        118        DO_FCALL                                      0  $75     
        119      > JMPNZ_EX                                         ~76     $75, ->122
        120    > > EXIT                                                     'MySQL%E5%88%87%E6%96%AD%E3%81%AB%E5%A4%B1%E6%95%97%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82'
        121*       BOOL                                             ~76     <true>
  112   122    >   ECHO                                                     '%0A%3Cbr%3E%0A%3Cbutton+type%3D%22button%22+onclick%3D%22location.href%3D%27top.php%27%22%3E%E3%83%9B%E3%83%BC%E3%83%A0%E3%81%B8%E6%88%BB%E3%82%8B%3C%2Fbutton%3E%0A%0A%3C%2FBody%3E%0A%3C%2FHtml%3E'
  117   123      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.98 ms | 1408 KiB | 17 Q