Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6367485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:33:12+00:00 2026-05-25T00:33:12+00:00

My first post here! My question relates to iframes and php mostly So… it’s

  • 0

My first post here! My question relates to iframes and php mostly

So… it’s impossible for PHP to check if a page was requested through an iframe. This question seems to be asked (and answered) a lot, but would it be possible to create an “iframe context” and maintain that context throughout the navigation within an iframe?

For example :

<iframe src="/my/url?location=iframe"></iframe>

we could initially check if ($_GET[‘location’] == ‘iframe’)

however, as navigation goes on, you can imagine what happens. Links are click, forms are submitted, and they don’t necessarily have ?location=iframe.

So, I’m trying to figure out how to create an initial context that begins with the url parameter above and persists within the iframe only.

Just to be clear, in my example the iframe contains pages from the same site.

Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:33:13+00:00Added an answer on May 25, 2026 at 12:33 am

    What if you set the initial URL to /iframe/my/url when it’s loaded in an iframe, and /my/url when it isn’t, and either:

    • Create a symlink (or an NTFS junction) in your document root called ‘iframe’ that points to your document root and parse $_SERVER['PHP_SELF']
    • use mod_rewrite to rewrite the URL so it points to the right place and has the location=iframe or maybe #iframe tagged onto it

    The first option is probably the best, although all your paths would have to relative. This means all your paths will stay within the /iframe/ path and you never need to alter your links – everything is processed for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time here so I hope I post this question at
First post here... I normally develop using PHP and Symfony with Propel and ActionScript
this is my first time to post a question here, I will try to
This is my first post in here and I wouldn't post a question here
This is my first post here. My question is similar to a previous thread
This is my first post to this website. Here is my question: I want
first post here, and probably an easy one. I've got the code from Processing's
first post here, I come in peace :) I've searched but can't quite find
My first post here, so i hope this is the right area. I am
This is my first post here and I wanted to get some input from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.