I am making an xml request of usps.com to get a shipping label as a base64 encoded tiff image. They are sending back the data as a base64 encoded string. I take the string and insert it into a mysql database.
When I try to display the tiff, I get a ton of random symbols, letters, crap. This is the code I have tried so far:
<?
$query = "SELECT label FROM table WHERE custid = ".$_GET['custid']."";
$result = mysql_query($query);
$data = mysql_fetch_row($result);
$USPSlabel = $data['label'];
<img src="data:image/tiff;base64,<?=$USPSlabel?>">
?>
I also tried:
<?
$query = "SELECT label FROM table WHERE custid = ".$_GET['custid']."";
$result = mysql_query($query);
$data = mysql_fetch_row($result);
$USPSlabel = $data['label'];
<img src="<?=base64_decode($USPSlabel)?>">
?>
Lastly I tried:
<?
$query = "SELECT label FROM table WHERE custid = ".$_GET['custid']."";
$result = mysql_query($query);
$data = mysql_fetch_row($result);
$USPSlabel = $data['label'];
<?=base64_decode($USPSlabel)?>
?>
Any ideas or suggestions?