detect and block uppercase (up letters) in a string (form text input) php script

  • HOME  • tutorials  • photos   • free grafics design    • questions and answers  • distance calculator  • maps
   



CATEGORIES
EXCEL TUTORIAL
SQL TUTORIAL
WEB INFORMATION
WINDOWS
JAVASCRIPT SCRIPTS
COMPUTER SECURITY
GRAFIC DESIGN
HTML
PHP
CSS STYLE
ATLAS OF THE WORLD
DEVELOPER
PHOTOSHOP
MAGAZINE
TOP LISTS
LATEST ARTICLES
md5 hash generator online tools windows linux c php
remove duplicates in html lines online javascript
documentgetelementbyid()innerhtml javascript set example
how to block processes from starting and running in windows xp
list of us american presidents with pictures
ucwords javascript convert online tool
hex to rgb converter javascript for colors online
letter-spacing css property for html pages
sql inject protection without complicated class php script and tutorial
how to insert decimal values into a sql table row
  home   PHP » DETECT AND BLOCK UPPERCASE UP LETTERS IN A STRING TEXT FORM INPUT PHP SCRIPT
google ads
 
 
 

DETECT AND BLOCK UPPERCASE (UP LETTERS) IN A STRING (FORM TEXT INPUT) PHP SCRIPT


Views: 114
PHP UPPERCASE DETECT AND BLOCK, SCRIPT TO DETECT UP LETTERS IN TEXT FORMS AND CALCULATE THE PERCENT


       Sometimes users tend to use capital ( UP) letters in interactive forms. This may be due to the fact that they want to make himself comments or activity more visible or due to a  lack of experience online. To prevent such things will present a nice little php script that can detect and block using exces of uppercase (up letter ) in a text input ( eg. form html )

 


The php script

=========

<?php

$analized_string = "How many UPPER Letters are IN ThIS String";
$maximum_percent_allowed='34';//you can cange this percent with your own
preg_match_all('/[A-Z]/', $analized_string, $match) ;
$total_upper_case_count = count($match [0]);
echo "Total Upper Case Count = " . $total_upper_case_count."<br>";
$total_characters= strlen($analized_string);
$up_leters_percent=ceil(($total_upper_case_count*100)/$total_characters);
echo "Percent of Upper Case = " . $up_leters_percent. "%";

if ($up_leters_percent>$maximum_percent_allowed)
{
echo'<br>You used too many up letters';exit;
}
?>

==============

Output (in this case ):

Total Upper Case Count = 13
Percent of Upper Case = 32%


Articles related to DETECT AND BLOCK UPPERCASE (UP LETTERS) IN A STRING (FORM TEXT INPUT) PHP SCRIPT
Zero result!

Tags:capitalize letters in text form php,php letters capitalize,block uppercase letters php,detect percent php up letters uppercase,




Leave a comment

Your name *
Your comment *
   Anti Spam code *

There are no comments on this article...



the latest articles:
• MD5 hash generator Online tools Windows Linux C Php
• Remove duplicates in html lines online javascript
• documentgetElementById()innerHTML javascript set Example
• How to block processes from starting and running in Windows XP
• List of us american presidents with pictures
• Ucwords javascript convert online tool
• Hex to rgb converter javascript for colors online
• Letter-spacing CSS property for html pages
• SQL Inject protection without complicated class php script and tutorial
• How to insert decimal values into a SQL table row
what is the height of statue of liberty
hollywood movies
map from faisalabad to hasilpur pakistan
driving distance between tanga and bagamoyo
how to abbreviate million dollars
how long do butterflies live in captivity

 

eXTReMe Tracker