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"] == "2"){ } // 管理者がアクセスした場合(以下の処理を開始) elseif( $_SESSION["user_class"] == "1"){ // ホーム画面からイベントIDを引き継ぎ(未完成) //(ホームでも$_SESSION["event_id"]を使ってもらえば再定義不要) $_SESSION["event_id"] = 2; // 仮の数値 // 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("<br><br><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_rows($rs); //選択した列数分だけ繰り返す while($row=mysql_fetch_array($rs)){ //HTML文を出力 日付を <td>で囲んで出力(「○月×日」の方が良い?) print("<td>". $row["date"]. "</td>"); } //氏名・参加可否 //ユーザID・氏名を取得 $sql ="select user_name from user "; $sql.="order by user_id"; //SQL文を実行する $rs = mysql_db_query($db,$sql); //行数を取得する $num = mysql_num_rows($rs); //userの行数と同じ回数を繰り返す while($row=mysql_fetch_array($rs)){ //HTML文を出力  氏名出力 print("<tr><td>".$row["user_name"]."</td>"); //attendからユーザIDの一致する列を取得 $sql ="select attendance from attend "; $sql.="where user_id=".$row["user_name"]; $sql.="order by date_id"; //SQL文を実行する $rs = mysql_db_query($db,$sql); //行数を取得する $num = mysql_num_rows($rs); //日数分繰り返す  for($j=0;$j<$num;$j++){ //HTML文を出力 列の内容を <td>で囲んで出力+参加可否(0=×、1=△、2=○/未設定) print("<td>".$row[$attendance]."</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 = 137
Branch analysis from position: 137
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 = 137
Branch analysis from position: 137
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 137
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 = 80
Branch analysis from position: 80
2 jumps found. (Code = 44) Position 1 = 85, Position 2 = 76
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 125
Branch analysis from position: 125
2 jumps found. (Code = 44) Position 1 = 130, Position 2 = 97
Branch analysis from position: 130
2 jumps found. (Code = 47) Position 1 = 135, Position 2 = 137
Branch analysis from position: 135
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 137
Branch analysis from position: 97
1 jumps found. (Code = 42) Position 1 = 122
Branch analysis from position: 122
2 jumps found. (Code = 44) Position 1 = 124, Position 2 = 117
Branch analysis from position: 124
2 jumps found. (Code = 44) Position 1 = 130, Position 2 = 97
Branch analysis from position: 130
Branch analysis from position: 97
Branch analysis from position: 117
2 jumps found. (Code = 44) Position 1 = 124, Position 2 = 117
Branch analysis from position: 124
Branch analysis from position: 117
Branch analysis from position: 76
2 jumps found. (Code = 44) Position 1 = 85, Position 2 = 76
Branch analysis from position: 85
Branch analysis from position: 76
Branch analysis from position: 137
filename:       /in/93tb2
function name:  (null)
number of ops:  139
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, !13 = $attendance
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              ~15     '_SESSION'
          4        FETCH_DIM_R                                      ~16     ~15, 'user_class'
          5        IS_EQUAL                                                 ~16, ''
          6      > JMPZ                                                     ~17, ->8
          7    > > JMP                                                      ->137
   17     8    >   FETCH_R                      global              ~18     '_SESSION'
          9        FETCH_DIM_R                                      ~19     ~18, 'user_class'
         10        IS_EQUAL                                                 ~19, '2'
         11      > JMPZ                                                     ~20, ->13
         12    > > JMP                                                      ->137
   21    13    >   FETCH_R                      global              ~21     '_SESSION'
         14        FETCH_DIM_R                                      ~22     ~21, 'user_class'
         15        IS_EQUAL                                                 ~22, '1'
         16      > JMPZ                                                     ~23, ->137
   25    17    >   FETCH_W                      global              $24     '_SESSION'
         18        ASSIGN_DIM                                               $24, '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  $30     
         29        ASSIGN                                           ~31     !4, $30
         30      > JMPNZ_EX                                         ~31     ~31, ->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                                             ~31     <true>
   38    33    >   INIT_FCALL_BY_NAME                                       'mysql_select_db'
         34        SEND_VAR_EX                                              !3
         35        SEND_VAR_EX                                              !4
         36        DO_FCALL                                      0  $32     
         37        ASSIGN                                           ~33     !5, $32
         38      > JMPNZ_EX                                         ~33     ~33, ->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                                             ~33     <true>
   42    41    >   ASSIGN                                                   !6, 'select+event_title+from+event+'
   43    42        FETCH_R                      global              ~35     '_SESSION'
         43        FETCH_DIM_R                                      ~36     ~35, 'event_id'
         44        CONCAT                                           ~37     'where+event_id%3D+', ~36
         45        ASSIGN_OP                                     8          !6, ~37
   45    46        INIT_FCALL_BY_NAME                                       'mysql_query'
         47        SEND_VAR_EX                                              !6
         48        SEND_VAR_EX                                              !4
         49        DO_FCALL                                      0  $39     
         50        ASSIGN                                           ~40     !7, $39
         51      > JMPNZ_EX                                         ~40     ~40, ->55
         52    >   CONCAT                                           ~41     '%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                                                     ~41
         54*       BOOL                                             ~40     <true>
   46    55    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_assoc'
         56        SEND_VAR_EX                                              !7
         57        DO_FCALL                                      0  $42     
         58        ASSIGN                                                   !8, $42
   47    59        FETCH_DIM_R                                      ~44     !8, 'event_title'
         60        ASSIGN                                                   !9, ~44
   50    61        ECHO                                                     !9
         62        ECHO                                                     '%E3%81%AE%E7%99%BB%E9%8C%B2%E7%8A%B6%E6%B3%81'
   54    63        ECHO                                                     '%3Cbr%3E%3Cbr%3E%3Ctable+border%3D1%3E%3Ctr%3E%3Ctd%3E%3C%2Ftd%3E'
   58    64        ASSIGN                                                   !6, 'SELECT+date%2C+except+FROM+calendar+'
   59    65        ASSIGN_OP                                     8          !6, 'WHERE+event_id+%3D002+ORDER+BY+date_id'
   62    66        INIT_FCALL_BY_NAME                                       'mysql_db_query'
         67        SEND_VAR_EX                                              !3
         68        SEND_VAR_EX                                              !6
         69        DO_FCALL                                      0  $48     
         70        ASSIGN                                                   !10, $48
   65    71        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         72        SEND_VAR_EX                                              !10
         73        DO_FCALL                                      0  $50     
         74        ASSIGN                                                   !11, $50
   68    75      > JMP                                                      ->80
   71    76    >   FETCH_DIM_R                                      ~52     !8, 'date'
         77        CONCAT                                           ~53     '%3Ctd%3E', ~52
         78        CONCAT                                           ~54     ~53, '%3C%2Ftd%3E'
         79        ECHO                                                     ~54
   68    80    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         81        SEND_VAR_EX                                              !10
         82        DO_FCALL                                      0  $55     
         83        ASSIGN                                           ~56     !8, $55
         84      > JMPNZ                                                    ~56, ->76
   77    85    >   ASSIGN                                                   !6, 'select+user_name+from+user+'
   78    86        ASSIGN_OP                                     8          !6, 'order+by+user_id'
   81    87        INIT_FCALL_BY_NAME                                       'mysql_db_query'
         88        SEND_VAR_EX                                              !3
         89        SEND_VAR_EX                                              !6
         90        DO_FCALL                                      0  $59     
         91        ASSIGN                                                   !10, $59
   84    92        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         93        SEND_VAR_EX                                              !10
         94        DO_FCALL                                      0  $61     
         95        ASSIGN                                                   !11, $61
   87    96      > JMP                                                      ->125
   90    97    >   FETCH_DIM_R                                      ~63     !8, 'user_name'
         98        CONCAT                                           ~64     '%3Ctr%3E%3Ctd%3E', ~63
         99        CONCAT                                           ~65     ~64, '%3C%2Ftd%3E'
        100        ECHO                                                     ~65
   93   101        ASSIGN                                                   !6, 'select+attendance+from+attend+'
   94   102        FETCH_DIM_R                                      ~67     !8, 'user_name'
        103        CONCAT                                           ~68     'where+user_id%3D', ~67
        104        ASSIGN_OP                                     8          !6, ~68
   95   105        ASSIGN_OP                                     8          !6, 'order+by+date_id'
   98   106        INIT_FCALL_BY_NAME                                       'mysql_db_query'
        107        SEND_VAR_EX                                              !3
        108        SEND_VAR_EX                                              !6
        109        DO_FCALL                                      0  $71     
        110        ASSIGN                                                   !10, $71
  101   111        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
        112        SEND_VAR_EX                                              !10
        113        DO_FCALL                                      0  $73     
        114        ASSIGN                                                   !11, $73
  104   115        ASSIGN                                                   !12, 0
        116      > JMP                                                      ->122
  107   117    >   FETCH_DIM_R                                      ~76     !8, !13
        118        CONCAT                                           ~77     '%3Ctd%3E', ~76
        119        CONCAT                                           ~78     ~77, '%3C%2Ftd%3E'
        120        ECHO                                                     ~78
  104   121        PRE_INC                                                  !12
        122    >   IS_SMALLER                                               !12, !11
        123      > JMPNZ                                                    ~80, ->117
  111   124    >   ECHO                                                     '%3C%2Ftr%3E'
   87   125    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        126        SEND_VAR_EX                                              !10
        127        DO_FCALL                                      0  $81     
        128        ASSIGN                                           ~82     !8, $81
        129      > JMPNZ                                                    ~82, ->97
  115   130    >   ECHO                                                     '%3C%2Ftable%3E'
  118   131        INIT_FCALL_BY_NAME                                       'mysql_close'
        132        SEND_VAR_EX                                              !4
        133        DO_FCALL                                      0  $83     
        134      > JMPNZ_EX                                         ~84     $83, ->137
        135    > > 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'
        136*       BOOL                                             ~84     <true>
  124   137    >   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'
  129   138      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.78 ms | 1449 KiB | 14 Q