Load the php file Content with in php -


i'm try access php file, when use

below code

if(is_file('template1.php')){       $return = file_get_contents("template1.php?content=1");  } 

it'showing error : failed open stream: no such file or directory

thank you

i suppose want content generated php, if use:

$yourdata = file_get_contents('http://example.com/template1.php?content=1'); 

otherwise if want source code of php file, it's same .txt file:

$yourdata = file_get_contents('/template1.php?content=1'); 

file_get_contents() not work if server has allow_url_fopen turned off. shared web hosts have turned off default due security risks. also, in php6, allow_url_fopen option no longer exist , functions act if permenantly set off. bad method use.

your best option use if accessing file through http curl


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -