3v4l.org

run code in 300+ PHP versions simultaneously
<?php include "inc/conn.php"; include "inc/connmysql.php"; session_start(); if (isset($_SESSION['Username'])) { header("location:login_success.php"); } if (isset($_POST['Username'])) { ob_start(); $myUsername = $_POST['Username']; $myPassword = $_POST['password']; $sqlname = "SELECT * FROM dbo.Users WHERE Username='$myUsername' and Password='$myPassword'"; $params = array(); $options = array('Scrollable' => SQLSRV_CURSOR_KEYSET); $stmt = sqlsrv_query( $conn, $sqlname, $params, $options); $row_count = sqlsrv_num_rows( $stmt ); if($row_count==1){ $_SESSION['Username']= $myUsername; $_SESSION['Password']= $myPassword; $kb= $_SESSION['Username']; if (!$mysqli->query("CREATE TABLE IF NOT EXISTS user_log (id INT AUTO_INCREMENT PRIMARY KEY,user VARCHAR(15),state VARCHAR (7),ts TIMESTAMP)") || !$mysqli->query("INSERT INTO user_log (user, state) VALUES ('$kb', 'Login')")) { echo "Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error; } header("location:login_success.php"); } else { echo "Wrong Username or Password"; if (!$mysqli->query("CREATE TABLE IF NOT EXISTS user_log (id INT AUTO_INCREMENT PRIMARY KEY,user VARCHAR(15),state VARCHAR (7),ts TIMESTAMP)") || !$mysqli->query("INSERT INTO user_log (user, state) VALUES ('user', 'LogFail')")) { echo "Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error; } } ob_end_flush(); } else { header("location:sql.php"); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: include(): open_basedir restriction in effect. File(inc/conn.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/5GCAf on line 2 Warning: include(inc/conn.php): Failed to open stream: Operation not permitted in /in/5GCAf on line 2 Warning: include(): Failed opening 'inc/conn.php' for inclusion (include_path='.:') in /in/5GCAf on line 2 Warning: include(): open_basedir restriction in effect. File(inc/connmysql.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/5GCAf on line 3 Warning: include(inc/connmysql.php): Failed to open stream: Operation not permitted in /in/5GCAf on line 3 Warning: include(): Failed opening 'inc/connmysql.php' for inclusion (include_path='.:') in /in/5GCAf on line 3 Warning: session_start(): Session cannot be started after headers have already been sent in /in/5GCAf on line 4 Warning: Cannot modify header information - headers already sent by (output started at /in/5GCAf:2) in /in/5GCAf on line 39

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:
47.33 ms | 403 KiB | 8 Q