Reputation: 121
i try to generate VCARDS with http://phpqrcode.sourceforge.net/ with the following code
<?php
include('myclasses/phpqrcode/qrlib.php');
QRcode::png("BEGIN:VCARD VERSION:3.0 N:Mustermann;Max FN:Max Mustermann ORG:Firma",
"myclasses/phpqrcode/test2.png", "L", 4, 4);
echo '<img src="myclasses/phpqrcode/test2.png" />';
php?>
Has anyone an idea whats wrong ? the scanner gets an empty vcard !
thanx
Upvotes: 1
Views: 4870
Reputation: 14334
A standard vCard looks like this: http://en.wikipedia.org/wiki/VCard#Example_vCard_files
BEGIN:VCARD
VERSION:2.1
N:Gump;Forrest
TEL;WORK;VOICE:(111) 555-1212
END:VCARD
Notice that there is a new line after every field.
Your card says
BEGIN:VCARD VERSION:3.0 N:Mustermann;Max FN:Max Mustermann ORG:Firma
There are no newlines so the vCard scanner is getting confused.
You need to explicitly put in newlines to make it work. For example:
BEGIN:VCARD\nVERSION:3.0\nN:Mustermann;Max\nFN:Max Mustermann\nORG:Firma
That should make your card work.
Upvotes: 3