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 '$_SESSION["event_id"]'; //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 = 115
Branch analysis from position: 115
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 = 115
Branch analysis from position: 115
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 115
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 = 49, Position 2 = 52
Branch analysis from position: 49
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
2 jumps found. (Code = 44) Position 1 = 81, Position 2 = 72
Branch analysis from position: 81
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
2 jumps found. (Code = 44) Position 1 = 108, Position 2 = 84
Branch analysis from position: 108
2 jumps found. (Code = 47) Position 1 = 113, Position 2 = 115
Branch analysis from position: 113
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 115
Branch analysis from position: 84
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
2 jumps found. (Code = 44) Position 1 = 102, Position 2 = 95
Branch analysis from position: 102
2 jumps found. (Code = 44) Position 1 = 108, Position 2 = 84
Branch analysis from position: 108
Branch analysis from position: 84
Branch analysis from position: 95
2 jumps found. (Code = 44) Position 1 = 102, Position 2 = 95
Branch analysis from position: 102
Branch analysis from position: 95
Branch analysis from position: 72
2 jumps found. (Code = 44) Position 1 = 81, Position 2 = 72
Branch analysis from position: 81
Branch analysis from position: 72
Branch analysis from position: 115
filename:       /in/CJRnN
function name:  (null)
number of ops:  117
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                                                      ->115
   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                                                      ->115
   21    13    >   FETCH_R                      global              ~20     '_SESSION'
         14        FETCH_DIM_R                                      ~21     ~20, 'user_class'
         15        IS_EQUAL                                                 ~21, '1'
         16      > JMPZ                                                     ~22, ->115
   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        ASSIGN_OP                                     8          !6, 'where+event_id%3D+%24_SESSION%5B%22event_id%22%5D'
   45    43        INIT_FCALL_BY_NAME                                       'mysql_query'
         44        SEND_VAR_EX                                              !6
         45        SEND_VAR_EX                                              !4
         46        DO_FCALL                                      0  $35     
         47        ASSIGN                                           ~36     !7, $35
         48      > JMPNZ_EX                                         ~36     ~36, ->52
         49    >   CONCAT                                           ~37     '%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
         50      > EXIT                                                     ~37
         51*       BOOL                                             ~36     <true>
   46    52    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_assoc'
         53        SEND_VAR_EX                                              !7
         54        DO_FCALL                                      0  $38     
         55        ASSIGN                                                   !8, $38
   47    56        FETCH_DIM_R                                      ~40     !8, 'event_title'
         57        ASSIGN                                                   !9, ~40
   50    58        ECHO                                                     '%24_SESSION%5B%22event_id%22%5D'
   54    59        ECHO                                                     '%3Ctable+border%3D1%3E%3Ctr%3E%3Ctd%3E%3C%2Ftd%3E'
   58    60        ASSIGN                                                   !6, 'SELECT+DATE%2C+except+FROM+calendar+'
   59    61        ASSIGN_OP                                     8          !6, 'WHERE+event_id+%3D002+ORDER+BY+date_id'
   62    62        INIT_FCALL_BY_NAME                                       'mysql_db_query'
         63        SEND_VAR_EX                                              !3
         64        SEND_VAR_EX                                              !6
         65        DO_FCALL                                      0  $44     
         66        ASSIGN                                                   !10, $44
   65    67        INIT_FCALL_BY_NAME                                       'mysql_num_fields'
         68        SEND_VAR_EX                                              !10
         69        DO_FCALL                                      0  $46     
         70        ASSIGN                                                   !11, $46
   68    71      > JMP                                                      ->76
   71    72    >   FETCH_DIM_R                                      ~48     !8, 'date'
         73        CONCAT                                           ~49     '%3Ctd%3E', ~48
         74        CONCAT                                           ~50     ~49, '%3C%2Ftd%3E'
         75        ECHO                                                     ~50
   68    76    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         77        SEND_VAR_EX                                              !10
         78        DO_FCALL                                      0  $51     
         79        ASSIGN                                           ~52     !8, $51
         80      > JMPNZ                                                    ~52, ->72
   77    81    >   ASSIGN                                                   !6, 'select+user_name+from+user+'
   78    82        ASSIGN_OP                                     8          !6, 'order+by+user_id'
   81    83      > JMP                                                      ->103
   84    84    >   FETCH_DIM_R                                      ~55     !8, 'user_name'
         85        CONCAT                                           ~56     '%3Ctr%3E', ~55
         86        CONCAT                                           ~57     ~56, '%3C%2Ftr%3E'
         87        ECHO                                                     ~57
   87    88        ASSIGN                                                   !6, 'select+attendance+from+attend+'
   88    89        FETCH_DIM_R                                      ~59     !8, 'user_name'
         90        CONCAT                                           ~60     'where+user_id%3D', ~59
         91        ASSIGN_OP                                     8          !6, ~60
   89    92        ASSIGN_OP                                     8          !6, 'order+by+date_id'
   92    93        ASSIGN                                                   !12, 0
         94      > JMP                                                      ->100
   95    95    >   FETCH_DIM_R                                      ~64     !8, !12
         96        CONCAT                                           ~65     '%3Ctd%3E', ~64
         97        CONCAT                                           ~66     ~65, '%3C%2Ftd%3E'
         98        ECHO                                                     ~66
   92    99        PRE_INC                                                  !12
        100    >   IS_SMALLER                                               !12, !11
        101      > JMPNZ                                                    ~68, ->95
   99   102    >   ECHO                                                     '%3C%2Ftr%3E'
   81   103    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        104        SEND_VAR_EX                                              !10
        105        DO_FCALL                                      0  $69     
        106        ASSIGN                                           ~70     !8, $69
        107      > JMPNZ                                                    ~70, ->84
  103   108    >   ECHO                                                     '%3C%2Ftable%3E'
  106   109        INIT_FCALL_BY_NAME                                       'mysql_close'
        110        SEND_VAR_EX                                              !4
        111        DO_FCALL                                      0  $71     
        112      > JMPNZ_EX                                         ~72     $71, ->115
        113    > > 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'
        114*       BOOL                                             ~72     <true>
  112   115    >   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   116      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.42 ms | 1408 KiB | 15 Q