';
$file = fopen($config, 'w');
fwrite($file, $output);
fclose($file);
} else {
$error['message'] = 'Error: Could not write to config.php please check you have set the correct permissions on: ' . $config . "\n";
}
$config = realpath(dirname(__FILE__) . '/../admin/config.php');
if (is_writable($config)) {
$output = '';
$file = fopen($config, 'w');
fwrite($file, $output);
fclose($file);
} else {
$error['message'] = 'Error: Could not write to config.php please check you have set the correct permissions on: ' . $config . "\n";
}
if (!$connection = @mysql_connect($_SESSION['db_host'], $_SESSION['db_user'], $_SESSION['db_password'])) {
$error['message'] = 'Error: Could not connect to the database please make sure the database server, username and password is correct!' . "\n";
} else {
if (!@mysql_select_db($_SESSION['db_name'], $connection)) {
$error['message'] = 'Error: Database does not exist!' . "\n";
}
}
if (!$error) {
mysql_query("set character set utf8", $connection);
mysql_query("delete from user where user_id = '1'");
mysql_query("insert into `user` set user_id = '1', user_group_id = '1', username = '" . mysql_real_escape_string($_POST['username']) . "', password = '" . mysql_real_escape_string(md5($_POST['password'])) . "', date_added = now()", $connection);
mysql_close($connection);
header('Location: index.php?step=4');
exit();
}
}
ob_start();
?>
Step 4 - Finished!
Don't forget to delete your installation directory!
Congratulations! You have successfully installed OpenCart.