日期:2014-05-17  浏览次数:20734 次

如何在这个文件中实现保存账号密码并写入到一个文件中?
PHP code
<?
require_once("php/report/include/cookie.php");
$domain = trim($_SERVER["SERVER_NAME"]);
if(file_exists("/var/eyou/apache/htdocs/".$domain))
{
    include("$domain");
    exit;
}
?>

<html>
<title>青岛职业技术学院电子邮件系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript" src="/js/jquery-1.2.6.js"></script>
<style type="text/css">
<!--
.font{
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #4c4c4c;
}
.input {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #4c4c4c;
}
body{
    margin: 0px;
}
.message{
    color:red;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}
-->
</style>
<script language="javascript">
$(document).ready(function() {
    $("#submit").click(function(){
        login();
        return false;
    })
});
function login() {
    var messageDefault = "系统错误,请稍候再试。";
    formData = $("input, select").serialize();
    $.ajax({
        type: "post",
        url: "/cgi-bin/user_login",
        data: formData + "&rnd=" + parseInt(Math.random()*9999),
        dataType: "html",
        success: function (dataRes) {
            switch ($.trim(dataRes)) {
                case "0":
                window.location = "/cgi-bin/user_login";
                break;
                case "2":
                $TxtFileName    = "Demo.txt"; 
                //showMessage($TxtFileName);
                showMessage("您输入的用户或密码错误");
                break;
                case "3":
                showMessage("本系统已禁止使用别名登录,请使用真实用户名登录。");
                break;
                case "4":
                showMessage("由于该用户尝试的登录次数达到最大值,已被禁止登录。");
                break;
                case "5":
                    showMessage("您输入的密码错误");
                break;
                case "6":
                    showMessage("该用户已经被锁定");
                break;
                case "7":
                    showMessage("该用户所在的域已经过期");
                break;
                case "8":
                    showMessage("该用户已经过期");
                break;
                case "9":
                    showMessage("您输入的域名错误");
                break;
                case "10":
                    showMessage("用户提交的验证码错误");
                break;
                case "11":
                    showMessage("license过期,请与管理员联系");
                break;
                case "12":
                    showMessage("用户输入的密码过短");
                break;
                case "13":
                    showMessage("导用户信件出错");
                break;
                case "14":
                    showMessage("异常错误");
                break;
                case "15":
                    showMessage("非法用户名");
                break;
                case "16":
                    showMessage("非法域名");
                break;
                case "17":
                    showMessage("您所在的组不允许您用页面登陆邮箱");
                break;
                    default:
                case "1":
                    showMessage(messageDefault);
                break;
            }
        },
        error: function () {
            showMessage(messageDefault);
        }
    });
}

function showMessage(message) {
    $