3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function CheckReg($_con, $_vid) { $_sql = "SELECT * FROM application WHERE vid=$_vid AND (accepted=0 OR accepted=2 OR accepted=3)"; $_sth = mysqli_query($_con, $_sql); if (mysqli_fetch_array($_sth, MYSQLI_BOTH) == "") { return "0"; } else { return "1"; } } switch ($_GET["page"]) { // Sub Pages and main //******************************************************** // register as trainee //******************************************************** case "register": if (CheckReg($mysqli, $d->vid) == "1") { ?> <h3>Sorry, registration not avalaible, you have areally requested a registration (and still pending), or your subscription still in progress.</h3> <? include ("footer.php"); exit; }; if (!$_POST['register']) { $requestnum = $d->ratingatc + 1; $requestname = RequestRating($requestnum); ?> <h3 class="page-title">Register</h3> <div class="gcontainer"> <form action="index.php?page=register" method="post" name="register"> <fieldset><legend>Registration to the school</legend> <label>[INSERT THE RULE'S HERE]: </label><span>bla bla bla</span> <label>You request school for: </label><span><? echo $requestname; ?></span> <label>I agree with the rule's</label><span><input id="agree" type="checkbox" name="agree" value="agree"></span> </fieldset> <div class="color form-more"> <input name="register" class="submit" type="submit" value="Register"> </div> </form> </div> <? } else { if ($_POST["agree"] == "") { ?> <span>You don't have accepted the AUP! Please come back and fullfil the rule's</span> <? include ("footer.php"); exit; } else { // 0 - registered, 1 - refused, 2 - accepted, 3 - in progress, 4 - end, 5 - expelled $request = $d->ratingatc + 1; $sql = "INSERT INTO application (id, vid, request, accepted, reason, class) VALUES ('', '$d->vid', '$request', '0', '', '')"; safecommit($mysqli, $sql, "<h4>Failed to register your application, please contact WM, thank's</h4>", "<h4>Registration done. You're been contacted back on your email for future info.</h4>"); }; }; break; //******************************************************** // Default webpage //******************************************************** default: ?> <H4>Hi <? echo $d->firstname; ?> <? echo $d->lastname; ?> (<a href="https://www.ivao.aero/Member.aspx?Id=<? echo $d->vid; ?>"><? echo $d->vid; ?></a>)!<span class='notice'>Your rating ATC is <? echo RequestRating($d->ratingatc);?></span></H4> <span>Welcome to the school. You can request a subscription here.</span> <? break; // END switch }; ?>
Output for 7.2.0
Notice: Undefined index: page in /in/GLm0N on line 12 <H4>Hi Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property 'firstname' of non-object in /in/GLm0N on line 69 Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property 'lastname' of non-object in /in/GLm0N on line 69 (<a href="https://www.ivao.aero/Member.aspx?Id= Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property 'vid' of non-object in /in/GLm0N on line 69 "> Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property 'vid' of non-object in /in/GLm0N on line 69 </a>)!<span class='notice'>Your rating ATC is Fatal error: Uncaught Error: Call to undefined function RequestRating() in /in/GLm0N:69 Stack trace: #0 {main} thrown in /in/GLm0N on line 69
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Undefined index: page in /in/GLm0N on line 12 <H4>Hi Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property of non-object in /in/GLm0N on line 69 Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property of non-object in /in/GLm0N on line 69 (<a href="https://www.ivao.aero/Member.aspx?Id= Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property of non-object in /in/GLm0N on line 69 "> Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property of non-object in /in/GLm0N on line 69 </a>)!<span class='notice'>Your rating ATC is Fatal error: Uncaught Error: Call to undefined function RequestRating() in /in/GLm0N:69 Stack trace: #0 {main} thrown in /in/GLm0N on line 69
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Notice: Undefined index: page in /in/GLm0N on line 12 <H4>Hi Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property of non-object in /in/GLm0N on line 69 Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property of non-object in /in/GLm0N on line 69 (<a href="https://www.ivao.aero/Member.aspx?Id= Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property of non-object in /in/GLm0N on line 69 "> Notice: Undefined variable: d in /in/GLm0N on line 69 Notice: Trying to get property of non-object in /in/GLm0N on line 69 </a>)!<span class='notice'>Your rating ATC is Fatal error: Call to undefined function RequestRating() in /in/GLm0N on line 69
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected $end in /in/GLm0N on line 79
Process exited with code 255.