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'); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: require_once(): open_basedir restriction in effect. File(config.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/TgL8O on line 2 Warning: require_once(config.php): Failed to open stream: Operation not permitted in /in/TgL8O on line 2 Fatal error: Uncaught Error: Failed opening required 'config.php' (include_path='.:') in /in/TgL8O:2 Stack trace: #0 {main} thrown in /in/TgL8O on line 2
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.69 ms | 401 KiB | 8 Q