日期:2014-05-17 浏览次数:20481 次
<?php session_set_cookie_params(0,'/',''); session_name('S'); session_save_path(dirname(__FILE__).'/session/');//保存session的目录,还目录要存在,并有读写权限 session_cache_limiter('private, must-revalidate'); session_start(); $_WEBPASSWORD="123"; $_POST['webPassword'] && $_SESSION['webPassword']=$_POST['webPassword']; if($_SESSION['webPassword']!=$_WEBPASSWORD){ print <<<EOT <form action='' method='POST'> 请输入访问密码:<input name='webPassword'><input type='submit'> </form> EOT; exit; } ?>