the function isn't decoding right.
regards,
Augusto
--- "Schill, Johannes" <[EMAIL PROTECTED]>
escreveu: > Please include your error message.
>
> /Johannes
>
> - Original Message -
> From: "Augusto Cesar Castoldi"
> <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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)."";
> > $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)."";
> > $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 "1 -
> >
>
string=".htmlspecialchars($string)."chave=$key";
> > $string = encode($string, $key);
> > echo "2 -
> >
>
string_encoded=".htmlspecialchars($string)."chave=$key";
> > $string = decode($string, $key);
> > echo "3 -
> >
>
string_decoded=".htmlspecialchars($string)."chave=$key";
> > ?>
> >
> >
>
> ___
> > 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:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
___
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]