Re: mcrypt
| From: | Gabor Hojtsy | Date: | Sat, 04 Feb 2006 10:43:52 +0000 |
| Subject: | Re: mcrypt | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-30557@lists.php.net to get a copy of this message | ||
Since your problem has nothing to do with webmastering of the php.net
website, it does not belong in here.... Please contact
php-general@lists.php.net (a mailing list) with support questions or see
http://php.net/support for more support options.
Regards,
Gabor Hojtsy
Moises Zaragoza wrote:
> I'm using the snippet I wrote below to send some data from a child window to it's
> parent.
> It all works fine except the data I'm sending back is encrypted using mcrypt, and so
> contains some odd characters.
> One or two of these characters are forcing line breaks, and so I am getting a javascript error
> of unterminated string constant.
> I thought add slashes would fix this but it doesn't, so I end up with odd characters on a
> line of their own.
>
> echo '<script language="javascript">' . "\r\n";
> echo ' window.opener.document.getElementById("txtSSN").value =
> "' . addslashes($encrypted_1) .'";' . "\r\n";
> echo ' window.opener.document.getElementById("question").value =
> "' . addslashes($encrypted_2) .'";' . "\r\n";
> echo ' window.opener.document.getElementById("answer").value =
> "' . addslashes($encrypted_3) .'";' . "\r\n";
> echo '</script>' . "\r\n";
>
>
>
> This is the output it produces:
>
> PHP Code:
>
> <script language="javascript">
> window.opener.document.getElementById("txtSSN").value = "Q{Ÿæà¬/tø
> ";
> window.opener.document.getElementById("question").value = "qAÅA5_<
> ӣɋ³¾";
> window.opener.document.getElementById("answer").value = "Äü .K";
> </script>
>
>
>
> ---------------------------------
> Yahoo! Mail - Helps protect you from nasty viruses.