3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); //research the use of this session_start(); //needed to create sessions - maintaining state is discussed above. ini_set('display_errors', 1); //turn on errors, use for debugging. $username = $_POST['username']; //refer to the superglobal arrays section above $password = $_POST['password']; $authorized = false; require ('dbconnection.php'); $sql = 'SELECT * from Login'; $rs = $conn->Execute($sql); //Using a While looping structure to check each record in the database while (!$rs->EOF) { if ($rs->Fields["UserName"]->Value=="$username" && $rs->Fields["Password"]->Value=="$password") { $_SESSION['auth'] = $rs->Fields['Auth']->Value; $_SESSION['username'] = $rs->Fields['UserName']->Value; $authorized = true; } $rs->MoveNext(); } # close the connection $rs->Close(); $conn->Close(); $rs = null; $conn = null; if (!$authorized) { header('loginInvalid.php'); // see pseudocode for authorize.php exit(); } else { header('index.php'); exit(); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "username" in /in/7X1aS on line 6 Warning: Undefined array key "password" in /in/7X1aS on line 7 Warning: require(): open_basedir restriction in effect. File(dbconnection.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/7X1aS on line 10 Warning: require(dbconnection.php): Failed to open stream: Operation not permitted in /in/7X1aS on line 10 Fatal error: Uncaught Error: Failed opening required 'dbconnection.php' (include_path='.:') in /in/7X1aS:10 Stack trace: #0 {main} thrown in /in/7X1aS on line 10
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:
60.19 ms | 402 KiB | 8 Q