芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/status.pulsehost.co.uk/install/install.php
'error', 'message' => 'One of the required fields are missing.' ])); } } foreach(['database_host', 'database_name', 'database_username', 'database_password'] as $key) { $_POST[$key] = str_replace('\'', '\\\'', $_POST[$key]); } /* Make sure the database details are correct */ mysqli_report(MYSQLI_REPORT_OFF); try { $database = new mysqli( $_POST['database_host'], $_POST['database_username'], $_POST['database_password'], $_POST['database_name'] ); } catch(\Exception $exception) { die(json_encode([ 'status' => 'error', 'message' => 'The database connection has failed: ' . $exception->getMessage() ])); } if($database->connect_error) { die(json_encode([ 'status' => 'error', 'message' => 'The database connection has failed!' ])); } $database->set_charset('utf8mb4'); /* Success check */ if(true) { /* Prepare the config file content */ $config_content = <<
query($query); if($database->error) { die(json_encode([ 'status' => 'error', 'message' => 'Error when running the database queries: ' . $database->error ])); } } /* Create the installed file */ file_put_contents(ROOT . 'install/installed', ''); die(json_encode([ 'status' => 'success', 'message' => '' ])); }