Invalid character

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gowthamkg
    New Member
    • Sep 2008
    • 23

    Invalid character

    Hi,
    In this code i can get proper output only for numbers and for strings it gives error as invalid character.Pleas e help me


    Code:
    <%
    Private Function Decrypt(ByVal encryptedstring)
        Dim x, i, tmp
        encryptedstring = StrReverse( encryptedstring )
        For i = 1 To Len( encryptedstring )
            x = Mid( encryptedstring, i, 1 )
            tmp = tmp & Chr( Asc( x ) - 1 )
        Next
        Decrypt = tmp
    	strMessage=Decrypt
    	Response.write(Decrypt)
    End Function
    
    if (Request.Form("btnSubmit")<>"") then
    	 strLname= Request.Form("txtlname")
    	call Decrypt(strLname)
    End If
    
    %>
    <script language="javascript"  type="text/javascript">
    	alert(<%=strMessage%>);
    </script>
    Last edited by DrBunchman; Nov 21 '08, 08:00 AM. Reason: Added [Code] Tags - Please use the '#' button
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    This doesn't look like it could cause the problem. Try writing it over from scratch.

    Jared

    Comment

    Working...