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 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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
Output for 8.0.13
Warning: include(inc/conn.php): Failed to open stream: No such file or directory 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(inc/connmysql.php): Failed to open stream: No such file or directory 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
Output for 7.3.32 - 7.3.33, 7.4.26, 7.4.33
Warning: include(inc/conn.php): failed to open stream: No such file or directory 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(inc/connmysql.php): failed to open stream: No such file or directory 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(): Cannot start session when headers already 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
Output for 7.2.17 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32
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(): Cannot start session when headers already 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
Output for 7.2.6
Warning: include(): open_basedir restriction in effect. File(inc/conn.php) is not within the allowed path(s): (/tmp:/in) 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) 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(): Cannot start session when headers already 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
Output for 7.1.26 - 7.1.33
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(): Cannot send session cookie - headers already sent by (output started at /in/5GCAf:2) in /in/5GCAf on line 4 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/5GCAf:2) 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
Output for 7.1.20
Warning: include(): open_basedir restriction in effect. File(inc/conn.php) is not within the allowed path(s): (/tmp:/in) 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) 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(): Cannot send session cookie - headers already sent by (output started at /in/5GCAf:2) in /in/5GCAf on line 4 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/5GCAf:2) 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
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.36, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10
Warning: include(inc/conn.php): failed to open stream: No such file or directory 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(inc/connmysql.php): failed to open stream: No such file or directory 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(): Cannot send session cookie - headers already sent by (output started at /in/5GCAf:2) in /in/5GCAf on line 4 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/5GCAf:2) 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
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
Warning: include(inc/conn.php): failed to open stream: No such file or directory 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(inc/connmysql.php): failed to open stream: No such file or directory 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(): Cannot send session cookie - headers already sent by (output started at /in/5GCAf:2) in /in/5GCAf on line 4 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/5GCAf:2) in /in/5GCAf on line 4
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5
Warning: main(inc/conn.php): failed to open stream: No such file or directory in /in/5GCAf on line 2 Warning: main(): Failed opening 'inc/conn.php' for inclusion (include_path='.:') in /in/5GCAf on line 2 Warning: main(inc/connmysql.php): failed to open stream: No such file or directory in /in/5GCAf on line 3 Warning: main(): Failed opening 'inc/connmysql.php' for inclusion (include_path='.:') in /in/5GCAf on line 3 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/5GCAf:2) in /in/5GCAf on line 4 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/5GCAf:2) in /in/5GCAf on line 4
Output for 4.3.0 - 4.3.1
Warning: main(inc/conn.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/5GCAf on line 2 Warning: main() [http://www.php.net/function.main]: Failed opening 'inc/conn.php' for inclusion (include_path='.:') in /in/5GCAf on line 2 Warning: main(inc/connmysql.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/5GCAf on line 3 Warning: main() [http://www.php.net/function.main]: Failed opening 'inc/connmysql.php' for inclusion (include_path='.:') in /in/5GCAf on line 3 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent by (output started at /in/5GCAf:2) in /in/5GCAf on line 4 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /in/5GCAf:2) in /in/5GCAf on line 4

preferences:
261.01 ms | 403 KiB | 376 Q