itsjareds Posted October 7, 2008 Share Posted October 7, 2008 I am writing a PHP script to be run through an <img> tag. Don't ask me why, I just do . Right now, what I'm trying to do is get the HTML of the document that the <img> tag is in. The source of the img is my PHP script. Since all of the content that I need will be loaded before the <img> tag is dealt with, how can I use PHP to get the HTML from the page? I don't have direct access to the page, I can only modify the PHP file of the source of the image. Help is appreciated Link to comment https://forums.phpfreaks.com/topic/127466-php-innerhtml/ Share on other sites More sharing options...
trq Posted October 7, 2008 Share Posted October 7, 2008 You could use file_get_contents by passing it the url of the page in question. Link to comment https://forums.phpfreaks.com/topic/127466-php-innerhtml/#findComment-659468 Share on other sites More sharing options...
itsjareds Posted October 8, 2008 Author Share Posted October 8, 2008 I don't own the site. It's through a bug, only for testing purposes, I am seeing what's possible. Basically I am able to post in a thread with an image, and they allow PHP images. It won't let me get the contents of a site outside my domain :-\ Link to comment https://forums.phpfreaks.com/topic/127466-php-innerhtml/#findComment-659543 Share on other sites More sharing options...
trq Posted October 8, 2008 Share Posted October 8, 2008 I don't own the site. It's through a bug, only for testing purposes, I am seeing what's possible. Basically I am able to post in a thread with an image, and they allow PHP images. It won't let me get the contents of a site outside my domain :-\ Yeah, i figured that was what you where up to. Fortunately, its not possible. The image (php script) is executing on your server, so any $_SERVER variables will simply refer to your server. Link to comment https://forums.phpfreaks.com/topic/127466-php-innerhtml/#findComment-659559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.