3v4l.org

run code in 300+ PHP versions simultaneously
<?php $admin_password = "admin"; // senha da área de administração (/admin) $mysql_hostname = "localhost"; // servidor MySQL $mysql_user = "root"; // usuário MySQL $mysql_password = ""; // senha MySQL $mysql_database = "bookface"; // banco de dados MySQL $prefix = ""; // prefixo das tabelas (desnecessário) // não configure aqui $installed = true; // $env = $_SERVER['QUERY_STRING']; $naofaz = Array("order", "concat", "union", "ORDER", "CONCAT", "UNION", "select", "SELECT", "drop", "DROP"); $env = str_replace($naofaz, "%SQLI", $env); if(strpos($env, "%SQLI")!=false OR @mysql_error()!=null) { die('<script> location.href="about:blank"; </script>'); } $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database"); mysql_select_db($mysql_database, $bd) or die("Could not select database"); $con = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database"); mysql_select_db($mysql_database, $con) or die("Could not select database"); $conn = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database"); mysql_select_db($mysql_database, $conn) or die("Could not select database"); $link = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database"); mysql_select_db($mysql_database, $link) or die("Could not select database"); $db = mysql_select_db($mysql_database) or die("Could not select database"); if($installed==false) { die("<script> location.href='install/'; </script>"); } if(is_dir("install") AND $installed==true) { die("Exclua o diretório \"install\" para continuar."); } if(!is_writable("uploadedimage")) { die("Falta CHMOD 777 em \"uploadedimage\""); } ?>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: Undefined array key "QUERY_STRING" in /in/RmA0R on line 11 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/RmA0R on line 13 Fatal error: Uncaught Error: Call to undefined function mysql_error() in /in/RmA0R:14 Stack trace: #0 {main} thrown in /in/RmA0R on line 14
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Warning: Undefined array key "QUERY_STRING" in /in/RmA0R on line 11 Fatal error: Uncaught Error: Call to undefined function mysql_error() in /in/RmA0R:14 Stack trace: #0 {main} thrown in /in/RmA0R on line 14
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined index: QUERY_STRING in /in/RmA0R on line 11 Fatal error: Uncaught Error: Call to undefined function mysql_error() in /in/RmA0R:14 Stack trace: #0 {main} thrown in /in/RmA0R on line 14
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Call to undefined function mysql_error() in /in/RmA0R:14 Stack trace: #0 {main} thrown in /in/RmA0R on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Notice: Undefined index: QUERY_STRING in /in/RmA0R on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Notice: Undefined index: QUERY_STRING in /in/RmA0R on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Notice: Undefined index: QUERY_STRING in /in/RmA0R on line 11 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/RmA0R on line 18 Could not connect database
Output for 4.3.0 - 4.3.1
Notice: Undefined index: QUERY_STRING in /in/RmA0R on line 11 Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/RmA0R on line 18 Could not connect database

preferences:
247.02 ms | 402 KiB | 459 Q