Encrypt() is messing up my anchor

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Encrypt() is messing up my anchor

    I am trying to use encrypt() to obscure data being passed over the URL scope.
    The encryption is working but when I place the encrypted variable in an anchor
    tag, CF gets confused as to what should be shown.

    Example:

    <cfset encInfo = #encrypt(query.value)#>
    <a href="someWebPage.htm?var=#variables.encInfo#">Tex t to be seen</a>

    Instead of having a link that says, "Text to be seen", I get "@53! > Text to
    be seen"

    The anchor tag seems to be seeing some of the encrypted data and using it in
    the tag. Does anybody know why this is happening?


    spacehog Guest

  2. Similar Questions and Discussions

    1. CF 7 didn't do this CF 8 and its messing me up!
      When I do a simple testConnection function that calls a coldfusion function in CF 7 it worked everytime. In CF 8 it doesn't it only works some of...
    2. Tables Messing Up
      Hey guys, I have been working on a blog type page for the last few weeks, everything works perfectly apart from in the windows version of internet...
    3. Characters messing up - what to do with &
      I am trying to read from a text file into a TextField componet in my flash movie. The text file is in html format. If the text contains the "&"...
    4. Encrypt in Perl, De-encrypt in Javascript
      I got a javascript off the net which encrypt and de-encrypt HTML code so that nobody can read the public html file. here is the code of...
    5. Button messing up!!!
      I keep trying to make a simple button that is see through when is viewed on a page, then solid when selected. I have gotten that far, and set a drop...
  3. #2

    Default Re: Encrypt() is messing up my anchor

    Are you decrypting it somewhere? If you encrypt() anything, a variable, a
    string - whatever, and you place that value into the "a href" you're going to
    get the encrypted value. So using your example:

    <cfset encInfo = #encrypt(query.value)#>
    <a href="someWebPage.htm?var=#variables.encInfo#">Tex t to be seen</a>

    Let's say that query.value is "bob" and now that it's encrypted, it would be
    %$Rfsx or something. If you don't decrypt it and you put into your tag like you
    have it, then it's going to show the encrypted value and not "bob". Unless I'm
    missing something here, you'll have to decrypt it at some point so that the "a
    href" can see the actual value.

    Defuse Guest

  4. #3

    Default Re: Encrypt() is messing up my anchor

    I am trying to place the encrypted value into the anchor (I will decrypt it on
    the other side), but the encrypt function can contain quotations. So when you
    put encrypted data into an anchor <a href=""></a> the quotes in the encrypted
    value interfere with the tag.

    Is there a way to prevent quotes from being used?



    spacehog Guest

  5. #4

    Default Re: Encrypt() is messing up my anchor

    > I am trying to use encrypt() to obscure data being passed over the URL scope.
    > The encryption is working but when I place the encrypted variable in an anchor
    > tag, CF gets confused as to what should be shown.
    You'll need to URL encode the string before passing it on the URL. As
    you've discovered, not all characters are legal in a URL (or only allowed
    once, or in a certain position, etc).
    --

    Adam
    Adam Cameron Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139