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...
var lala = top.location.href;
$topurl = $_GET['lala'];
echo 'Whats the url:'.$topurl;
Thanks in advance
Your code will not work becouse PHp is prossed before jour jaascript starts.
So your PHp part will loas first.
what you can do is sen the data via a redirect.
howevver what is the aim of knowing the top location?
Not sure what you mean?!?!
First you need to know that PHP code is ran at the server side;
(so everything between <? ?> is executed before your browser starts reading the page.
When the page is read, your browser runs all scripts between <script> tags. (ans parses HTML)
How can I change this?
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?!?!
You might be able to tell where your visitor is from by checking the referer header in PHP (assuming your visitor hasn't turned it off)
Well, if I use this: