Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using PHP to get Outer Frame URL

Status
Not open for further replies.

Actorial

Programmer
Aug 23, 2006
38
0
0
US
Hi,

I've designed a piece of php/mySQL software on one website that I want implement across a number of other websites. I do not want to transfer this software to each site, I just want to use it in a frame on all the other websites. Each individual client wants to have their own banner at the top, so essentially, I'm looking at using frames (i know, i know, frames suck) to show their banner on top but run the software from the other website in the lower frame. What I want to do is have the software on the original site get the outermost frame URL so I can track what website the visitor is viewing the software from. I hope that makes sense.

Ideas? None of the HTTP_REFERER or HTTP_HOST variables seem to be what I'm looking for.
 
Well, with a frame, the browser is actually calling your frame window uniquely, as far as your server would be concerned. Meaning your served "session" is essentially a standalone page.

If you have control over the frameset code, then you can do a few things...

- include the calling URL via a GET String,
- require a form POST with the URL as a hidden value in order to get the session started,
- mandate/design such that the variable source header is included as an IFRAME or PHP include based upon the URL or something else and leave your code under your URL for the whole page

Including your code via IFRAME would still require passing the URL or some identifying value/code from the source to you...

That's the best I can offer, but there are many more smart ppl here, so perhaps there's another option...

D.E.R. Management - IT Project Management Consulting
 
Hmm I thought about passing a get variable to the system with the outer frame url, only problem is I would have to track that url value throughout the entire site, which is a bear.

What about if I set URL variable using a cookie, would that work?
 
If you receive the URL or someother code as a GET parm, then you can store it in a session available for reference by the server.

You could set it as a cookie AFTER the URL/code parm was passed, but you're still dependent upon the originating frameset code to give you the seed value.

You may want to talk to the Javascript forum, they may know a way to ask "who's my frame parent", as part of reverse-engineering a frame-busting methodology. That's another alternative you might consider.

It all can be faked and manipulated before it gets to your control, so please be cautious in how much you trust what you're supplied through any of these means.

D.E.R. Management - IT Project Management Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top