Another PHP little question

Status
Not open for further replies.

Divvy

Active Member
806
2009
18
0
Hello guys,

Maybe someone can help me again with a PHP question.

I have WEBSITE A and WEBSITE B

In WEBSITE A I created a php file and I display the content on my index.php using this code:
PHP:
<?php include 'block/content.php'; ?>

Now I want to display the exactly same file/content in WEBSITE B, for that I'm using this code:
PHP:
<?php include '/home/username_website_a/public_html/block/content.php'; ?>

But I got the error:
Code:
Warning: include(/home/username_website_a/public_html/block/content.php) [function.include]: failed to open stream: Permission denied in /home/username_website_b/public_html/index.php on line 45

Warning: include() [function.include]: Failed opening '/home/username_website_a/public_html/block/content.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/username_website_b/public_html/index.php on line 45

The idea is to edit just one file and display changes in both websites.
But Im a newbie and I dont know If this is possible.

Can someone help me please? :-)
Thanks!!
 
5 comments
Why not do something like:

Code:
[COLOR=#000000][COLOR=#0000BB]<?php [/COLOR][COLOR=#007700]include [/COLOR][COLOR=#DD0000]'http://websitea.com/block/content.php'[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000BB]?>
[/COLOR] [/COLOR]
 
Status
Not open for further replies.
Back
Top