无法重定向页面 [英] Unable to redirect a page

查看:77
本文介绍了无法重定向页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

分别在表单字段中输入 admin@mysite.com 传递,我希望页面重定向到admin.php。



但是代码中存在一些错误,即使输入表单字段也没有重定向。我努力但却找不到任何错误。有人可以帮忙吗?



index.php



On entering admin@mysite.com and pass in the form fields respectively, I want the page to redirect to admin.php.

But some some error is there in the code, its not getting redirected even if entering the form fields right. I tried hard but couldn't find any error. Can anyone help?

index.php

<form action = "<?php echo $_SERVER['REQUEST_URI']; ?>" method = 'post'>


                        <p><input name="email"  class = 'form-control' placeholder="Enter your Email ID" ></p>

                        <p><input name="pass" type = 'password'  class="form-control" id="exampleInputPassword1" placeholder="Password"></p>
                        <p><button type="submit" class="btn btn-danger">Enter</button></p>

                    </form>







<?php

$email = ($_POST[email]) ;
$pass = ($_POST[pass]) ;

       if (($email == 'admin@mysite.com') and ($pass == 'pass'))


       {

        header("Location: adminlogin.php");

       }


?>

推荐答案

_SERVER ['REQUEST_URI']; ?> 方法 =' 发布' >


< p > < 输入 名称 = email class =' form-control' 占位符 = 输入您的电子邮件ID > < / p >

< p > < 输入 名称 = 传递 类型 =' 密码' class = 表单控件 id = exampleInputPassword1 占位符 < span class =code-keyword> = 密码 > < / p >
< span class =code-keyword>< p > < 按钮 类型 = 提交 class = btn btn-danger > 输入< ; / button > < / p >

< / form >
_SERVER['REQUEST_URI']; ?>" method = 'post'> <p><input name="email" class = 'form-control' placeholder="Enter your Email ID" ></p> <p><input name="pass" type = 'password' class="form-control" id="exampleInputPassword1" placeholder="Password"></p> <p><button type="submit" class="btn btn-danger">Enter</button></p> </form>







<?php


email =(
email = (


_POST [email]);
_POST[email]) ;


这篇关于无法重定向页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆