Michdd Posted October 27, 2008 Share Posted October 27, 2008 How do I get a file's contents if it's on my local server, I tried fread, but it only returns the html, and no php. Link to comment https://forums.phpfreaks.com/topic/130338-reading-a-phps-files-contents/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 27, 2008 Share Posted October 27, 2008 Use a file system path, not a URL. Link to comment https://forums.phpfreaks.com/topic/130338-reading-a-phps-files-contents/#findComment-675995 Share on other sites More sharing options...
wildteen88 Posted October 27, 2008 Share Posted October 27, 2008 Use a local file path and not a url eg echo htmlentities(file_get_contents('/file/to/php/script')); or $file = '/file/to/php/script'; $handle = fopen($file, 'r'); echo htmlentities( fread($handle, filesize($file) ); Link to comment https://forums.phpfreaks.com/topic/130338-reading-a-phps-files-contents/#findComment-675997 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.