open($zipfile); $zip->extractTo(getcwd()); $zip->close(); unlink($zipfile); $configfile = "config.ini.php"; $current = file_get_contents($configfile); $current = str_replace(array("[DBUSER]", "[DBPASS]", "[DBNAME]"), array($dbuser, $dbpass, $dbname), $current); file_put_contents($configfile, $current); copy($configfile, dirname(__FILE__) . "/admin/funcs/" . $configfile); copy($configfile, dirname(__FILE__) . "/funcs/" . $configfile); copy($configfile, dirname(__FILE__) . "/users/funcs/" . $configfile); unlink($configfile); $sqlfile = "import.sql"; $db = new PDO("mysql:host=localhost;dbname=$dbname;", $dbuser, $dbpass); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0); $sql = file_get_contents($sqlfile); $db->query("SET NAMES 'utf8'"); $db->exec($sql); unlink($sqlfile); unlink("install.php"); unlink("sets.php"); header("Location: index.php"); exit;