PHP Classes

Problem with Qr-code.php Class

Recommend this page to a friend!

      QR code generator  >  All threads  >  Problem with Qr-code.php Class  >  (Un) Subscribe thread alerts  
Subject:Problem with Qr-code.php Class
Summary:There is some Problem with the metadata of Vcard
Messages:2
Author:Paramveer Singh
Date:2011-04-26 11:45:52
Update:2011-04-26 12:31:29
 

  1. Problem with Qr-code.php Class   Reply   Report abuse  
Picture of Paramveer Singh Paramveer Singh - 2011-04-26 11:45:52
i have downloaded the class qrcode.php ,but there are some issues
i included V-Card in place of MEcard as it is the requirement of my project I,m using 12 fields in my form to generate qr-code image Here is my code

public function contact_info($name,$lastname,$title,$phone,$email,$url,$org,$address,$city,$state,$country,$zip)
{
$this->data = "BEGIN:VCARD\r\nVERSION:2.1\r\nFN:".$name."\t".$lastname."\r\nTITLE:".$title."\r\nTEL;TYPE=WORK,VOICE:".$phone."\r\nEMAIL:".$email."\r\nURL:".$url."\r\nORG:".$org."\r\nADR;TYPE=WORK:;;".$address."\r\nCITY:".$city."\r\nSTATE:".$state."\r\nCOUNTRY:".$country."\r\nZipcode:".$zip."\r\nEND:VCARD";
}

out of these lastname,city,state,country,zipcode values are not retrieving when iam scanning the image ,iam using QR DROID scanner and Barcode scanner of Zxing in my samsung galaxy i9000,Please help me out this is quite urgent

  2. Re: Problem with Qr-code.php Class   Reply   Report abuse  
Picture of Arturs Sosins Arturs Sosins - 2011-04-26 12:31:29 - In reply to message 1 from Paramveer Singh
Hi,
according to wikipedia http://en.wikipedia.org/wiki/VCard
there's no parameters like state, city, etc.

Try something like this:

public function contact_info($name,$lastname,$title,$phone,$email,$url,$org,$address,$city,$state,$country,$zip)
{
$this->data = "BEGIN:VCARD
VERSION:2.1
N:".$lastname.";".$name."
FN:".$name." ".$lastname."
ORG:".$org."
TITLE:".$title."
TEL;WORK;VOICE:".$phone."
ADR;WORK:;;".$address.";".$city.";".$state.";".$zip.";".$country."
EMAIL;PREF;INTERNET:".$email."
URL:".$url."
REV:".date("Y").date("m").date("d")."T".date("H").date("i").date("s")."Z
END:VCARD";
}