index.php

来自「一开始是CPM电脑上的游戏」· PHP 代码 · 共 52 行

PHP
52
字号
<?php$output = "<HTML><BODY>\n";global $HTTP_POST_VARS, $HTTP_GET_VARS;require ("Drivers/mySQL.php");require("conf.php");$DB = new sql_driver;$DB->param['sql_database'] = $CONF['database'];$DB->param['sql_user']     = $CONF['login'];$DB->param['sql_pass']     = $CONF['password'];$DB->param['sql_host']     = $CONF['host_name'];$DB->connect();$output .= "<center><Font size = +2>PHP Ladder System</font></center><BR>\n";$output .= "<A HREF=\"index.php?action=main\">Home</a>\n";$output .= "<A HREF=\"index.php?action=report&code=0\">Report a game</a>\n";$output .= "<A HREF=\"index.php?action=register&code=0\">add user (temp until signups added)</a>\n";$output .= "<A HREF=\"index.php?action=viewLadder\">View Ladder</a><BR><BR>\n";//decide what to do//default is view main page. $action = $HTTP_GET_VARS['action'];$choice = array(                 "main"      	=> "mainpage",                 "viewLadder"   => "viewLadder",                 "report"		=> "reportGame",                 "register"		=> "register",               );// Check to make sure the array key exits..if (! isset($choice[ $action ]) ){	$action = "main";}$whatToDo = $choice[ $action];require ("Sources/".$whatToDo.".php");$output .= "</BODY></HTML>";print($output);?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?