jeeva Posted August 31, 2007 Share Posted August 31, 2007 hi frnds how to get the content after Executing the php file? i have used 'fread' to get the content but its returns that content with Php code.. here my code <?php $phpfile="test.php"; $handle = fopen($phpfile, "r"); echo $contents = fread($handle, filesize($phpfile)); fclose($handle); ?> test.php <table width="600" border="0"> <tr> <td><?php echo "Test1";?></td> </tr> <tr> <td<?php echo "Test2";?></td> </tr> </table> wt shud i do to get this? Link to comment https://forums.phpfreaks.com/topic/67404-execute-the-php-file-and-get-the-content/ Share on other sites More sharing options...
btherl Posted August 31, 2007 Share Posted August 31, 2007 You can try fopen("http://www.host.com/script.php", 'r'); Or, it's more efficient if you can use include('test.php') to run the script. Try it both ways. Link to comment https://forums.phpfreaks.com/topic/67404-execute-the-php-file-and-get-the-content/#findComment-338392 Share on other sites More sharing options...
jeeva Posted August 31, 2007 Author Share Posted August 31, 2007 Thanks btherl... When i am using fopen("http://www.host.com/script.php", 'r'); i am getting the following error Warning: fopen(http://localhost/xl/1/test.php) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Access Denied in c:\inetpub\wwwroot\xl\1\tbs_class.php on line 532. if i use include then how can i get the content? Link to comment https://forums.phpfreaks.com/topic/67404-execute-the-php-file-and-get-the-content/#findComment-338395 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.