Reputation: 9539
I want to check using php if the current page is called by an iframe and not directly in the browser.
It's a page that gets some $_POST parameters while the sending form's target is an iframe, so the page will display in an iframe.
I want to check that using PHP, How?
Thanks.
Upvotes: 1
Views: 1584
Reputation: 15361
You can't. PHP runs serverside. It is for all intents and purposes the same thing as the webserver -- it sees HTTP requests and returns responses. An iframe is a clientside mechanism implemented by the browser that simply allows you to display 2 or more html pages (the response payload).
Upvotes: 3
Reputation: 49877
You can use the SERVER HTTP_REFERER
$_SERVER['HTTP_REFERER'];
Upvotes: 2