Hallo leden,
Zojuist heb ik voor een school opdracht een simpel scriptje moeten maken en mij leek het leuk om deze te delen met jullie. Hij maakt gebruik van GoogleAPI.
Code: 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
QR Code Generator
if($_SERVER["REQUEST_METHOD"] == "POST"){
$text = $_POST[text];
$width = $_POST[width];
$height = $_POST[height];
$qrcode = "https://chart.googleapis.com/chart?cht=qr&chs=".$width."x".$height."&chl=".$text."";
$qrcodeklein = "https://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=".$text."";
?>
" size="40">
HTML: echo $qrcode; ?>" alt="QR code">>
Nog een QR code maken?
}else{ ?> } ?>
Codeblok (style.css):
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
#wrapper {
background-color: #504E59;
overflow: hidden;
}
#field {
width:700px;
height:350px;
margin:auto;
margin-top: 100px;
border-radius: 40px;
background-color: white;
padding-left: 20px;
padding-top: 20px;
position: relative;
clear: block;
}
#qrfield {
width: 220px;
height: 250px;
margin:auto;
position: relative;
margin-top: 10px
background-color: #504E59;
float: right;
}
button {
color: 504E59;
background-color: #00B8FF;
font-weight: bold;
font-size: 150%;
border: 2px;
border-radius: 5px;
text-transform: uppercase;
}
input[type=text] {
border: 2px;
height: 25px;
border-radius: 5px;
background-color: #F4F4FF;
}
textarea {
resize: none;
border: 2px;
border-radius: 5px;
background-color: #F4F4FF;
Demo:
http://www.britdiensten.nl/overig/qr/
Er missen nog wel wat checks etc maar het geheel werkt
Zojuist heb ik voor een school opdracht een simpel scriptje moeten maken en mij leek het leuk om deze te delen met jullie. Hij maakt gebruik van GoogleAPI.
Code:
Spoiler tonen
Codeblok (index.php):
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
QR Code Generator
if($_SERVER["REQUEST_METHOD"] == "POST"){
$text = $_POST[text];
$width = $_POST[width];
$height = $_POST[height];
$qrcode = "https://chart.googleapis.com/chart?cht=qr&chs=".$width."x".$height."&chl=".$text."";
$qrcodeklein = "https://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=".$text."";
?>
echo $qrcode; ?>" target="_blank">QR code op ware grote weergeven
Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt. echo $qrcodeklein; ?>" alt="QR code">
echo $qrcode; ?>" download>Download
Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt. echo $qrcodeklein; ?>" alt="QR code">
echo $qrcode; ?>" download>Download
| Direct url: | echo $qrcode; ?>" size="40"> |
| UBB: | Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt. echo $qrcode; ?>" alt="Afbeelding" class="bbcode-image rounded-lg max-w-full h-auto" loading="lazy" decoding="async" /> |
Nog een QR code maken?
}else{ ?>
QR code generator
Codeblok (style.css):
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
#wrapper {
background-color: #504E59;
overflow: hidden;
}
#field {
width:700px;
height:350px;
margin:auto;
margin-top: 100px;
border-radius: 40px;
background-color: white;
padding-left: 20px;
padding-top: 20px;
position: relative;
clear: block;
}
#qrfield {
width: 220px;
height: 250px;
margin:auto;
position: relative;
margin-top: 10px
background-color: #504E59;
float: right;
}
button {
color: 504E59;
background-color: #00B8FF;
font-weight: bold;
font-size: 150%;
border: 2px;
border-radius: 5px;
text-transform: uppercase;
}
input[type=text] {
border: 2px;
height: 25px;
border-radius: 5px;
background-color: #F4F4FF;
}
textarea {
resize: none;
border: 2px;
border-radius: 5px;
background-color: #F4F4FF;
Demo:
http://www.britdiensten.nl/overig/qr/
Er missen nog wel wat checks etc maar het geheel werkt



38:
