<?php //$strVal = getInput("Please input a phone number : "); echo"Please Enter Numbers Between 5-18 digits"; $strVal =$_GET["number"]; if (isset($strVal)) { $l = strlen($strVal); $strPhone = substr($strVal, $l, ($l - 4)) ."****"; $NumberPrefix = substr($strVal, 0, ($l - 4)); echo "<br />\n"; echo "Masked Number is : ". $NumberPrefix.$strPhone; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Simple PHP Form Demo</title> </head> <body> <form id="number" method="get" action=""> <p><label>number: <br /> <input type="text" name="number" class="textfield" value="<?php echo htmlentities($NumberPrefix.$strPhone ); ?>" maxlength="18"/> </label></p> <p><input type="submit" name="submit" class="button" value="Submit" /></p> <script>document.form.reset();</script> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)