简体   繁体   English

PHP,如何在redirect_uri中添加php代码?

[英]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$passredirect_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.

相关问题 Facebook PHP SDK 上的“redirect_uri URL 必须是绝对的”错误 - “The redirect_uri URL must be absolute” error on Facebook PHP SDK 在getLoginUrl中包含redirect_uri时出错(Facebook PHP SDK) - Error when including redirect_uri with getLoginUrl (Facebook PHP SDK) redirect_uri URL必须是绝对的Facebook登录PHP SDK - The redirect_uri URL must be absolute Facebook login PHP SDK facebook PHP SDK redirect_uri到页面选项卡 - facebook PHP SDK redirect_uri to page tab php sdk的Facebook&#39;redirect_uri&#39;参数未重定向到传递的uri(重定向仅返回首页) - Facebook 'redirect_uri' param for php sdk not redirecting to passed uri (redirects only return to homepage) 如何在PHP代码里面添加PHP代码? - How to add PHP code inside PHP code? 使用PHP,redirect_uri和app url的Shopify API必须具有匹配的myshopify.com主机? - Shopify API using PHP, redirect_uri and app url must have matching hosts of myshopify.com? 通过PHP SDK v4登录Facebook。 返回“无效的redirect_uri” - Facebook Login via PHP SDK v4. returns “Invalid redirect_uri” redirect_uri URL必须是绝对URL(使用localhost中的php登录Facebook) - The redirect_uri URL must be absolute (Facebook login using php in localhost) Facebook 如何手动构建登录流程 (PHP) 错误“您的 redirect_uri 与您在 OAuth 对话请求中使用的不同” - Facebook How Manually Build a Login Flow (PHP) error “your redirect_uri isn't identical to the one you used in the OAuth dialog request”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM