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. Quote 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. Quote 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) ); Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.