Jump to content


Photo

Checking Page Call Using IFRAME


  • Please log in to reply
4 replies to this topic

#1 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 30 August 2006 - 01:52 PM

Hey

I am using iframe to call a page and show it in the iframe
Good as thats what iframe does.

Say The page is called
MyPage.php
and I am calling
callme.php

is there a way to check that callme.php is being called by MyPage.php
so then I can put something like below on callme.php

if(MyPage.php called this page){
//show Content
}else{
header("Location: index.php");
}

I hope this makes sence
Tell me the problem, I will try tell you the solution

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 30 August 2006 - 02:14 PM

$_SERVER['HTTP_REFERER'] should get you that info (my spelling might be a little off... check the manual).

Info: PHP Manual


#3 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 30 August 2006 - 02:52 PM

Does IFRAME work if $_SERVER['HTTP_REFERER']
Tell me the problem, I will try tell you the solution

#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 30 August 2006 - 03:00 PM

Loading a page through an IFRAME should work the same as if you loaded the page by refreshing the browser.

Info: PHP Manual


#5 scottybwoy

scottybwoy
  • Members
  • PipPipPip
  • Advanced Member
  • 532 posts
  • LocationUK

Posted 30 August 2006 - 03:09 PM

You might be able to do something like

$mypage = $_SERVER['HTTP_REFERER']
IF ($mypage = !NULL) {
// Show Content
} else {
header("Location: index.php");
}

surely you can put your <IFRAME> in the show content bit, hope that helps




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users