This is a discussion on Base64 encoding and POST within the alt.comp.lang.php forums, part of the PHP Programming Forums category; If I base64_encode() some data, POST it, and base64_decode in the POSTed-to script, I get some peculiar characters at ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
If I base64_encode() some data, POST it, and base64_decode in the POSTed-to
script, I get some peculiar characters at the beginning of the decoded String. Has anyone seen this before and have a workaround? Searching on Google has only furthered my confusion on this. Thanks, Ike |
|
|||
|
What are those characters? Are they same each time, or are they
contents related (depend on coded/decoded content)? Do you use "magic_quotes_gpc" and / or "magic_quotes_sybase" and / or "magic_quotes_runtime"? They affect the way the retrieved data is stored in $_POST and $_REQUEST (and $vars if "register_globals" is on). In case of magic quotes you may solve the problem with: if (get_magic_quotes_gpc()) $data = stripslashes($_POST['data']); else $data = $_POST['data']; $data = base64_decode( $data ); Hilarion |