NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: MikeR on April 11, 2017, 08:41:33 AM

Title: Can you tell if you are serving pages into someone elses frame.
Post by: MikeR on April 11, 2017, 08:41:33 AM
If that makes sense let me try explain my problem

I have a clarion nettalk webserver.

I want it to run stand alone and send pages to the browser with headers foooters menus and main content. (the full monty)

I also want it to be embedded into another url in a frame.

If its being served inside the other site inside the frame I need to drop off the header and footer. I still want the menu buttons.
In some cases I want no header no footer and no buttons.

I hope that makes sense ?

Title: Re: Can you tell if you are serving pages into someone elses frame.
Post by: Bruce on April 12, 2017, 05:38:26 AM
Hi Mike,

the easiest approach is if the "embedded url" includes a parameter which you test for.
For example

www.capesoft.com/home.htm  <-- regular URL for browser

www.capesoft.com/home.htm?embedded=true  <--- use when embedding iFrame.

Then you can do a StoreValue to move it into the SessionQueue, and in the header and footer procedure put appropriate conditionals around your xHTML's.

Make sense?

If the parameter is not possible, then you could check the referer header on the server side, but that would be less reliable.

cheers
Bruce