慕田峪7331174
在用户名 密码验证页面,<?php/////////if ( /*用户名密码验证失败*/ ){?><form id="form1" name="form1" method="post" action="login.php"><input name="login" type="hidden" id="login" value="fall" /></form><script language="JavaScript" type="text/javascript">document.getElementById("form1").submit();</script><?phpexit();//表单自动post提交}?>方法二<?phpsession_start();/////////if ( /*用户名密码验证失败*/ ){$_SESSION['login'] = 'fall';header('location:login.php');exit();}?>在login.php<?phpsession_start();if ($_SESSION['login'] == 'fall' ){echo '<a>登陆失败</a>';$_SESSION['login'] = '';}?>方法三:<?phpif ( /*用户名密码验证失败*/ ){setcookie("login","fall",time()+7200,"/");header('location:login.php');exit();}?>在login.php<?phpif ($_COOKIE['login'] == 'fall' ){echo '<a>登陆失败</a>';$_SESSION['login'] = '';}?>