Re: Is it a mysql AND/OR php BUG???

From: Date: Wed, 12 Sep 2001 14:45:47 +0000
Subject: Re: Is it a mysql AND/OR php BUG???
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67050@lists.php.net to get a copy of this message
the function isn't decoding right. regards, Augusto --- "Schill, Johannes" <johannes@funplanet.com> escreveu: > Please include your error message. > > /Johannes > > ----- Original Message ----- > From: "Augusto Cesar Castoldi" > <accastoldi@yahoo.com.br> > To: <php-general@lists.php.net> > Sent: Wednesday, September 12, 2001 4:10 PM > Subject: [PHP] Is it a mysql AND/OR php BUG??? > > > > Please, look this little script, and what he > prints. > > Am I doing something wrong or I "found" a bug?? > > > > thanks a lot. > > > > <? > > function encode($encode_str, $pass_str) > > { > > $encode_str = addslashes($encode_str); > > $sql = "select encode(\"$encode_str\", > > \"$pass_str\")"; > > echo htmlspecialchars($sql)."<br>"; > > $data = mysql_query($sql) or die ("Erro crypt > 1."); > > $row = mysql_fetch_row($data); > > return $row[0]; > > } > > function decode($decode_str, $pass_str) > > { > > $encode_str = addslashes($encode_str); > > $sql="select decode(\"$decode_str\", > > \"$pass_str\")"; > > echo htmlspecialchars($sql)."<br>"; > > $data = mysql_query($sql) or die ("Erro crypt > 2."); > > $row = mysql_fetch_row($data); > > return $row[0]; > > } > > > > > > //$string = "as\"df asd <>>asd > asd reaais > R\$200.00 > > fa''< < > > \"\" \$sdljh;"; // WORK > > $string = "as\"df asd <>> asd > asd reaais > > R\$200.00 fa''< < > > \"\" \$sdljh"; // DON'T > WORK > > > > $key = "12345679"; > > echo "<br>1 - > > > string=<b>".htmlspecialchars($string)."</b><br>chave=$key<br>"; > > $string = encode($string, $key); > > echo "<br>2 - > > > string_encoded=<b>".htmlspecialchars($string)."</b><br>chave=$key<br>"; > > $string = decode($string, $key); > > echo "<br>3 - > > > string_decoded=<b>".htmlspecialchars($string)."</b><br>chave=$key<br>"; > > ?> > > > > > ____________________________________________________________________________ > ___________________ > > Yahoo! GeoCities > > Tenha seu lugar na Web. Construa hoje mesmo sua > home page no Yahoo! > GeoCities. É fácil e grátis! > > http://br.geocities.yahoo.com/ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: > php-general-help@lists.php.net > > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > _______________________________________________________________________________________________ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/

« previous php.general (#67050) next »