Home      Products & Services      Contact Us      Links

WebHatchers will design & develop your site for you.

Website Menu Heaven: menus, buttons, etc.

Send us your questions.

site search by freefind

SEO, Google, Privacy
   and Anonymity
Browser Insanity
Popups and Tooltips
Free Website Search
HTML Form Creator
Buttons and Menus
Image Uploading
Website Poll
IM and Texting
   or Not MySQL
Personal Status Boards
Content Management
Article Content
   Management Systems
Website Directory
   CMS Systems
Photo Gallery CMS
Forum CMS
Blog CMS
Customer Records
   Management CMS
Address Book CMS
Private Messaging CMS
Chat Room CMS
JavaScript Charts
   and Graphs

Free Personal Status Boards (PSB™)

Free Standard Free PSB

Free PSB Pro Version

Free Social PSB

Free Social PSB Plus (with Email)

Free Business PSB

Free Business PSB Plus (with Email)

PSB demo

Social PSB demo

Business PSB demo

So what's all this PSB stuff about?

Chart comparing business status boards

PSB hosting diagram

PSB Licence Agreement

Copyright © 2002 -
MCS Investments, Inc. sitemap

PSBs, social networking, social evolution, microcommunities, personal status boards
PSBs, social networking, business personal status boards
website design, ecommerce solutions
website menus, buttons, image rotators
Ez-Architect, home design software
the magic carpet and the cement wall, children's adventure book
the squirrel valley railroad, model railroad videos, model train dvds
the deep rock railroad, model railroad videos, model train dvds

Ajax and PHP Based Insult Auto-Completer

This is kind of a novelty web page. It gives you lots of cool TV-14-rated insults in case you're having trouble thinking of them. But it also uses Ajax and PHP to prompt you once you start typing. You type "a" and the script gives you a nice set of insults, such as "ass clown."

The reason we created this is to show the code involved. When you type, the onKeyUp() event runs the Ajax prompt() script which takes the input box's current value and uses xmlhtml to send it as a query string from your browser to the prompt.php script on the server where it gets compared to hundreds of other insults in a PHP array. The code for the comparing is at the bottom of this page. The PHP function count() counts the number of elements in the array for the FOR loop. For comparing, input and array are both converted to lower case with strtolower(). The number of characters typed so far is the number of characters in each array elements that get compared to the input string. If the input matches part or all of an array element, that element if put into the $prompt string and the script keeps looping until all relevant elements have been added to the $prompt string. If no match is made, then the prompt "no prompt" is stuck in the respose string to send back to the browser. If there are matches, all of these are stuck in the respose string to send back to the browser.

Type an insult:



The relevant code on this page:

<script type="text/javascript">
function prompt(str){
if (str.length==0){document.getElementById("prompt").innerHTML="";return;}
if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}else{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
if (xmlhttp.readyState==4 && xmlhttp.status==200){

<div class='k'><p><b>Type an insult:</b></p>
Insult: <input type="text" onkeyup="prompt(this.value)" size="20" />
<p>Prompt: <span id="prompt"></span></p></div>

<p>The prompt.php file:</p>

$i[]="ass wipe";
$i[]="ass clown";
$i[]="ass face";
$i[]="ass monkey";
$i[]="ass muncher";
$i[]="ass kisser";
$i[]="ass licker";
$i[]="ass bandit";
$i[]="ass breath";
$i[]="arse hole";
$i[]="air head";
$i[]="bubble head";
$i[]="brown nose";
$i[]="brown noser";
$i[]="butt wipe";
$i[]="butt hole";
$i[]="butt muncher";
$i[]="butt kisser";
$i[]="butt licker";
$i[]="butt bandit";
$i[]="butt breath";
$i[]="butt pirate";
$i[]="butt head";
$i[]="bung hole";
$i[]="bung wad";
$i[]="bung breath";
$i[]="butt nugget";
$i[]="butt monkey";
$i[]="crap for brains";
$i[]="crack whore";
$i[]="coke whore";
$i[]="crack ho";
$i[]="cow pie";
$i[]="cry baby";
$i[]="crap face";
$i[]="crap breath";
$i[]="corn ball";
$i[]="dick head";
$i[]="dog breath";
$i[]="dog face";
$i[]="dick lick";
$i[]="dick licker";
$i[]="douche bag";
$i[]="dumb ass";
$i[]="dumb head";
$i[]="damn fool";
$i[]="dick wad";
$i[]="dill weed";
$i[]="dill hole";
$i[]="dirt bag";
$i[]="dim wad";
$i[]="dim bulb";
$i[]="dork face";
$i[]="donkey dick";
$i[]="fart knocker";
$i[]="fart licker";
$i[]="fart sniffer";
$i[]="fat head";
$i[]="fart head";
$i[]="fart bag";
$i[]="fart face";
$i[]="fart breath";
$i[]="fart nugget";
$i[]="fat ass";
$i[]="half ass";
$i[]="half wit";
$i[]="hair bag";
$i[]="ho bag";
$i[]="jerk off";
$i[]="jerk ass";
$i[]="jerk face";
$i[]="knob head";
$i[]="knot head";
$i[]="kiss ass";
$i[]="knuckle nuts";
$i[]="knuckle head";
$i[]="lame brain";
$i[]="lame ass";
$i[]="limp dick";
$i[]="low brow";
$i[]="lard butt";
$i[]="lard ass";
$i[]="lunk head";
$i[]="lunk head";
$i[]="meat head";
$i[]="mo fo";
$i[]="mouth breather";
$i[]="numb nuts";
$i[]="numb skull";
$i[]="old bag";
$i[]="old fart";
$i[]="parrot breath";
$i[]="pecker head";
$i[]="poop head";
$i[]="poop breath";
$i[]="pecker breath";
$i[]="penis breath";
$i[]="penis face";
$i[]="pecker head";
$i[]="piss head";
$i[]="piss ant";
$i[]="rectum breath";
$i[]="scrotum breath";
$i[]="scrotum licker";
$i[]="simple tool";
$i[]="terd breath";
$i[]="whine baby";


if (strlen($z) > 0){
for($n=0; $n<count($i); $n++){
if (strtolower($z)==strtolower(substr($i[$n],0,strlen($z)))){
if ($prompt==""){$prompt=$i[$n];}
else{$prompt=$prompt." , ".$i[$n];}}}}
if ($prompt == ""){$r="no prompt";}else{$r=$prompt;}
echo $r;