You are here: Re: require("common/latest.php") across multiple websites « PHP Programming Language « IT news, forums, messages
Re: require("common/latest.php") across multiple websites

Posted by Jim Carlock on 01/21/06 08:49

Jim Carlock asked:
> Does PHP provide something that maps out to the Apache
> Alias directive?

"Chung Leong" <chernyshevsky@hotmail.com> answered:
> http://fi.php.net/apache-lookup-uri/

Thank you, Chung Leong. Excellent.

The apache_lookup_uri() works quite well. It even works when
a filename is supplied and appends the filename to the mapping.

Alias /news/ "C:/Apache/htdocs/common/news/"
<Directory "C:/Apache/htdocs/common/news">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<?php
// -- START THIS WORKS
// The topic.htm is not part of the Apache Alias above,
// but apache_lookup_uri() works nicely and accepts it
// and returns it as part of the fully qualified pathname to
// the file.
//
$info = apache_lookup_uri('/news/latest.php');
// print_r($info);
$latesttopic = $info->filename;
require($latesttopic);
//
// -- END THIS WORKS
?>

What's it good for? It offers a great way to provide a common
source of news on multiple websites. I like it. Only one place
to change the news and all sites that display the content get the
update. Look out cbsnews and msnbc! <g>

Now... time to figure a way to provide a way for a subdomain
to access the parent domains include files... without using a php
include in httpd.conf... hmmm. I'm going to get back to figuring
out how to do this with Apache.

Thank you very much, Chung Leong.

Thanks to Jerry Stuckle as well for your time and attempt.

Hope this helps.

Jim Carlock
Post replies to the newsgroup.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация