How to display a webpage from another domain in our php page

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: How to display a webpage from another domain in our php

Post by VladSun »

krieya wrote:I felt that it can be done if we can change the DOM in our browser using javascript or any other stuff however to access the DOM from other domain is causing cross domain issues.

Do I have any way to get this work done?
XSS is one of the biggest issues in browsers, so I really doubt you can bypass it.

I mean to use cURL as a proxy to fetch the content then display it under your domain. Then on form submittion / link click pass data to your cURL proxy which in turn submits data to the target site, get the contents and display it under you doman again. cURL will not "press" buttons, etc.

Not a very easy task to do though, becuase probably you will have to rewrite links, form action parameters etc.
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: How to display a webpage from another domain in our php

Post by Jonah Bron »

Oh, what you wanted wasn't clear before. I thought you literally wanted to log into Yahoo email.

Greasemonkey is your best bet. It's just a FF addon, so you don't need any administrative privileges to install. Just go here and click "Add to Firefox".

https://addons.mozilla.org/en-US/firefo ... asemonkey/

Simple as that. Then you can write what are called "user scripts" that do whatever you want (in Javascript). Write your scripts to programmatically fill out all your forms.
krieya
Forum Newbie
Posts: 14
Joined: Sat Mar 05, 2011 12:45 am

Re: How to display a webpage from another domain in our php

Post by krieya »

Actually, for testing purpose we are using IE browser hence I can downloaded GM for IE.

However we use FF,Safari,Opera,Chrome for browser testing so I am looking for a browser independent solution because we cannot write scripts for each browser.

Thanks for your guidance!!
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: How to display a webpage from another domain in our php

Post by Jonah Bron »

Greasemonkey is just the addon to Firefox for user scripts. There are plugins available for all browsers. See this article for IE, Safari, and Opera:

http://techie-buzz.com/tips-and-tricks/ ... afari.html

Chrome supports user scripts natively. Just create the script to fill out the form, and install it in all browsers.
krieya
Forum Newbie
Posts: 14
Joined: Sat Mar 05, 2011 12:45 am

Re: How to display a webpage from another domain in our php

Post by krieya »

I tried installing grease monkey for IE in my workplace and it is working very fine. Thanks alot, I feel like I have found the solution to my problem!!

Now, I want to make my own extension according to our need.

Is there any detailed step by step documentation to create a IE extention (to run our javascripts or jquery scripts). I am also planning to extend this support to firefox, opera, safari, chrome.

Thanks!!
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: How to display a webpage from another domain in our php

Post by Jonah Bron »

You mean user script? You can read the GreaseSpot Wiki here:

http://wiki.greasespot.net/Main_Page

And at http://userscripts.org , you can download other user scripts written by other people, and look at them as examples.

And here's a video tutorial:

http://codebazaar.blogspot.com/2010/11/ ... ey-do.html
krieya
Forum Newbie
Posts: 14
Joined: Sat Mar 05, 2011 12:45 am

Re: How to display a webpage from another domain in our php

Post by krieya »

No, I mean, I want to create a new extension for IE browser.

Is there any step by step procedure documented to create our own extensions for IE?

I am planning to develop an extension that will run my JAVA SCRIPTS or JQUERY scripts that were located in my system (eg: c:\sample.js)
For example: If I click a link on my webpage, scripts that were located in my system @ c:\sample.js should start execute on the currently open browser.

Thanks!!
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: How to display a webpage from another domain in our php

Post by Jonah Bron »

But why reinvent the wheel? Just do it with Greasemonkey. I don't know how to write plugins for IE though.
krieya
Forum Newbie
Posts: 14
Joined: Sat Mar 05, 2011 12:45 am

Re: How to display a webpage from another domain in our php

Post by krieya »

Actually, all my js scripts are in my server.

So first I will copy the script which I want to run to the local machine then the IE extension will read the copied JS and will execute them on the currently opened browser.

Since to get this task done with greasemonkey, the way it works is different however it is running the JS file in the way I want it.

Hence I want to develop a new extension for fitting my need.

Thanks Jonah Bron, for getting me all this way through!!
Post Reply