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>".$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 = 118
Branch analysis from position: 118
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 = 118
Branch analysis from position: 118
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 118
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 = 79
Branch analysis from position: 79
2 jumps found. (Code = 44) Position 1 = 84, Position 2 = 75
Branch analysis from position: 84
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
2 jumps found. (Code = 44) Position 1 = 111, Position 2 = 87
Branch analysis from position: 111
2 jumps found. (Code = 47) Position 1 = 116, Position 2 = 118
Branch analysis from position: 116
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 118
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
2 jumps found. (Code = 44) Position 1 = 105, Position 2 = 98
Branch analysis from position: 105
2 jumps found. (Code = 44) Position 1 = 111, Position 2 = 87
Branch analysis from position: 111
Branch analysis from position: 87
Branch analysis from position: 98
2 jumps found. (Code = 44) Position 1 = 105, Position 2 = 98
Branch analysis from position: 105
Branch analysis from position: 98
Branch analysis from position: 75
2 jumps found. (Code = 44) Position 1 = 84, Position 2 = 75
Branch analysis from position: 84
Branch analysis from position: 75
Branch analysis from position: 118
filename:       /in/j9704
function name:  (null)
number of ops:  120
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                                                      ->118
   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                                                      ->118
   21    13    >   FETCH_R                      global              ~20     '_SESSION'
         14        FETCH_DIM_R                                      ~21     ~20, 'user_class'
         15        IS_EQUAL                                                 ~21, '1'
         16      > JMPZ                                                     ~22, ->118
   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                                                      ->79
   71    75    >   FETCH_DIM_R                                      ~51     !8, 'date'
         76        CONCAT                                           ~52     '%3Ctd%3E', ~51
         77        CONCAT                                           ~53     ~52, '%3C%2Ftd%3E'
         78        ECHO                                                     ~53
   68    79    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         80        SEND_VAR_EX                                              !10
         81        DO_FCALL                                      0  $54     
         82        ASSIGN                                           ~55     !8, $54
         83      > JMPNZ                                                    ~55, ->75
   77    84    >   ASSIGN                                                   !6, 'select+user_name+from+user+'
   78    85        ASSIGN_OP                                     8          !6, 'order+by+user_id'
   81    86      > JMP                                                      ->106
   84    87    >   FETCH_DIM_R                                      ~58     !8, 'user_name'
         88        CONCAT                                           ~59     '%3Ctr%3E', ~58
         89        CONCAT                                           ~60     ~59, '%3C%2Ftr%3E'
         90        ECHO                                                     ~60
   87    91        ASSIGN                                                   !6, 'select+attendance+from+attend+'
   88    92        FETCH_DIM_R                                      ~62     !8, 'user_name'
         93        CONCAT                                           ~63     'where+user_id%3D', ~62
         94        ASSIGN_OP                                     8          !6, ~63
   89    95        ASSIGN_OP                                     8          !6, 'order+by+date_id'
   92    96        ASSIGN                                                   !12, 0
         97      > JMP                                                      ->103
   95    98    >   FETCH_DIM_R                                      ~67     !8, !12
         99        CONCAT                                           ~68     '%3Ctd%3E', ~67
        100        CONCAT                                           ~69     ~68, '%3C%2Ftd%3E'
        101        ECHO                                                     ~69
   92   102        PRE_INC                                                  !12
        103    >   IS_SMALLER                                               !12, !11
        104      > JMPNZ                                                    ~71, ->98
   99   105    >   ECHO                                                     '%3C%2Ftr%3E'
   81   106    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        107        SEND_VAR_EX                                              !10
        108        DO_FCALL                                      0  $72     
        109        ASSIGN                                           ~73     !8, $72
        110      > JMPNZ                                                    ~73, ->87
  103   111    >   ECHO                                                     '%3C%2Ftable%3E'
  106   112        INIT_FCALL_BY_NAME                                       'mysql_close'
        113        SEND_VAR_EX                                              !4
        114        DO_FCALL                                      0  $74     
        115      > JMPNZ_EX                                         ~75     $74, ->118
        116    > > 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'
        117*       BOOL                                             ~75     <true>
  112   118    >   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   119      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.2 ms | 1408 KiB | 15 Q