📄 login.php
字号:
<?php/** PHP STOCK TRACKER* -----------------* A multi-user utility for creating and managing stock* watchlists and historical analysis.* Copyright (C) 2005 Joshua Eldridge (joshuae74@hotmail.com)*** This program is free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with this program; if not, write to the Free Software* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA** See the COPYING file for full details.*/// Prevent this page from being accessed directly as// it should always be called from within index.phpif (!defined('IN_VALID')) { die("Error: This File Cannot Be Accessed Directly");}if( $_SERVER['REQUEST_METHOD'] == "POST" ) { session_start(); // The page has been posted and should contain the user id // Clean posted variable up and assign the value to the session $_SESSION['user_id'] = getCleanVar($_POST, 'user'); // Redirect to the main page again with the session intiated session_write_close(); header('Location: ' . $_SERVER['PHP_SELF'] . '?pg=home'); exit;}// Otherwise display the login forminclude('inc/header.inc.php');// Poll the database and retrieve user information to populate the user select// drop down$users = get_users();?><div class="login" style="background-color:<?= $row_primary ?>; border-color=<?= $header_row ?>;">Please Select Your Name:<p><form name="login" action="<?= $_SERVER['PHP_SELF'] ?>" method="POST"><select name="user"><?phpforeach($users as $user) { echo '<option value="' . $user['id'] . '">' . $user['name'] . '</option>';}?></select><input type="submit" value="Log In"></form></div><?phpinclude('inc/footer.inc.php');?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -