capitalize first letter and strip html code
<p>I have the following html page:
What I am looking to do is capitalize the first letter (which is working without any issue) and strip the textbox of any html code or any code that has a combincation of "&lt;" "/>" ">" so user cannot insert malicious code to execute at server end.</p>

<p>I found a code which strips:</p>

<pre><code>var StrippedString = OriginalString.replace(/(&lt;([^&gt;]+)&gt;)/ig,"");
</code></pre>

<p>How do I add the above code to the below page so it takes care of both?</p>

<pre><code>&lt;?php
/**
 * ****************************************************************************
 * Micro Protector
 * 
 * Version: 1.0
 * Release date: 2007-09-10
 * 
 * USAGE:
 *   Define your requested password below and inset the following code
 *   at the beginning of your page:
 *   &lt;?php require_once("microProtector.php"); ?&gt;
 * 
 *  
 * 
 ******************************************************************************/


$Password = 'TESTPASS'; // Set your password here



/******************************************************************************/
   if (isset($_POST['submit_pwd'])){
      $pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';

      if ($pass != $Password) {
         showForm("Wrong password");
         exit();     
      }
   } else {
      showForm();
      exit();
   }

function showForm($error="LOGIN"){
?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"&gt;
&lt;META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"&gt;
   &lt;title&gt;IMC - Authentication&lt;/title&gt;
   &lt;link href="style/style.css" rel="stylesheet" type="text/css" /&gt;
&lt;Script&gt;
&lt;!--
function capitalize(form) {
    value = form.value;
    newValue = '';
    value = value.split(' ');
    for(var i = 0; i &lt; value.length; i++) {
        newValue += value[i].substring(0,1).toUpperCase() +
        value[i].substring(1,value[i].length) + '';
    }
form.value = newValue;
}
--&gt;
&lt;/Script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;&lt;a href="http://www.test.com"&gt;&lt;img src="test.png" border=0 /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
    &lt;div id="main"&gt;
      &lt;div class="caption"&gt;&lt;?php echo $error; ?&gt;&lt;/div&gt;
      &lt;div id="icon"&gt;&amp;nbsp;&lt;/div&gt;
      &lt;form action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post" name="pwd"&gt;
    Your Name:
        &lt;table&gt;
          &lt;tr&gt;&lt;td&gt;&lt;input class="text" name="name" onBlur="capitalize(this);" maxlength=12 type="text" /&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;/table&gt; 
        Password:
        &lt;table&gt;
          &lt;tr&gt;&lt;td&gt;&lt;input class="text" name="passwd" maxlength=8 type="password" /&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td align="center"&gt;&lt;br/&gt;
             &lt;input class="text" type="submit" name="submit_pwd" value="Login" /&gt;
          &lt;/td&gt;&lt;/tr&gt;
        &lt;/table&gt;  
      &lt;/form&gt;
   &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

&lt;?php   
}
?&gt;
</code></pre>
