开发者

navigating from one php page to other

i made a form in which i input login information....if the information was correct the n开发者_运维技巧ext page opened else the login form appeared again with 'wrong info' note....for this i wrote the following code in the login.php(form page)...first within php tags i wrote

if( isset( $_POST["h11"]))  
{echo "wrong password";}

and then below this outside the php tags, within the form tags , i set the value of h11(type hidden) to true...after this i coded the entire login form with action="loginback.php"...now in loginback.php i tested if username and password provided by the user are correct...if not i redirected the page to login.php using header("location:login.php")....now my problem is that the message wrong password is not being displayed as when we redirect to login.php from loginback after checking inputted info,the value of isset() becomes 0 again...so plz tell me how can i make this message appear...?


Simple, just add code in login.php to check for $_REQUEST['h11'] instead, and append the querystring in your header code.

loginback.php has

header("location:login.php?h11=blah");

login.php has

if( isset( $_REQUEST["h11"]))
{echo "wrong password";}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜