⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 一个页面界面的邮件程序
💻 PHP
字号:
<?php     
require_once ("inc/constants.inc.php");
require_once ("inc/properties.inc.php");
require_once ("inc/tools.inc.php");
require_once ("inc/db.inc.php");
require_once ("inc/i18n.inc.php");

$js = "";
$err = "";

/* S'il y a une session, on redirige */
if (isset($_SESSION['user'])) {
	header("Location: ./main.php");
	die();
}

if (isset($_POST['submit'])) {

	$result = mysql_query("SELECT * FROM user WHERE email = ".prepSqlValue($_POST['email'])." AND password = ".prepSqlValue(md5($_POST['password'])));

	if (!$result || mysql_num_rows($result) == 0) {
		$err = ERROR_BAD_LOGIN;
	} else
		if (mysql_num_rows($result) == 1) {
			$line = mysql_fetch_assoc($result);
			$_SESSION['user'] = $line['id'];
			$js = WAITING_MESSAGE ."	<script language=\"Javascript\" type=\"text/Javascript\">document.location='main.php';</script>";
		} else {
			$err = ERROR_2_USERS_WITH_SAME_EMAIL;
		}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo  strtolower($_SESSION['lang']); ?>" lang="<?php echo  strtolower($_SESSION['lang']); ?>">
        <head>
		<title><?php echo  APP_TITLE; ?></title>
		<meta http-equiv="Content-Type" content="text/html; charset=<?php echo ENCODING; ?>" />
		<link rel="StyleSheet" type="text/css" href="css/common.css" title="Default"  media="screen" />
		<style type="text/css">
			#center {
				margin: 0 auto;
				text-align: center;
				margin-top: 20px;
				width: 500px;
			}
			#login {
				margin: 0 auto;
				text-align: left;
				width: 360px;
			}
			#logos {
				margin-top: 10px;
				float: right;
			}
			#footer {
				clear: both;
				border-top: 1px solid #333333;
				padding-top: 10px;
				text-align: center;
				font-size: small;
			}
			#message {
				display: none;
				margin: 0 auto;
				margin-bottom: 10px;
				padding: 10px;
				width: 60%;
				border: 1px solid green;
				background-color: #F0FFF1;
			}
		</style>
		<script type="text/javascript">
//		<![CDATA[
			var msg_Desc = 				"<?php echo prepareText("<h2>". DESC_TITLE ."</h2>". DESC); ?>",
				msg_MoreInfo = 			"<?php echo prepareText("<h2>". MORE_INFO_TITLE ."</h2>". MORE_INFO); ?>",
				msg_Contact = 			"<?php echo prepareText("<h2>". CONTACT_TITLE ."</h2>". CONTACT); ?>";			

			function showMessage(msg) {
				var div = document.getElementById("message");
				div.innerHTML = msg;
				div.style.display = 'block';
			}
//		]]> 			
		</script>
	</head>
	<body>
		<div style="color: green;"><?php echo  $js; ?></div>		
		<div class="cadre" id="bandeau">
			<h1 id="logo"><?php echo  APP_NAME; ?></h1>
			<div id="rightItems">
				<div id="languageBar">
					<a href="?change_language=<?php echo  FRENCH; ?>" class="<?php echo  $languageStyle[FRENCH]; ?>" title="<?php echo  A_FR_TITLE; ?>"><?php echo  A_FR; ?></a>&nbsp;|&nbsp;
					<a href="?change_language=<?php echo  ENGLISH; ?>" class="<?php echo  $languageStyle[ENGLISH]; ?>" title="<?php echo  A_EN_TITLE; ?>"><?php echo  A_EN; ?></a>&nbsp;|&nbsp;
					<a href="?change_language=<?php echo  GERMAN; ?>" class="<?php echo  $languageStyle[GERMAN]; ?>" title="<?php echo  A_GE_TITLE; ?>"><?php echo  A_GE; ?></a>&nbsp;|&nbsp;
					<a href="?change_language=<?php echo  SPANISH; ?>" class="<?php echo  $languageStyle[SPANISH]; ?>" title="<?php echo  A_ES_TITLE; ?>"><?php echo  A_ES; ?></a>&nbsp;|&nbsp;
					<a href="?change_language=<?php echo  POLISH; ?>" class="<?php echo  $languageStyle[POLISH]; ?>" title="<?php echo  A_PL_TITLE; ?>"><?php echo  A_PL; ?></a>&nbsp;
				</div>
			</div>
			<div style="clear: both;"></div>
		</div>
		<div id="logos">
			<a href="http://validator.w3.org/check?uri=http://<?php echo  URL; ?>" style="background-color: white;" title="HTML Validator">
				<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" />
			</a><br/>
			<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://<?php echo  URL; ?>" style="background-color: white;" title="CSS Validator">
				<img style="width:88px;height:31px" width="88" height="31" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/>
			</a><br/>
			<a href="http://sourceforge.net/projects/gcontact" style="background-color: white;" title="GContact on sourceforge">
				<img src="http://sourceforge.net/sflogo.php?group_id=113789&amp;type=1" width="88" height="31" alt="SourceForge.net Logo" />
			</a><br/>
		</div>
		<div id="center">
			<div id="login">
				<form id="formlogin" action="index.php?<?php echo prepShowValue($HTTP_SERVER_VARS["QUERY_STRING"]); ?>" method="post">
					<fieldset>
						<legend><?php echo  CONNECT; ?></legend>				
						<label for="email"><?php echo  EMAIL; ?> :&nbsp;</label><input type="text" id="email" name="email" tabindex="1" value="<?php echo  (isset($_POST['email']) ? prepShowValue($_POST['email']) : ""); ?>" size="24" maxlength="40"/><br/>
						<label for="password"><?php echo  PASSWORD; ?> :&nbsp;</label><input type="password" id="password" tabindex="2" name="password" size="24" maxlength="16"/><br/>
						<p style="text-align: center;">
							<input type="submit" name="submit" tabindex="3" value="<?php echo  CONNECT_ACTION; ?>"/><br/>
						</p>
					</fieldset>
					<p style="text-align: center;">
						<strong><?php echo  $err; ?></strong>
					</p>
				</form>
			</div>
				<p><a href="#" onclick="showMessage(msg_Desc); return false;"><?php echo  DESC_TITLE; ?></a>
				 - <a href="#" onclick="showMessage(msg_MoreInfo); return false;"><?php echo MORE_INFO_TITLE; ?></a>
				 - <a href="#" onclick="showMessage(msg_Contact); return false;"><?php echo CONTACT_TITLE; ?></a>
				</p>
		</div>
		<div id="message"></div>
		<div id="footer">
			<p><?php echo  $VERSION_MESSAGE; ?></p>			
		</div>
		<script type="text/javascript">		
			/*
			 * Set focus to email text field.
			 */
			document.getElementById("email").focus();
		</script>
	</body>
</html>

⌨️ 快捷键说明

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