I have made a facebook application
I have uploaded all my code on my server, so facebook can retrieve it from there.
All my code is in HTML, php and javascript.
When the user visits http://www.mywebsite.com/facebook/app they will go to my index.php file.
But if the user types in http://www.mywebsite.com/facebook/app/pictures/picture.jpg he will see the picture.
Now I want to make sure, this content only can be access through facebook.
So I want to redirect everybody who tries to enter http://www.mywebsite.com/facebook/app/…./ to my facebook application http://www.facebook.com/myapp
Is there any way to do this?
Thank you
While it is very unreliable you could use the $_SERVER[‘HTTP_REFERER’] variable in php to see if the user typed in the url directly in their browser. It will be empty if the user has typed in the url directly, but i believe it should be set if your page is embedded through facebook.
see http://www.electrictoolbox.com/php-http-referer-variable/ for more info