SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Showing ******789 ?

    Hey,

    Yep, me again.

    Say a user enters this into my program: 123456789
    I want it to display only the last four digits, e.g.; *****6789
    Does anyone know how to do it?

    Tx!

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2001
    Location
    Toronto, Ontario, Canada, Earth
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello,

    if you want that done in perl, try this:

    Code:
    #!/usr/bin/perl
    print "Content-type:text/html\n\n";
    $string = "123456789";
    $length = length($string);
    $newstring = substr($string,-4);
    for($x=0;$x<($length-4);$x++) {
    print "\*";
    }
    print $newstring;
    hope this helps,

    Jason Weinstein
    http://www.MaximumEdge.com/

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank You Thank You Thank You!

    I'll give this a shot and see how it goes..!

  4. #4
    PHP Developer W1LL's Avatar
    Join Date
    Apr 2001
    Location
    Leicester, UK
    Posts
    459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or in ASP/VBScript:

    Code:
    <script language="JavaScript">
    form.request("number")
    
    response.write("*****" & Right(number, 4))
    </script>
    - Will


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •