29 require_once
'./include/common.inc.php';
30 defined(
'XOOPS_INSTALL') or die('XOOPS Installation wizard die');
44 if (
$_SERVER[
'REQUEST_METHOD'] ==
'GET' && isset(
$_GET[
'charset']) && @
$_GET[
'action'] ==
'updateCollation') {
49 if (
$_SERVER[
'REQUEST_METHOD'] ==
'POST') {
50 $params = array(
'DB_NAME',
'DB_CHARSET',
'DB_COLLATION',
'DB_PREFIX' );
51 foreach ($params as $name) {
57 if (
$_SERVER[
'REQUEST_METHOD'] ==
'POST' && !empty(
$vars[
'DB_NAME'])) {
61 if (!@mysql_select_db(
$vars[
'DB_NAME'], $link)) {
63 $result = mysql_query(
"CREATE DATABASE `" .
$vars[
'DB_NAME'] .
'`' );
69 if ($db_exist &&
$vars[
'DB_CHARSET']) {
70 $sql =
"ALTER DATABASE `" .
$vars[
'DB_NAME'] .
"` DEFAULT CHARACTER SET " . mysql_real_escape_string(
$vars[
'DB_CHARSET']) .
71 (
$vars[
'DB_COLLATION'] ?
" COLLATE " . mysql_real_escape_string(
$vars[
'DB_COLLATION']) :
"");
72 if (!mysql_query(
$sql)) {
83 if (@empty(
$vars[
'DB_NAME'])) {
86 array(
'DB_NAME' =>
'xoops',
87 'DB_CHARSET' =>
'utf8',
89 'DB_PREFIX' =>
'x' . substr(md5(time()), 0, 3),
96 <?php
if (!empty(
$error)) echo
'<div class="x2-note errorMsg">' .
$error .
"</div>\n"; ?>
98 <script type=
"text/javascript">
99 function setFormFieldCollation(
id, val)
101 var display = (val ==
'') ?
'none' :
'';
102 $(id).style.display = display;
104 id,
'<?php echo $_SERVER['PHP_SELF
']; ?>',
105 { method:
'get',parameters:
'action=updateCollation&charset='+val }
121 include
'./include/install_tpl.php';