eXZire Posted November 25, 2005 Share Posted November 25, 2005 Hi :)I'm currently making a PHP-script where I need javascript to do the "fetching"-part. With "Fetching", I mean getting an external page's code(HTML) into a Javascript variable, and eventually a file, that vil eventually be read by PHP :)Now, I've already tried some things, but they didn't work. I tried using this code, for instance: (it's only a part of it, but it's the "crucial bits "window.frame['name'].document.documentElement.innerHTMLto fetch the info itself, together with<iframe name="name" src="a webpage"></iframe>However it only worked if the src in the iframe was on the same server as the script. How can I get javascript to fetch a page outside my server?Now, you might ask, why make Javascript do the fetching part? You see, at the page i'm fetching from, i have to be logged in. Javascript, being clientside, can to this, PHP, being server-side, cannot.Any ideas? Link to comment Share on other sites More sharing options...
Jack McKalling Posted December 2, 2005 Share Posted December 2, 2005 Javascript is only allowed to fetch content that is your own, else it thinks your stealing and denies your access Link to comment Share on other sites More sharing options...
eXZire Posted December 6, 2005 Author Share Posted December 6, 2005 Hehe, crap :)Oh well, managed what I wanted through a PHP-module called cURL though, so its working now Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now