1 |
torben |
2125 |
<?php |
2 |
|
|
require "../inc/mysql.php"; |
3 |
|
|
|
4 |
|
|
$id = $_GET["id"]; |
5 |
|
|
|
6 |
|
|
//header("Content-Type: text/vcard"); |
7 |
|
|
header('Content-Type: application/octet-stream'); |
8 |
|
|
header("Content-disposition: attachment; filename=\"{$id}.vcf\""); |
9 |
|
|
|
10 |
|
|
|
11 |
|
|
$rows = cached_query("SELECT fornavn,efternavn,mobil,email FROM stamdata WHERE id='$id' "); |
12 |
|
|
|
13 |
|
|
$row = $rows[0]; |
14 |
|
|
|
15 |
|
|
echo "BEGIN:VCARD\r\n"; |
16 |
|
|
echo "VERSION:3.0\r\n"; |
17 |
|
|
|
18 |
|
|
|
19 |
|
|
echo "N:" . utf8_encode($row->efternavn) . ";" . utf8_encode($row->fornavn) . "\r\n"; |
20 |
|
|
echo "FN:" . utf8_encode($row->fornavn) . " " . utf8_encode($row->efternavn) . "\r\n"; |
21 |
|
|
|
22 |
|
|
echo "TEL;TYPE=cell:{$row->mobil}\r\n"; |
23 |
|
|
echo "EMAIL:{$row->email}\r\n"; |
24 |
|
|
echo "END:VCARD\r\n"; |
25 |
|
|
|
26 |
|
|
|
27 |
|
|
?> |