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
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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.