need some help php / .htacces

seoweb

Registered Member
Joined
Jan 20, 2009
Messages
85
Reaction score
28
i have two pages: A and B (.php)

in A i have

<IFRAME SRC="mov/b.php" >
</IFRAME>

in B i have some functions.

facts: is a necessity to have that iframe

problem: i need to block direct acces(visitors) to mov/b.php but in the same time i need the page B to work for me.
I need that page to work only when in used in page A (in the iframe) and to have it block for other use.

How do i do that? Can somebody help? I can't figure it out by myself.

Thank you!
 
You can do it by checking referrer in file B.
Or by creating session in file A then, check that session in file B, if it doesn't match, redirect to file A.
 
i will try "You can do it by checking referrer in file B."

"Or by creating session in file A then, check that session in file B, if it doesn't match, redirect to file A." the problem is if the user has A open then the seesion will work for B (i think not sure... i will check)

i have a java script, but java can be stoped and my script won't work anymore:

var isInIFrame = (window.location != window.parent.location) ? true : false;
if(!isInIFrame) {
window.location = "../index.php";
}

thank you!
 
Back
Top