Base64 encoding and POST

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-09-2004
Ike
 
Posts: n/a
Default Base64 encoding and POST

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


Reply With Quote
  #2 (permalink)  
Old 12-10-2004
Hilarion
 
Posts: n/a
Default Re: Base64 encoding and POST

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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:19 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0