3v4l.org

run code in 300+ PHP versions simultaneously
<?php require_once('config.php'); // page title $pagetitle="Results - ".$sitename; require_once('login.php'); $totalmarks = '50'; $passingmarks = '18'; $totalpassing = '33'; // total passing percentage ?> <!DOCTYPE html> <html> <head> <title><?=$pagetitle?></title> <script> function printpage() { window.print() } </script> </head> <body style="text-align:center"> <?php if($_GET['id']){ $id=mysql_real_escape_string($_GET['id']); $uq=mysql_query("SELECT * FROM $tbl_name WHERE id='$id'") or die("ERROR"); $u=mysql_fetch_array($uq); $user_name=$u['user_name']; $rq=mysql_query("SELECT * FROM $tbl2 WHERE user='$user_name'") or die("Error fetching result"); ?> <div class="content2" style="center;width:780px"> <div style="text-align:center;margin-bottom:20px;overflow:hidden"> <a style="float:right;" href="#" onClick="printpage()">Print</a> <a href="/" ><img style="width: 500px;height: 130px;" src="images/logo-main.png" alt="logo" title="The Lahore Institute" /></a> <hr/> </div> <div> <div style="font-weight:bold;text-align:center;margin-bottom:10px;"> Roll No: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <?=$u['id']?><br/> Name: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$u['fullname']?><br/> </div> <table width="450" border="0" align="center" cellpadding="1" cellspacing="0" style="border:1px solid #666;border-radius:10px;"> <tr bgcolor="#003063"> <td style="padding:5px;"><strong style="color:#fff">Name of Paper </strong></td> <td style="padding:5px;"><div style="color:#fff" align="center"><strong>Marks Obtained</strong></div></td> <td style="padding:5px;"><div style="color:#fff" align="center"><strong>Total Marks</strong></div></td> <td style="padding:5px;"><div style="color:#fff" align="center"><strong>Status</strong></div></td> </tr> <?php while($r=mysql_fetch_array($rq)){ $i='0'; $i++; if($_SESSION['allmarks']){ $_SESSION['allmarks']=$_SESSION['allmarks']+$r['marks']; } else { $_SESSION['allmarks']=$r['marks']; } echo "<tr>"; if($r['marks']<$passingmarks){ $status='Fail'; } echo '<td style="padding:5px;" align="left">'.$r['subject'].'</td>'; echo '<td style="padding:5px;"><div align="center"><em><strong>'.$r['marks'].'</strong></em></div></td>'; echo '<td style="padding:5px;"><div align="center">'.$totalmarks.'</div></td>'; echo '<td style="padding:5px;"><div align="center">'.$status.'</div></td>'; echo "</tr>"; ?> <?php } $totalall=$i*$totalmarks; $totallgained=$_SESSION['allmarks']; if($totallgained*100/$totallall<$totalpassing){ $fstatus='Failed'; } else { $fstatus='Passed'; } if($fstatus!=='Failed'){ $comments=$passingcomments; } else { $comments=$failingcomments; } ?> </table> <div style="margin-top:10px;text-align:center;font-weight:bold;">Total Marks: <?=$totalgained?><br/>Final Status: <?=$fstatus?><br/>Comments: <?=$comments?><br/></div> </div> </div> </body> </html> <?php } else { require_once('header.php'); ?> <div class="content2"> <h2>Get Result</h2><hr/> <div style="text-align:center"> <span style="color:#F00">*</span> &nbsp; Enter your Roll number and click GET to get your result<br /> <br /> <br /> <form action="result.php" method="get"> <input type="text" name="id" id="id" placeholder="Enter Roll No." size="35" /><br /> <br /> <input style="width: 100px;" type="submit" name="Submit" value="GET" /> </form> </div> </div> <?php require_once('footer.php'); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 125
Branch analysis from position: 13
2 jumps found. (Code = 47) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 47) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
2 jumps found. (Code = 44) Position 1 = 100, Position 2 = 58
Branch analysis from position: 100
2 jumps found. (Code = 43) Position 1 = 109, Position 2 = 111
Branch analysis from position: 109
1 jumps found. (Code = 42) Position 1 = 112
Branch analysis from position: 112
2 jumps found. (Code = 43) Position 1 = 114, Position 2 = 116
Branch analysis from position: 114
1 jumps found. (Code = 42) Position 1 = 117
Branch analysis from position: 117
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 116
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 111
2 jumps found. (Code = 43) Position 1 = 114, Position 2 = 116
Branch analysis from position: 114
Branch analysis from position: 116
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 71
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 80
Branch analysis from position: 79
2 jumps found. (Code = 44) Position 1 = 100, Position 2 = 58
Branch analysis from position: 100
Branch analysis from position: 58
Branch analysis from position: 80
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 80
Branch analysis from position: 79
Branch analysis from position: 80
Branch analysis from position: 125
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TgL8O
function name:  (null)
number of ops:  129
compiled vars:  !0 = $pagetitle, !1 = $sitename, !2 = $totalmarks, !3 = $passingmarks, !4 = $totalpassing, !5 = $id, !6 = $uq, !7 = $tbl_name, !8 = $u, !9 = $user_name, !10 = $rq, !11 = $tbl2, !12 = $i, !13 = $r, !14 = $status, !15 = $totalall, !16 = $totallgained, !17 = $totallall, !18 = $fstatus, !19 = $comments, !20 = $passingcomments, !21 = $failingcomments, !22 = $totalgained
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'config.php', REQUIRE_ONCE
    5     1        CONCAT                                           ~24     'Results+-+', !1
          2        ASSIGN                                                   !0, ~24
    6     3        INCLUDE_OR_EVAL                                          'login.php', REQUIRE_ONCE
    7     4        ASSIGN                                                   !2, '50'
    8     5        ASSIGN                                                   !3, '18'
    9     6        ASSIGN                                                   !4, '33'
   11     7        ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3Ctitle%3E'
   14     8        ECHO                                                     !0
          9        ECHO                                                     '%3C%2Ftitle%3E%0A%3Cscript%3E%0Afunction+printpage%28%29%0A++%7B%0A++window.print%28%29%0A++%7D%0A%3C%2Fscript%3E%0A%3C%2Fhead%3E%0A%3Cbody+style%3D%22text-align%3Acenter%22%3E%0A'
   26    10        FETCH_R                      global              ~30     '_GET'
         11        FETCH_DIM_R                                      ~31     ~30, 'id'
         12      > JMPZ                                                     ~31, ->125
   27    13    >   INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         14        CHECK_FUNC_ARG                                           
         15        FETCH_FUNC_ARG               global              $32     '_GET'
         16        FETCH_DIM_FUNC_ARG                               $33     $32, 'id'
         17        SEND_FUNC_ARG                                            $33
         18        DO_FCALL                                      0  $34     
         19        ASSIGN                                                   !5, $34
   28    20        INIT_FCALL_BY_NAME                                       'mysql_query'
         21        ROPE_INIT                                     5  ~37     'SELECT+%2A+FROM+'
         22        ROPE_ADD                                      1  ~37     ~37, !7
         23        ROPE_ADD                                      2  ~37     ~37, '+WHERE+id%3D%27'
         24        ROPE_ADD                                      3  ~37     ~37, !5
         25        ROPE_END                                      4  ~36     ~37, '%27'
         26        SEND_VAL_EX                                              ~36
         27        DO_FCALL                                      0  $40     
         28        ASSIGN                                           ~41     !6, $40
         29      > JMPNZ_EX                                         ~41     ~41, ->32
         30    > > EXIT                                                     'ERROR'
         31*       BOOL                                             ~41     <true>
   29    32    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         33        SEND_VAR_EX                                              !6
         34        DO_FCALL                                      0  $42     
         35        ASSIGN                                                   !8, $42
   30    36        FETCH_DIM_R                                      ~44     !8, 'user_name'
         37        ASSIGN                                                   !9, ~44
   31    38        INIT_FCALL_BY_NAME                                       'mysql_query'
         39        ROPE_INIT                                     5  ~47     'SELECT+%2A+FROM+'
         40        ROPE_ADD                                      1  ~47     ~47, !11
         41        ROPE_ADD                                      2  ~47     ~47, '+WHERE+user%3D%27'
         42        ROPE_ADD                                      3  ~47     ~47, !9
         43        ROPE_END                                      4  ~46     ~47, '%27'
         44        SEND_VAL_EX                                              ~46
         45        DO_FCALL                                      0  $50     
         46        ASSIGN                                           ~51     !10, $50
         47      > JMPNZ_EX                                         ~51     ~51, ->50
         48    > > EXIT                                                     'Error+fetching+result'
         49*       BOOL                                             ~51     <true>
   36    50    >   ECHO                                                     '%3Cdiv+class%3D%22content2%22+style%3D%22center%3Bwidth%3A780px%22%3E%0A%3Cdiv+style%3D%22text-align%3Acenter%3Bmargin-bottom%3A20px%3Boverflow%3Ahidden%22%3E%0A%3Ca+style%3D%22float%3Aright%3B%22+href%3D%22%23%22+onClick%3D%22printpage%28%29%22%3EPrint%3C%2Fa%3E%0A%3Ca+href%3D%22%2F%22+%3E%3Cimg+style%3D%22width%3A+500px%3Bheight%3A+130px%3B%22+src%3D%22images%2Flogo-main.png%22+alt%3D%22logo%22+title%3D%22The+Lahore+Institute%22+%2F%3E%3C%2Fa%3E%0A%3Chr%2F%3E%0A%0A%3C%2Fdiv%3E%0A%3Cdiv%3E%0A%0A%3Cdiv+style%3D%22font-weight%3Abold%3Btext-align%3Acenter%3Bmargin-bottom%3A10px%3B%22%3E%0ARoll+No%3A+%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B+'
   46    51        FETCH_DIM_R                                      ~52     !8, 'id'
         52        ECHO                                                     ~52
         53        ECHO                                                     '%3Cbr%2F%3E%0AName%3A+%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B'
   47    54        FETCH_DIM_R                                      ~53     !8, 'fullname'
         55        ECHO                                                     ~53
         56        ECHO                                                     '%3Cbr%2F%3E%0A%3C%2Fdiv%3E%0A%3Ctable+width%3D%22450%22+border%3D%220%22+align%3D%22center%22+cellpadding%3D%221%22+cellspacing%3D%220%22+style%3D%22border%3A1px+solid+%23666%3Bborder-radius%3A10px%3B%22%3E%0A%09%3Ctr+bgcolor%3D%22%23003063%22%3E%0A%09%09%3Ctd+style%3D%22padding%3A5px%3B%22%3E%3Cstrong+style%3D%22color%3A%23fff%22%3EName+of+Paper+%3C%2Fstrong%3E%3C%2Ftd%3E%0A%09%09%3Ctd+style%3D%22padding%3A5px%3B%22%3E%3Cdiv+style%3D%22color%3A%23fff%22+align%3D%22center%22%3E%3Cstrong%3EMarks+Obtained%3C%2Fstrong%3E%3C%2Fdiv%3E%3C%2Ftd%3E%0A%09%09%3Ctd+style%3D%22padding%3A5px%3B%22%3E%3Cdiv+style%3D%22color%3A%23fff%22+align%3D%22center%22%3E%3Cstrong%3ETotal+Marks%3C%2Fstrong%3E%3C%2Fdiv%3E%3C%2Ftd%3E%0A%09%09%3Ctd+style%3D%22padding%3A5px%3B%22%3E%3Cdiv+style%3D%22color%3A%23fff%22+align%3D%22center%22%3E%3Cstrong%3EStatus%3C%2Fstrong%3E%3C%2Fdiv%3E%3C%2Ftd%3E%0A++++%3C%2Ftr%3E++++++++++++++++++++++++++++++++++%0A'
   57    57      > JMP                                                      ->95
   58    58    >   ASSIGN                                                   !12, '0'
         59        PRE_INC                                                  !12
   59    60        FETCH_R                      global              ~56     '_SESSION'
         61        FETCH_DIM_R                                      ~57     ~56, 'allmarks'
         62      > JMPZ                                                     ~57, ->71
   60    63    >   FETCH_R                      global              ~60     '_SESSION'
         64        FETCH_DIM_R                                      ~61     ~60, 'allmarks'
         65        FETCH_DIM_R                                      ~62     !13, 'marks'
         66        ADD                                              ~63     ~61, ~62
         67        FETCH_W                      global              $58     '_SESSION'
         68        ASSIGN_DIM                                               $58, 'allmarks'
         69        OP_DATA                                                  ~63
         70      > JMP                                                      ->75
   62    71    >   FETCH_DIM_R                                      ~66     !13, 'marks'
         72        FETCH_W                      global              $64     '_SESSION'
         73        ASSIGN_DIM                                               $64, 'allmarks'
         74        OP_DATA                                                  ~66
   65    75    >   ECHO                                                     '%3Ctr%3E'
   66    76        FETCH_DIM_R                                      ~67     !13, 'marks'
         77        IS_SMALLER                                               ~67, !3
         78      > JMPZ                                                     ~68, ->80
   67    79    >   ASSIGN                                                   !14, 'Fail'
   69    80    >   FETCH_DIM_R                                      ~70     !13, 'subject'
         81        CONCAT                                           ~71     '%3Ctd+style%3D%22padding%3A5px%3B%22+align%3D%22left%22%3E', ~70
         82        CONCAT                                           ~72     ~71, '%3C%2Ftd%3E'
         83        ECHO                                                     ~72
   70    84        FETCH_DIM_R                                      ~73     !13, 'marks'
         85        CONCAT                                           ~74     '%3Ctd+style%3D%22padding%3A5px%3B%22%3E%3Cdiv+align%3D%22center%22%3E%3Cem%3E%3Cstrong%3E', ~73
         86        CONCAT                                           ~75     ~74, '%3C%2Fstrong%3E%3C%2Fem%3E%3C%2Fdiv%3E%3C%2Ftd%3E'
         87        ECHO                                                     ~75
   71    88        CONCAT                                           ~76     '%3Ctd+style%3D%22padding%3A5px%3B%22%3E%3Cdiv+align%3D%22center%22%3E', !2
         89        CONCAT                                           ~77     ~76, '%3C%2Fdiv%3E%3C%2Ftd%3E'
         90        ECHO                                                     ~77
   72    91        CONCAT                                           ~78     '%3Ctd+style%3D%22padding%3A5px%3B%22%3E%3Cdiv+align%3D%22center%22%3E', !14
         92        CONCAT                                           ~79     ~78, '%3C%2Fdiv%3E%3C%2Ftd%3E'
         93        ECHO                                                     ~79
   73    94        ECHO                                                     '%3C%2Ftr%3E'
   57    95    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         96        SEND_VAR_EX                                              !10
         97        DO_FCALL                                      0  $80     
         98        ASSIGN                                           ~81     !13, $80
         99      > JMPNZ                                                    ~81, ->58
   77   100    >   MUL                                              ~82     !12, !2
        101        ASSIGN                                                   !15, ~82
   78   102        FETCH_R                      global              ~84     '_SESSION'
        103        FETCH_DIM_R                                      ~85     ~84, 'allmarks'
        104        ASSIGN                                                   !16, ~85
   79   105        MUL                                              ~87     !16, 100
        106        DIV                                              ~88     ~87, !17
        107        IS_SMALLER                                               ~88, !4
        108      > JMPZ                                                     ~89, ->111
   80   109    >   ASSIGN                                                   !18, 'Failed'
        110      > JMP                                                      ->112
   82   111    >   ASSIGN                                                   !18, 'Passed'
   84   112    >   IS_NOT_IDENTICAL                                         !18, 'Failed'
        113      > JMPZ                                                     ~92, ->116
   85   114    >   ASSIGN                                                   !19, !20
        115      > JMP                                                      ->117
   87   116    >   ASSIGN                                                   !19, !21
   90   117    >   ECHO                                                     '%3C%2Ftable%3E%0A%3Cdiv+style%3D%22margin-top%3A10px%3Btext-align%3Acenter%3Bfont-weight%3Abold%3B%22%3ETotal+Marks%3A+'
   91   118        ECHO                                                     !22
        119        ECHO                                                     '%3Cbr%2F%3EFinal+Status%3A+'
        120        ECHO                                                     !18
        121        ECHO                                                     '%3Cbr%2F%3EComments%3A+'
        122        ECHO                                                     !19
        123        ECHO                                                     '%3Cbr%2F%3E%3C%2Fdiv%3E%0A%0A%3C%2Fdiv%3E%0A%0A%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A'
        124      > JMP                                                      ->128
  103   125    >   INCLUDE_OR_EVAL                                          'header.php', REQUIRE_ONCE
  104   126        ECHO                                                     '%09%0A%3Cdiv+class%3D%22content2%22%3E%0A%09%3Ch2%3EGet+Result%3C%2Fh2%3E%3Chr%2F%3E%0A++++%3Cdiv+style%3D%22text-align%3Acenter%22%3E%0A++++%3Cspan+style%3D%22color%3A%23F00%22%3E%2A%3C%2Fspan%3E+%26nbsp%3B+Enter+your+Roll+number+and+click+GET+to+get+your+result%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A++++%3Cform+action%3D%22result.php%22+method%3D%22get%22%3E%0A++++%3Cinput+type%3D%22text%22+name%3D%22id%22+id%3D%22id%22+placeholder%3D%22Enter+Roll+No.%22+size%3D%2235%22+%2F%3E%3Cbr+%2F%3E%0A%09%3Cbr+%2F%3E%0A%09%3Cinput+style%3D%22width%3A+100px%3B%22+type%3D%22submit%22+name%3D%22Submit%22+value%3D%22GET%22+%2F%3E%0A++++%3C%2Fform%3E%0A%09%0A%09%3C%2Fdiv%3E%0A%09%0A%09%0A%09%0A%09%0A%3C%2Fdiv%3E%0A%09%0A'
  125   127        INCLUDE_OR_EVAL                                          'footer.php', REQUIRE_ONCE
  127   128    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.31 ms | 1411 KiB | 13 Q