Reputation: 441
I have two files reader.php and somesource.php. Both in the same folder.
somesource.php content inside the php tag.
echo "hello World";
reader.php contents
$fp = fopen('somesource.php','r') or die($php_errormsg);
$string = fread($fp,filesize('somesource.php'));
echo $string."<br>";
I am expecting to output
echo "hello World";
But I am seeing a blank page. I even tried. curl and file_get_contents. Both with the same output. If I write anything outside the php tag wil be echoed as normal. anything inside the php tag is skipped.
Please Help
Upvotes: 1
Views: 90
Reputation: 346
Depending on your server setup it may not read it without <?php echo $stuff; ?>
in there. <?
aka short tags can break a lot of stuff in my experience.
Upvotes: 0