Not sure if this should be in the PHP forum or here but here goes…
I’m trying to get this to work but with no luck…
<script type="text/javascript">
var lala = top.location.href;
</script>
<?
$topurl = $_GET['lala'];
echo 'Whats the url:'.$topurl;
?>
What I’m trying to accomplish is to get the parent url from within an iFrame using PHP… I have surfed around the net and found that using javascript would work, but I’m not getting the javascript variable into the PHP…? Why? and are this the right way to go???
The reason for all this is that I’m trying to make my page available on facebook to. And as I’m making my page a FB app using iFrame I would like to know if the user is getting to my page through facebook og just as my plain http://www.mypage.com
So I need to know if the page is as a child or as a parent… Does this make sense!!!
I get an “undifined” if it is in facebook (child) and the page url (www.mypage.com) if its parent… That is allright for me. Then I can set some rules if the page is undifined… But I still dont’ know how to get the javascript variable down as a php variable…