« Previous Next »

Thread: how to make unreadable by hiding certain letters....getting error..

Last post 01-07-2009 8:15 AM by tomkmvp. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 01-07-2009, 1:02 AM

    • mathews7
    • Not Ranked
    • Joined on 01-03-2009, 11:18 AM
    • Posts 4

    how to make unreadable by hiding certain letters....getting error..

     Page opens like this....
    phone:123243453
    email:henria@real.com

    but aftr clicking that button

    I need to display like this..
    phone:12324****
    email:hen***@******
    Error on this line:::

    dim textsize=Len(text)
    Expected end of statement
    Can any1 suggest how to proceed..??

    <%
    Function getPhone(text)
    dim textsize=Len(text)
    text = Left(text,5)
    For index = 0 to textsize
    text &= "*"
    Next
    return text
    End Function

    Function getEmail(text)
    dim textsize=Len(text)
    dim atpos = text.IndexOf("@") - 5
    text = Left(text,5)
    For index = 0 to textsize
    if atpos = index+1 then
    text &= "@"
    else
    text &= "*"
    endif
    Next
    return text
    End Function

    id = 1
     sSql =  "SELECT  phone,email   FROM nametable WHERE userID = " & id
      oRs.Open sSql, oConn
         While not oRs.EOF
           Response.write("<table><tr><form method='post'><td >phone : </td><td>"&getPhone(ors(0))&"</td><td width='10%'align='right'mail :</td><td>"&getEmail(ors(1))&"</td><inputname='submit' type='submit' value='check'></form></tr></table>")

              oRs.MoveNext()
          Wend     
    %>

  • 01-07-2009, 8:15 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 6,235
    • IIS MVPs

    Re: how to make unreadable by hiding certain letters....getting error..

    Check your data - is any null or bad data being passed to the function?

Page 1 of 1 (2 items)
Microsoft Communities