PHP - 无法从以前的URL继续_GET [英] Php - unable to carry over _GET from previous url

查看:48
本文介绍了PHP - 无法从以前的URL继续_GET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以这是我的唯一问题。由于某种原因,URL不会带来获取,但它会继承POST信息。这里有一个问题的主线是http://www.mywebsite.com/resetpass.php?email=$email&hash=$hash&password=$password当网站加载你得到的全部是:http:/ /www.mywebsite.com/resetpass.php?email=&hash=&password=PASSWORDWORKS



我也担心这个过程的安全性但是在一个php网站上完成一个底层系统非常复杂



Alright so here is my ONLY problem. For some reason the URL does not carry over the "gets" but it DOES carry over the POST information. The main line that's a problem here is "http://www.mywebsite.com/resetpass.php?email=$email&hash=$hash&password=$password" when the website loads all you get is: http://www.mywebsite.com/resetpass.php?email=&hash=&password=PASSWORDWORKS

I'm also afraid of the security for this process but it is very complicated to do an under-laying system all on one php website

<form action="resetpass.php" id="form" method="post" name="form">
New Password: <input type="text" name="password"><br>
Confirm Password: <input type="text" name="confirm"><br>
<input type="submit" name="submit" value="Change Password">
</form>

<?php

//no way to hide pass in link for this part?
if(isset($_POST['submit']))
{
    $password = $_POST['password'];
    $confirm = $_POST['confirm'];
    if ($password == $confirm && !empty($password) && !empty($confirm))
    {
        $hash = $_GET['hash'];
        $email = $_GET['email'];
        //echo "<script>document.location.href=resetpass.php?email=".$email."&hash=".$hash."&password=".$password."</script>";
        header("Location: http://www.mywebsite.com/resetpass.php?email=$email&hash=$hash&password=$password");
        //header("Location: http://www.mywebsite.com/resetpass.php?email=".$email."&hash=".$hash."&password=".$password);
        exit;
    }
    else
    {
        echo('Passwords do not match!<br/>Go back and try again.');
    }
}
?>





我尝试了什么:



我只是把获取扔到了所有地方,并将网址注释为替代方法。看看它是否会在某个时刻获得价值,但由于某种原因,无论我做什么,它都不会带来。缺少什么?



What I have tried:

I just threw "get's" all over the place and commented out urls as alternative methods. to see if it would pick up the values at some point but for some reason it never carries no matter what i do. What's missing?

推荐答案

email& hash =
email&hash=


hash& password =
hash&password=


密码当网站加载所有你得到的是:http://www.mywebsite.com/resetpass.php?email =& hash =& password = PassWORDWORKS



我也害怕这个过程的安全性但是在一个php网站上做一个底层系统非常复杂



password" when the website loads all you get is: http://www.mywebsite.com/resetpass.php?email=&hash=&password=PASSWORDWORKS

I'm also afraid of the security for this process but it is very complicated to do an under-laying system all on one php website

<form action="resetpass.php" id="form" method="post" name="form">
New Password: <input type="text" name="password"><br>
Confirm Password: <input type="text" name="confirm"><br>
<input type="submit" name="submit" value="Change Password">
</form>

<?php

//no way to hide pass in link for this part?
if(isset(


这篇关于PHP - 无法从以前的URL继续_GET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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