PHP fopen from another .php file -


i'm trying print out content of php file.

here how trying print it.

$filename = "read.php"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); print $contents; 

the method above found didn't work. didn't print on screen.

can tell me how fix this.

also want know how write .php , and save it.

note: i'm not trying print output of php file. example: if read.php <?php echo "hello world"; ?> want print out <?php echo "hello world"; ?> not "hello world"

why not ?

<?php echo htmlspecialchars(file_get_contents('read.php')); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -