很容易呀,
if($password=="******")
  //则,显示页面
else
  //否则,显示登录页面当然,这里可以加入session,来保存登录密码。

解决方案 »

  1.   

    大家都是一样的观点用session没错,你如果能把你的问题或代码说得详细一点更好,我帮你写一下代码@!
      

  2.   

    我不想用数据库管理密码?我有个对html页面密码访问的老办法,也很好,用不用?
      

  3.   

    登录页面:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    <form name="form1" method="post" action="pass.php">
      <p> 用户名: 
        <input name="username" type="text" id="username">
      </p>
      <p> 密码: 
        <input name="password" type="password" id="password">
      </p>
      <p>
        <input name="send" type="submit" id="send" value="提交">
      </p>
    </form>
    </body>
    </html>
    处理页面:<?php
    /*
    程序编写:偶然
    编写时间:2003.7
    本页功能:判断用户是否登录
    */
    session_start();
    if(session_is_registered("username")&&session_is_registered("password")) {
    echo "你已经登录!";
    $username=$_POST['username'];
    $password=$_POST['password'];
    }
    else {
    session_register("username");
    session_register("password");
    }
    ?>
      

  4.   

    <?php
     if(file_exsits($password)){
       echo "密码正确";
     }else{
       echo "密码错误";
     }
    ?>=========你可以在当前目录建立个密码文件,文件名就是密码(没有扩展名的,除非你密码有.php等这样的字符存在,当前目录禁止Indexs);不记得密码的话ftp上去改一下文件名就行了.
      

  5.   

    补充:$password为你提交过来的密码,可以直接在浏览器中输入,也可以通过POST方式传递过来,或通过SESSION,COOKIE等方式转过来,判断前将$password=$_GET['password'];//(.....你用那种方式传递就用哪个数组获得...)