[英]PHP, How to add php code inside redirect_uri?
i have a facebook code:我有一个 facebook 代码:
<iframe src="http://www.facebook.com/plugins/registration.php?
client_id=138987726427834&
redirect_uri=https://xxx.com/login.php?login=<?php echo $login; ?>&pass=<?php echo $pass; ?>&
fields=<?php echo urlencode($fields);?>"
</iframe>
i was wondering why the $login
and $pass
dont work inside the redirect_uri
?我想知道为什么
$login
和$pass
在redirect_uri
内不起作用? they don't render inside the link.它们不会在链接内呈现。
i see that the ields=<?php echo urlencode($fields);?>"
takes php.我看到
ields=<?php echo urlencode($fields);?>"
需要 php。
any idea?任何想法?
thanks谢谢
You probably want to escape that parameter with你可能想用
redirect_uri=<?php echo urlencode("https://xxx.com/login.php?login={$login}&pass={$pass}"); ?>&
If you don't URL encode the URL, then you will send the parameters login
and pass
to registration.php
, not to login.php
. If you don't URL encode the URL, then you will send the parameters
login
and pass
to registration.php
, not to login.php
.
Also, passing sensitive data such as passwords directly as GET variables is a bad practice.此外,将密码等敏感数据直接作为 GET 变量传递是一种不好的做法。 You might at least encrypt the password if you have to send it via GET.
如果您必须通过 GET 发送密码,您至少可以加密密码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.