doujie7886 2012-10-15 11:12
浏览 206
已采纳

创建vCard QR码

I've got a PHP script that generates a business card template from details entered on the website.

We've recently decided to add QR Code vCards to the business cards as an easy way to save contact info. I am using this tutorial as a starting point.

However, my QR Code does not work. It keeps giving me no result and format as text.

Here is the script that creates the vcard and displays the qr code:

$vcard = "BEGIN:VCARD
VERSION:3.0

N:" . $_POST['surname'] . ";" . $_POST['name'] . "

FN:" . $_POST['name'] . " " . $_POST['surname'] . "

ORG:Example Organisation

TITLE:" . $_POST['position'] . " [" . $_POST['qualification'] . "]

TEL;TYPE=work,voice:" . $_POST['telephone'] . "

TEL;TYPE=cell,voice:" . $_POST['cellno'] . "

TEL;TYPE=work,fax:" . $_POST['fax'] . "

URL;TYPE=work:www.example.com

EMAIL;TYPE=internet,pref:" . $_POST['email'] . "

REV:" . date('Ymd') . "T195243Z

END:VCARD";

echo '<img src="http://chart.apis.google.com/chart?chs=500x500&cht=qr&chld=H&chl="' . urlencode($vcard) . '"/>';

Any assistance?

  • 写回答

2条回答 默认 最新

  • douzhi9921 2012-10-15 11:39
    关注

    The double quote is being encoded into the QR Code, it should work if you remove these (and should avoid error as any special characters are encoded).

    Removing the quotes gives me this QR Code which seems to work:

    QR Code

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私