c5_labsci/web/install.php
2026-01-27 00:52:00 +08:00

42 lines
1.3 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
// 正式部署删除该文件。
$act = @$_GET['act'] . '';
if ($act == 'time')
echo date('Y-m-d H:i:s') . '  v' . phpversion();
if ($act == 'db') {
$ret = $db->connect();
if (!$ret->isconnected)
die($ret->error);
$cfg = webini('db');
$dbname = $cfg['name'];
$schema = $db->getraw('SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = ?', array($dbname));
if (count($schema) == 0)
die('应建立' . $dbname . '数据库实例');
$csql = new \ciy\sql('zc_admin');
$userrow = $db->getone($csql);
if ($userrow === false) {
if (strpos($db->error, 'exist') !== false)
die('数据表没导入,需在' . $dbname . '中执行c5_ciyon.sql建立表');
else
die($db->error);
}
$ver = $db->getraw('SELECT VERSION() as ver');
echo '数据库连接成功  v' . $ver[0]['ver'];
echo '<br/>登录账号: ' . $userrow['mobile'];
echo '<br/>初始密码: 123654';
echo '<br/><a href="/admin/" target="_blank">前往登录</a>';
echo '<br/><a href="?act=phpinfo" target="_blank">显示PHPInfo</a>';
}
if ($act == 'phpinfo')
echo phpinfo();
?>
</body>
</html>