Jump to content

Execute the php file and get the content


jeeva

Recommended Posts

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

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.