![](/img/trans.png)
[英]Form validation doesn’t work after adding the database in the add.php page (A project from net ninja)
[英]how can i redirect a user to custom url after adding page through add.php (Facebook)
通过add.php添加用户后,如何将用户重定向到刚刚添加的页面?
假设我的网址看起来像: http : //www.facebook.com/add.php? api_key=API_KEY&pages =1
从选择框中选择页面并单击“添加MY_APP_NAME”后,用户将被重定向到页面的墙壁,而不是新添加的MY_APP。
注意
我在这里知道很多这类问题,但我还没有找到任何解决方案,为什么我再次在这里提出这个问题...。
试过了
我使用Javascript进行了这样的尝试,但严重失败
<script>
if (window == top) {
top.location.href = 'https://apps.facebook.com/abc/' + document.location.href.replace(/https?:\/\/[^/]*\/?/, '');
}
function addToPage(page_id){
top.location.href = 'http://facebook.com/add.php?api_key=<?php echo C_APP_ID; ?>&pages&perms=publish_stream&page='+page_id;
}
</script>
见图片
https://www.facebook.com/dialog/pagetab? app_id=APP_ID& display=popup& next=https://facebook.com
使用此替代方法,您可以在与对话框交互以next
参数中将应用程序添加到页面后指定要重定向到的URL。
您可以尝试将该参数添加到您的请求中。
next
参数的其他可能替代方法是-
redirect_url
redirect_uri
两者都在与重定向用户打交道时在其他地方使用-也许其中之一也会为您提供帮助...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.