#28328 [Opn->Fbk]: error encoding using base64_encode and base64_decode

From: Date: Sun, 09 May 2004 17:34:28 +0000
Subject: #28328 [Opn->Fbk]: error encoding using base64_encode and base64_decode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-59429@lists.php.net to get a copy of this message
ID: 28328 Updated by: iliaa@php.net Reported By: amr_hossam at hotmail dot com -Status: Open +Status: Feedback Bug Type: *General Issues Operating System: Windows NT PHP Version: 4.3.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Previous Comments: ------------------------------------------------------------------------ [2004-05-08 22:48:34] amr_hossam at hotmail dot com Description: ------------ I wanted to encode some data to be used later through the base64_encode and the base64_decode functions ... I took some variables and encoded it, then when I want to decode these data to display it, I found that it doesn't exist or can't be decoded ... Reproduce code: --------------- function docookie($setuid, $setusername, $setpass, $setstorynum, $setumode, $setuorder, $setthold, $setnoscore, $setublockon, $settheme, $setcommentmax) { $info = base64_encode("$setuid:$setusername:$setpass:$setstorynum:$setumode:$setuorder:$setthold:$setnoscore:$setublockon:$settheme:$setcommentmax"); } function cookiedecode($user) { global $user, $cookie; $user = base64_decode($user); $cookie = explode(":", $user); } Expected result: ---------------- variable $cookie[1] should contain the username entered Actual result: -------------- $cookie is empty .. doesn't contain any encoded or decoded data ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28328&edit=1

« previous php.bugs (#59429) next »