Dump file contents
Moderator: General Moderators
-
HiddenS3crets
- Forum Contributor
- Posts: 119
- Joined: Fri Apr 22, 2005 12:23 pm
- Location: USA
Dump file contents
What is the easiest way to display the code inside a file located on a server, such as accessing the file contents of /var/www/html/page.php?
-
HiddenS3crets
- Forum Contributor
- Posts: 119
- Joined: Fri Apr 22, 2005 12:23 pm
- Location: USA
ahh....then use file_get_contents()
-
HiddenS3crets
- Forum Contributor
- Posts: 119
- Joined: Fri Apr 22, 2005 12:23 pm
- Location: USA
I've tried that one too, but I cannot access server files directly using that function. Instead I would need to access a file like this: http://www.domain.com/page.php
This code is all processed by the time file_get_contents() is called so I just have access to the HTML output. I need to access server files directly so I can view the PHP code as well.
Side note regarding highlight_file(): I cannot use it due to safe mode being on. To get around this I tried putting this at the beginning of my script:
I still get the warning that safe mode restrictions are in effect though. Why doesn't ini_set() just turn it off? 
This code is all processed by the time file_get_contents() is called so I just have access to the HTML output. I need to access server files directly so I can view the PHP code as well.
Side note regarding highlight_file(): I cannot use it due to safe mode being on. To get around this I tried putting this at the beginning of my script:
Code: Select all
ini_set('safe_mode', 'Off');
Last edited by HiddenS3crets on Sun Jul 16, 2006 6:52 pm, edited 1 time in total.