Jump to content

How to display other php file?


rain13

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

Archived

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

×
×
  • Create New...