'; echo 'window.location.href="'.$url.'";'; echo ''; echo ''; } } // Filters unwanted characters out of an input string. Useful for tidying up FORM field inputs function cleanInput($strRawText,$strType) { if ($strType=="Number") { $strClean="0123456789."; $bolHighOrder=false; } else if ($strType=="VendorTxCode") { $strClean="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_."; $bolHighOrder=false; } else { $strClean=" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,'/{}@():?-_&�$=%~<>*+\""; $bolHighOrder=true; } $strCleanedText=""; $iCharPos = 0; do { // Only include valid characters $chrThisChar=substr($strRawText,$iCharPos,1); if (strspn($chrThisChar,$strClean,0,strlen($strClean))>0) { $strCleanedText=$strCleanedText . $chrThisChar; } else if ($bolHighOrder==true) { // Fix to allow accented characters and most high order bit chars which are harmless if (bin2hex($chrThisChar)>=191) { $strCleanedText=$strCleanedText . $chrThisChar; } } $iCharPos=$iCharPos+1; } while ($iCharPos