Hi,
I am trying to make my sites more uniform by using
some code from my central website.
I am trying to use file_get_contents() followed by eval();
working properly so I can have several websites use just one
bunch of pages.
The php file is on the webpage: buymobilewebsite.org
and the website ( or other directory ) which has the
common files is mobi6.net.
Both are on the same drive on the same physical server under
the /home directory.
I have done a simple version for testing:
The php:
http://buymobilewebsite.org/test.php
<?php
/*
* index.php
*
*/
$site = "HELLO - SITE";
echo "Site: $site<br>";
$test1 = file_get_contents("/home/mobi463d/public_html/mobile_sites/test1.txt");
$the_test1 = eval($test1);
echo $the_test1;
$test2 = file_get_contents("/home/mobi463d/public_html/mobile_sites/test2.txt");
$the_test2 = eval($test2);
echo $the_test2;
?>
And the first text file:
test1.txt
<?php
/*
* test1.txt
*
*/
echo "<br>Test1 - Site: $site</b>";
?>
And the first text file:
test2.txt
<?php
/*
* test2.txt
*
*/
echo "<br>This is Test2 - Site : $site</b>";
?>
All I get is the output from my first echo.
The two text files do not seem to get read or echoed ?? 😕😕
See it here:
http://buymobilewebsite.org/test.php
EDIT:
I also tried using the url, but no change 🙁
<?php
/*
* index.php
*
*/
$site = "HELLO - SITE";
echo "Site: $site<br>";
$test1 = file_get_contents("http://mobi6.net/mobile_sites/test1.txt");
$the_test1 = eval($test1);
echo $the_test1;
$test2 = file_get_contents("http://mobi6.net/mobile_sites/test2.txt");
$the_test2 = eval($test2);
echo $the_test2;
?>
http://buymobilewebsite.org/test.php
Any ideas why this isn't working ?
Thanks.
.