Forum Moderators: coopster

Message Too Old, No Replies

php includes across websites / servers?

         

trout

11:09 pm on Jan 28, 2005 (gmt 0)

10+ Year Member



Hello,

Is it possible to make an includes across websites?

Almost like what you would do with an iframe but instead with an includes.

I ask since I am not near a development server to test my theory! I would like to include the output of a search on one of my sites on another - seperate domains but on the same server.

i.e. include search output from site a on site b

thanks for any reply.

trout

mincklerstraat

12:14 pm on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey trout,
Yeah, you can include a file server-wide by using the auto_prepend configuration directive in your server's php.ini file. Otherwise, if it's possible to slip an .htaccess file in a directory that Apache reads that's at a level below each of your sites, you could put this in an .htaccess file.

If you look at the php manual page on ini_get and ini_set you'll find a lot of information about setting configuration directives, with other useful links to places in the manual.

When it comes to search output for site B on site A, this is possible, of course - how you'd want to do it depends a little on how this search feature is set up. If your included file has everything necessary for the search feature on site A, this stuff should work for B to (needs *everything*, including db connect if it's a different db).