get_file_contents - Relative to absolute, and .htaccess
Posted: Thu Feb 05, 2009 10:15 am
I want a whole bunch of things done and I have an idea, but done know how to implement it:
1) Fetch the contents of a website - you can use get_file_contents or cURL, but get_file_contents seem easier.
2) I'm going to be fetching a website that has html, php, jpeg, png, swf, and a whole bunch of other files. An example of websites I'm going to be fetching http://www.addictinggames.com and http://www.armorgames.com . When I just fetch them normally, there are no images or anything because all of the urls are relative, so I need to either cache the files or hotlink them. But when they click on a link to another html/php page I want it to be relative and when it goes I want it to be forwarded via htacess to index.php
?page=*the relative url here* and on the php page index.php, when it takes the $_GET['page'] information and it uses get_file_contents of the url+the information passed in 'page' and parses the information, with the same relative to absolute hotlinking of images and swfs.
Please please please help me out!
I will give credit where its do on the websites were I use this!
1) Fetch the contents of a website - you can use get_file_contents or cURL, but get_file_contents seem easier.
2) I'm going to be fetching a website that has html, php, jpeg, png, swf, and a whole bunch of other files. An example of websites I'm going to be fetching http://www.addictinggames.com and http://www.armorgames.com . When I just fetch them normally, there are no images or anything because all of the urls are relative, so I need to either cache the files or hotlink them. But when they click on a link to another html/php page I want it to be relative and when it goes I want it to be forwarded via htacess to index.php
?page=*the relative url here* and on the php page index.php, when it takes the $_GET['page'] information and it uses get_file_contents of the url+the information passed in 'page' and parses the information, with the same relative to absolute hotlinking of images and swfs.
Please please please help me out!
I will give credit where its do on the websites were I use this!