mcrypt / fputs problems
| From: | David Rose | Date: | Fri, 28 Jul 2000 17:32:10 +0000 |
| Subject: | mcrypt / fputs problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8823@lists.php.net to get a copy of this message | ||
I don't get it.... Here's the code that's relevant to the problem...
<?
$SEPERATOR = "\",\""; # "," to seperate values for comma-delineated
text
file.
<snipped mysql_etc and fopen(etc)>
while($row = mysql_fetch_array($result))
{
$getcardnumber = $row["cardnumber"];
$cardnumber = mcrypt_ecb(MCRYPT_BLOWFISH, $key,
base64_decode("$getcardnumber"), MCRYPT_DECRYPT);
fputs ($ExportFile, "\"");
fputs ($ExportFile, $row["something"].$SEPERATOR);
fputs ($ExportFile, $cardnumber.$SEPERATOR);
fputs ($ExportFile, $row["somethingelse"]."\"\n");
}
?>
note: I left a lot of what I guess is irrelevant code out of this
sample. Sample output from the 'export' (where XXXetc is the unencrypted
card #):
"something","XXXX XXXX XXXX XXXX
notice that the fputs simply stop after outputting the card #.
What's going on here??? Any help will be greatly appreciated. Thanks,
David Rose.