/[projects]/misc/horsensspejder-web/mobile/vcard.php
ViewVC logotype

Annotation of /misc/horsensspejder-web/mobile/vcard.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (hide annotations) (download)
Wed Mar 12 19:30:05 2014 UTC (10 years, 3 months ago) by torben
File size: 646 byte(s)
initial import
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     ?>

  ViewVC Help
Powered by ViewVC 1.1.20