Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know if my page is running in a facebook iframe or not

Tags:

php

facebook

I'm currently developing a site which runs standalone and as a facebook app on an iframe I was wondering what whold be "best practice" for checking if my page is ran in a facebook iframe before the page loads so I can preset the relevant CSS and other variables

Thanks.

like image 841
Roy Toledo Avatar asked Oct 16 '11 10:10

Roy Toledo


1 Answers

$signed_request = $_POST['signed_request'];

if(empty($signed_request))
      die('No direct access.');
like image 167
Dejan Marjanović Avatar answered Oct 24 '22 11:10

Dejan Marjanović