Welcome Guest, Not a member yet? Register   Sign In
Need to load a foreign page somehow
#1

[eluser]gloosemo[/eluser]
I need to load another page into my page so i can access tables on a page that is from a foreign site.

Initially i was trying to use jquery and ajax, but that restricts accessing foreign domains. I was told to use server code to load the page onto a page on my server, then access that via ajax.

How do i do it? redirect just redirects me to the page. I actually want a foreign page content to end up in a div on my page, or something like that.

For example, if i wanted to get www.google.com html content (tables, etc..) i need a way to do it

Thanks in advance.

#2

[eluser]weboap[/eluser]
use curl to pull the page to a var in your controller then send it to the view and echo it there just like a part of your site,
but make sure to implement the case if the communication between your site the remote site fails

you can use, php curl func,
http://php.net/manual/en/book.curl.php
or spark :
http://getsparks.org/packages/curl/show
or
file_get_contents()
http://stackoverflow.com/questions/27291...lar-folder
........
good luck




Theme © iAndrew 2016 - Forum software by © MyBB