Jump to content

echo post variable as asteriks (***)


ukweb

Recommended Posts

[!--quoteo(post=380208:date=Jun 5 2006, 10:08 AM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 5 2006, 10:08 AM) [snapback]380208[/snapback][/div][div class=\'quotemain\'][!--quotec--]
If your password is in the array element $_POST['pass'].
[code]
<?php
if (isset($_POST['pass'])) {
  $len = strlen($_POST['pass']);
  echo str_pad('', $len,'*');
}
?>
[/code]
[/quote]

...or...
[code]
<?php
if (isset($_POST['pass'])) echo preg_replace('|.|', '*', $_POST['pass']);
?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.