-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathqrcodegenerator.php
56 lines (43 loc) · 1.34 KB
/
qrcodegenerator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
include('qrlib.php');
include('connection.php');
// how to build raw content - QRCode with detailed Business Card (VCard)
$sel_query="Select * from newmeduser ORDER BY id desc;";
$result = mysqli_query($connection,$sel_query);
if(!$result){
die('No data');
}
while($row = mysqli_fetch_array($result)) { ?>
$firstname=$_POST["firstname"];
$lastname=$_POST["lastname"];
$address=$_POST["address"];
$title=$_POST["title"];
$company=$_POST["company"];
$email=$_POST["email"];
$website=$_POST["website"];
$phonenumber=$_POST["phonenumber"];
<?php } ?>
<?php
public function QrCodeForCard()
{
$tempDir = EXAMPLE_TMP_SERVERPATH;
// we building raw data
$codeContents = 'BEGIN:VCARD'."\n";
$codeContents .= 'VERSION:2.1'."\n";
$codeContents .= 'N:'.$firstnameName."\n";
$codeContents .= 'FN:'.$lastnamename."\n";
$codeContents .= 'ORG:'.$company."\n";
$codeContents .= 'ORG:'.$title."\n";
$codeContents .= 'ORG:'.$website."\n";
$codeContents .= 'TEL;WORK;VOICE:'.$phonenumber."\n";
$codeContents .= 'ADR;TYPE=work;'.
'LABEL="'.$addressLabel.'":'
.$address.
."\n";
$codeContents .= 'EMAIL:'.$email."\n";
$codeContents .= 'END:VCARD';
// generating
$QR= QRcode::png($codeContents, $tempDir.'026.png', QR_ECLEVEL_L, 3);
return $QR;
}
?>