Jump to content

How to display other php file?


rain13
 Share

Recommended Posts

HelloHow I can display other php file in my file?I tried: echo FileRead("./chat/index.php");And that's FileRead()

function FileRead($sFile){$fd = fopen ($sFile , "r");if ($fd) {$fstring = fread ($fd , filesize ($sFile));fclose($fd);return $fstring;}else{echo '<font color="#FF0000">ERROR:</font> Can not read file '.$sFile;return false;}}

This code displays php part as plain text, and executes only html code. But how I can also execute php code? I wan't it look like iframe html. Reason why I read php file instead of using iframe is iframe doesn't look nice and it don't have dynamich height. So don't suggest me using iframe!If there's no way to do it with php, is there something nicer that iframe?

Link to comment
Share on other sites

ah right. I am wondering how does phpbb forum display that nice page? it has lots of html and php files but i dont see echo,iframe or include that much in it's source.
You wont see any PHP in its source code (what the browser shows as source code).PHP is parsed by the server and then its output is displayed by the browser.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...