PHP Scripts
Here you can find some PHP scripts written by myself.
General note
I found out that some few people use my scripts without including the GPL header. This is illegal! Please – in the name of all open source supporters – stick to the license. Thank you!
For further information please read the GPL FAQ.
robots.txt generator
(Updated version for Apache 2.0.40+ and PHP 4.2.3+. Thanks to Thomas Keitel!)
This script lets you browse through your server’s directory structure. If a robots.txt is found, it is read and the appropriate allowed/disallowed folders are checked/unchecked. Just change the checkers and hit the “update” button to update the robots.txt. You may also delete the file or edit the comment. Changes are always made to “User-agent: *”. Additionally the script warns, if no index-files or htaccess files were found.
Download the PHP script (GPL licensed, PHP 4.2 security conform).
This script is listed at HotScripts.com and Jan’s Script Portal.
PHP highlighter
This PHP function lets you easily highlight e.g. search results on a specific website. Just pass the words to highlight, the path of the page (server path) and the color to highlight with. The extraordinary property about this function is that it manages not to perform replacements inside HTML tags (which could also include the word to highlight.
Download the PHP script (GPL licensed, PHP 4.2 security conform).
New: Version 1.1 also support highlighting in multiple colors for different search terms. Thanks to Richard Danby.
This script is also listed at HotScripts.com and Jan’s Script Portal.






Sorry, no file in php_highlighter.zip!!!!
Peter
Hmm, this is odd. Seems like the archives got broken somehow. I will see if I can find a backup somewhere…
Should be solved.
Hey
Still invalid zip file
Cheers
R
This should definitely work now. I “recovered” the original zip files.
It’s a bad to release your scripts with the <? tag. Not all host have PHP short tags enabled.
Hey Dude, your script for the highlight seems to fail, quite badly.
For example, I;ve used your example:
$keywords = explode(” “,”a l”);
$html_text=’Lets see if this little test does what I expect this to do.’;
Firstly it doesnt highlight al the “l”‘s
What happens is that the script finds the first letter, which is uppercase and then wont find any lowercase ones…
Hi. Thanks for your feedback. I have not looked at the script for year but I never had any complains. If you know how to fix the problem then I would appreciate if you could send me an updated version. Cheers
Hi Eric
I have used your script in my search results page, I made some modifications in order to accommodate three different query strings and it is working fine. The only problem I encountered is that for example, I search for the word (last name) “perez” it will highlight “perez” correctly but not “pérez”
Is there a way I can highlight both instances?
Thanks
Cecilia M
Hi Cecilia. Good question. Right now the script compares based on string equality. Since both strings are similar but not equal, “pérez” will not be highlighted. I am not sure how to support such synonyms. But anyway, currently the script does not support these, to answer your question.