All:
Issue: urlencodedformat doesn�t want to decrypt certain values.
Below I pasted sample code of my issue. I need to pass and encrypted
value to a link and open a new window using the JAVA script in the
sending cfm page. I�m using a framed page and the JAVA script seems to
be the only way to make it cross browsers for IE and Netscape 4. My
issue is when certain values seem to be passed via the URL they don�t
want to be decrypted. Can anyone please help me out? I�ve looked at the
documentation for this and I cant see what I�m doing wrong.
Regards,
James Blaha
<!--- Begin CFM page 1 enc.cfm --->
<HTML>
<HEAD>
<TITLE>Test</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
// Window Options, top and left (IE) uses screenY and screenX for (NS)
// This allows you to position the window location on the screen in pixels.
function BoogieOn(aURL) {
NextWindow=window.open("", "NextWindow",
'width=700,height=500,left=1,top=200,screenX=1,screenY=200,toolbar=yes,location=yes,menubar=yes,scrollbars=yes,resizable=yes,')
NextWindow.document.location=aURL;
}
</script>
</HEAD>
<BODY topmargin="0" leftmargin="0" bgcolor="yellow">
<cfform action="enc2.cfm" name="test" method="POST">
<!--- Does not work with values like 102, 112, 122, 132 & 142 --->
<cfset ID = 123>
<cfset KEY = "Mik">
<cfset Standard_Encryption = encrypt(ID, KEY)>
<cfoutput>
<h3>Encrypted Value:</h3>
<h2><strong>#ID#</strong></h2>
<h3>Standard Encryption:</h3>
<h2><strong>#Standard_Encryption#</strong></h2>
</cfoutput>
<cfset URL_Encryption = #urlencodedformat(ID)#>
<cfset URL_Encryption_Standard = #urlencodedformat(Standard_Encryption)#>
<cfoutput>
<!---
<h3>URL Encryption:</h3>
<h2><strong>#URL_Encryption#</strong></h2>
--->
<h3>URL & Standard Encryption:</h3>
<h2><strong>#URL_Encryption_Standard#</strong></h2>
</cfoutput>
<br><br>
<cfoutput>
<div align="center"><a href="##"
onclick="javascript:BoogieOn('enc2.cfm?URL_Encryption=#urlencodedformat(Standard_Encryption)#');">
<b><font size="5">Link #ID#-(#URL_Encryption_Standard#)</font></b></a></div>
</cfoutput>
</cfform>
</BODY>
</HTML>
<!--- End CFM page 1 enc.cfm --->
<!--- Begin CFM page 2 enc2.cfm --->
<cfset decrypted = decrypt(URLDecode(URL_Encryption), "Mik")>
<cfoutput>
<h3>URL & Standard Encryption Decypted:
<strong>#decrypted#</strong></h3><br><br>
</cfoutput>
<!--- End CFM page 2 enc2.cfm --->