July 15th, 2013, 07:31 AM
Trying to use PHP to bypass the iFrame 'Same Origin Policy'
I'm working on a project where I would like to load the contents of one webpage (that I'm not hosting) into a webpage that I am hosting with the ability to access the DOM of the non-hosted page.
If anyone has any advice as to whether it's possible to achieve this, I'd love to hear some feedback. Maybe PHP isn't even the answer. Maybe I'm going about this all wrong. I'm definitely open to any suggestions at this point!
Thanks for reading,
July 15th, 2013, 09:22 AM
You won't be able to iframe this or any other method, those security policies are there for a reason and they're written by people with a lot more skill than you (and access to the underlying browser code, which you cannot see).
A) Write a browser plugin which alters the GUI you're using for this, similar to Reddit Enhancement Suite.
B) Use PHP to pass through everything on the back end, dynamically rewriting it and serving it as though it's native content. This will be slow to execute since it requires 2 round trips instead of 1. There's a free proxy (I want to say ProxyDevil) which will help get you started with this.
C) Gain access to the source code of the UI you're talking about and modify it directly.
D) See if the system has an API with which you can make these calls, then write your own front-end, ignoring the GUI and making a SOA front-end of your own design, all in PHP.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.