3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.0.0 - 7.1.0
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 hhvm-3.10.0 - 3.12.0
Notice: Undefined index: QUERY_STRING in /in/RmA0R on line 11 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/RmA0R on line 18 Could not connect database
Output for 5.3.0 - 5.6.25
Notice: Undefined index: QUERY_STRING in /in/RmA0R on line 11
Process exited with code 255.
Output for 5.0.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.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