开发者

Parent Iframe URL Query string

开发者 https://www.devze.com 2023-03-22 22:01 出处:网络
I am having a iframe withing facebook fanpage , the inner iframe is at my server a link开发者_Go百科 opens the same FanPage again in pop up using window.open javascript attaching a query string to it

I am having a iframe withing facebook fanpage , the inner iframe is at my server

a link开发者_Go百科 opens the same FanPage again in pop up using window.open javascript attaching a query string to it

window.open(path,'mywindow','scrollbars=yes,toolbar=no,menubar=no,status=no,width=805,height=400');

Variable path is same fanpage location with querystring attached to it

http://www.facebook.com/pages/mypagename/234234234?sk=app_3457124854683&a=1&b=10000

I need to get variables using php &a=1&b=100002212364645

Can somebody provide a way to access this in PHP?


you may be able to do that using JavaScript using analytic and this would be through referrer. Try using the referrer in php as iframes usually have the parent url as the referrer. But referrers maybe blocked by the user clients.


The only solution i can come up with is(which i actually forgot to Jquery Ajax when i am opening another window(pop up) and perform the action using AJax IT WORKS :)


This works for me you can modify it according to your code.

$parent_url = explode('?',$_SERVER["HTTP_REFERER"]);
$strings = explode('&',$parent_url[1]);

$_SERVER["HTTP_REFERER"] it shows the parent URL of the iframe.

You can use $strings as you can.

Hope you like that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号