3v4l.org

run code in 300+ PHP versions simultaneously
<?php include 'config.php'; $user = $_POST['username']; $pass = $_POST['password']; if($_SERVER['REQUEST_METHOD'] == "POST"){ if($user == "" or $pass == ""){ echo '<div class="errorbox">Please fill in all fields!</div>'; }else{ $username = trim(mysqli_real_escape_string($user)); $password = trim(md5(mysqli_real_escape_string($pass))); $query = " SELECT username, password FROM accounts WHERE username = '$username' AND password = '$password' "; $results = mysqli_query($connection, $query) or die (mysqli_error()); $num_row = mysqli_num_rows($results); if($num_row == 1){ while($row = mysqli_fetch_array($results)){ $_COOKIE['userId'] = $row['userId']; header("Location: register.php"); } }else{ return false; } return true; } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <link type="image/gif" rel="icon" href="favicon.ico" /> <script type="text/javascript" src="js/logo_login.js"></script> <link type="text/css" rel="stylesheet" href="css/login.css" /> <title>M-Tutorials | Login</title> </head> <body> <img class="talk_cloud" src="images/already_account.png" /> <div class="login"> <form action="" method="post"> <input class="input_login" type="text" name="username" placeholder="Username" /> <input class="input_login" type="password" name="password" placeholder="Password" /> <input class="submit_login" type="submit" name="submit_login" value="Register" /> </form> <a href="index.php"><div class="logo"></div></a> </div> </body> </html>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: include(): open_basedir restriction in effect. File(config.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/mAW0o on line 2 Warning: include(config.php): Failed to open stream: Operation not permitted in /in/mAW0o on line 2 Warning: include(): Failed opening 'config.php' for inclusion (include_path='.:') in /in/mAW0o on line 2 Warning: Undefined array key "username" in /in/mAW0o on line 4 Warning: Undefined array key "password" in /in/mAW0o on line 5 Warning: Undefined array key "REQUEST_METHOD" in /in/mAW0o on line 7 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <link type="image/gif" rel="icon" href="favicon.ico" /> <script type="text/javascript" src="js/logo_login.js"></script> <link type="text/css" rel="stylesheet" href="css/login.css" /> <title>M-Tutorials | Login</title> </head> <body> <img class="talk_cloud" src="images/already_account.png" /> <div class="login"> <form action="" method="post"> <input class="input_login" type="text" name="username" placeholder="Username" /> <input class="input_login" type="password" name="password" placeholder="Password" /> <input class="submit_login" type="submit" name="submit_login" value="Register" /> </form> <a href="index.php"><div class="logo"></div></a> </div> </body> </html>

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:
41.4 ms | 405 KiB | 8 Q