EditThisPagePHP
This awesome little script puts a button on your web page that allows you to edit the page's html code right in the browser (as long as you have the logon password). It's not wysiwyg, and you can only edit the whole page (not sections, as in a wiki), but it's mighty tiny and it installs like a beauty, so much so that you can install it in numerous folders without much of an afterthought.
Installation
To install EditThisPagePHP, you upload a single php script called install-etp.php (mirrored here), point your browser there and follow the instructions.Troubleshooting Installation
The install for EditTHisPagePHP is dead simple, yet you can run into several problems.Error Message 1
On my first installs, I got these kinds of messages when I first opened the browser and tried to load the page.
Warning: in_array() [function.in-array]: Wrong datatype
Warning: array_push() [function.array-push]: First argument should be an array
This was because I had declined to create a guest account during the install (I wanted to be the only one to access that page). So I simply set up folder protection at the htaccess level to make sure no one would see my page, then reinstalled the script with the default options (creating a guest account—and making sure to create a superusor account). The script worked perfectly.
Error Message 2
// // // // // __META_RSS_AUTODISCOVERY__ // __TRACKBACK_RDF__ // // /* PAGE_HEADER */ /* PAGE_MAIN_CONTENT */ //
// __RSS_FEED__ //
// __RSS_DIFF_FEED__ //
/* PAGE_MAIN_CONTENT */ /* PAGE_FOOTER */ // __HIDDEN_AREA_BUTTON__ // __HIDDEN_AREA_START__ // __COMMENTS__ // __COMMENT_FORM__ // __TRACKBACKS__ // __HIDDEN_AREA_END__ // __EDIT_BUTTON__ //
// // /* PAGE_FOOTER */ /* META_EDITOR */ // /* META_EDITOR */ /* META_EDITOR_EMAIL */ // /* META_EDITOR_EMAIL */ /* META_EDIT_COMMENT */ // /* META_EDIT_COMMENT */ /* META_PAGE_TITLE */ // ETP /* META_PAGE_TITLE */ /* MSG_AUTH_FAILED */ // You are not logged in, or not authorized for this action. /* MSG_AUTH_FAILED */ /* EXT_TRACKBACK */ // /* EXT_TRACKBACK */ /* EXT_TRACKBACK_SENT */ // /* EXT_TRACKBACK_SENT */ /* EXT_COMMENTS */ // /* EXT_COMMENTS */ /* DATA */ ?>
If you get these weird messages when you try to load the page, chances are that you've asked the script to create your page with an "htm" or "html" extension rather than "php". This forces the html file to make an "inline call" to the php script, and this php script is probably not allowed to run because you have not set up server permissions to call PHP from inside HTML files. Two solutions:
1. Either, in the setup, allow the script create a page with PHP extension (rather than html);
2. Or add the proper permission for inline PHP calls to your .htaccess file. For Hostgator, the line is this:
AddHandler application/x-httpd-php5 .php .htm .html
Other awesome PHP scripts
I document all the scripts I use. Go to the top of the page and have a look at my other PHP articles in the right column!Smiles,
Andy
ps: If you have enjoyed this page, I would be immensely grateful if you would link to it, bookmark it or share it. You can also comment using the form below.
