Forum Moderators: coopster

Message Too Old, No Replies

Pass form results url in external page

         

aragorn21

8:10 am on Feb 23, 2010 (gmt 0)

10+ Year Member



I have used this code:

$url = $_REQUEST['url'];
<iframe src="$url"></iframe>


to build a simple output.php file that shows in its iframe the url i type in the address bar:

www.mysite.com/output.php?url=http://www.google.com for example.

Now I want to use a search form that is not on my server, to output its results in the above or similar iframe. For example the search form produces a result url like so:
http://www.domain.com/searchresults.html?fmt=http://www.domain.com/index.php?variable1=value&variable2=value2
etc. I need to place in the search form a "&target=SOMETHING" so I can use that after to direct the results inside my iframe, by passing the above results URL to my www.mysite.com/output.php?url=HERE

Any ideas?

coopster

1:52 pm on Feb 26, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, aragorn21.

Are you trying to do this in the client browser? If so, you can use an asynchronous call (AJAX) to retrieve the request and populate the frame. If it is a server-side process you can use the PHP file_get_contents() function or perhaps the cURL functions if you need to use something a little more advanced.