Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

miowebdesigns on "Extra spaces in vcard download file"

$
0
0

I have a vcard program that I have never used within Wordpress. It is the basic vcard creation that you can find on any website.

print <<<END
BEGIN:VCARD
VERSION:3.0
N:$last;$first;$middle;;;
FN:$fullname
TITLE:$title
PHOTO;VALUE=URL;TYPE=JPG:$path$photo
ORG:$office
TEL;WORK;VOICE:$tel
TEL;WORK;FAX:$fax
EMAIL;TYPE=PREF;INTERNET:$attorney_email
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;$address=0D=0A$address2;$city;$state;$zip;$country;
URL;TYPE=WORK:http://criminallawsexcrimessacramento.com/
END:VCARD
END;

$output = ob_get_contents();

header('Content-Type: text/x-vcard');
header('Content-Disposition: attachment; filename=vCard_' . $filename . '.vcf');
echo trim($output);
exit();

The problem is the output has extra leading zeros. When I use this code on a php site, not Wordpress, the output has no extra spaces. Not sure why the extra spaces are happening or how to remove them. As you can see in the code I am using trim().
example of file
"
BEGIN:VCARD
VERSION:3.0
N:Daly;Kresta;N.;;;
FN:Kresta N. Daly
TITLE:Partner
PHOTO;VALUE=URL;TYPE=JPG:http://kd.bothwip2013.com//images/attorney_photos/kresta-image.png
ORG:Sacramento
TEL;WORK;VOICE:(916) 440-8600
TEL;WORK;FAX:(916) 440-9610
EMAIL;TYPE=PREF;INTERNET:kdaly@barth-daly.com
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;431 I Street, Suite 201=0D=0A;Sacramento;CA;95814;United States;
URL;TYPE=WORK:http://criminallawsexcrimessacramento.com/
END:VCARD"

Thanks for any suggestions.
Michael


Viewing all articles
Browse latest Browse all 8245

Trending Articles