cliftonbazaar Posted April 12, 2009 Share Posted April 12, 2009 I run multiple websites and all the privacy policies are the same. When they were running in ASP I knew how to make one text file and display it on each website - but I don't know how to do it in PHP. I have tried google but don't actually know how to ask the question The code I have at the moment is <?PHP INCLUDE ("http://www.cliftonbazaar.com/default/addurl.php"); ?> but it doesn't display anything. The addurl.php page that it is trying to include is full of html code. Link to comment https://forums.phpfreaks.com/topic/153712-solved-pulling-data-from-another-website/ Share on other sites More sharing options...
Axeia Posted April 12, 2009 Share Posted April 12, 2009 try lowercase include, php is nearly always all lowercase with the only exceptions being a couple of global variables I think. Should that still not work please see http://www.w3schools.com/PHP/php_includes.asp Link to comment https://forums.phpfreaks.com/topic/153712-solved-pulling-data-from-another-website/#findComment-807774 Share on other sites More sharing options...
jackpf Posted April 12, 2009 Share Posted April 12, 2009 URL includes is generally turned off in PHP as it poses a considerable security risk. You could try fopen(), file_get_contents(), and if none of them work, cURL. Link to comment https://forums.phpfreaks.com/topic/153712-solved-pulling-data-from-another-website/#findComment-807802 Share on other sites More sharing options...
cliftonbazaar Posted April 12, 2009 Author Share Posted April 12, 2009 Thanks for the replies. I did visit w3schools and decided to go with include C:websites/default/addurl.php which did the trick. Link to comment https://forums.phpfreaks.com/topic/153712-solved-pulling-data-from-another-website/#findComment-807825 Share on other sites More sharing options...
Axeia Posted April 12, 2009 Share Posted April 12, 2009 You might want to use a relative path instead of an absolute path. From the PHP file making the request use '../' to move one folder up and using that way navigate to the file you're trying to include. That way if you move your PHP application to another computer (say linux.. which does not have a C drive) your script will still function. Link to comment https://forums.phpfreaks.com/topic/153712-solved-pulling-data-from-another-website/#findComment-807851 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.