Using .htaccess 












Using .htaccess/.htpasswd Password Protection 





Coding Tips 








Uploads and Downloads 



Mail 
see it on this page





Working with Images 


Frequently Requested Website Functionality 
see it on this page
see it on this page
see it on this page
see it on this page











Using PHP 




Website Managment 








Other Tips 









Replace banned words
This script will replace banned words in the string $message with an * for each letter. You can use this when receiving POST data with text input. In this example the banned words are in a text file called words.dat (in the same directory as the script) with one banned word per line.
<?php
$words_array = preg_replace("#\r\n?|\n#","",file('words.dat')); // read the file into an array and remove new line breaks (should cover all OS)
$word_stars = preg_replace( '/./','*',$words_array ); // replace every letter with a *
$words_array = preg_replace( '/(.+)/','#\1#i',$words_array ); // put # delim around each word
$message = preg_replace($words_array,$word_stars,$message);
?>
