fread or whatever php code from php page
Posted: Sun Nov 26, 2006 2:35 pm
feyd | Please use
Well, my server was hacked and attached and all pages that were created by my system had coded added to the pages ... noW the pages are:
I have been trying file_get_contents and fread ... but it seems to return the outputed HTML, not the PHP code.
IS there a way to read just the PHP code and I can str_replace and the write it back?
Thanks -Tim
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am trying to write a script to open php files on my website, read the code, remove code that a f*****g hacker put on there and then save it.
example, I have a page (well, a LOT of pages) that was created from my content management system, say "page.html".
In that page.html, I have something like :Code: Select all
<? page_id=1;
include "/path/to/main.php"';
?>Code: Select all
<? page_id=1;
include "/path/to/main.php"';
ALL KINDS OF CODE TO SOME RUSSIAN WEBSITE HAD BEEN ADDED HERE
?>IS there a way to read just the PHP code and I can str_replace and the write it back?
Thanks -Tim
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]