#!/usr/bin/perl # vcfcreater.vcf # If you use IIS all you need to do is add a handler for # the .vcf file to be run through perl.exe # On *nix you just need to make it executable and have a # handle for the extention. use CGI; use strict; my $q = new CGI; my $city = "CITY"; my $state = "NO"; my $zip = "44444"; #Example if you are in eastern time zone in the US it is 5 my $Greenwich_mean_time_difference = 5; my $office = "Dot Com Store"; my $fname = $q->param('fname'); my $lname = $q->param('lname'); my $title = $q->param('title'); my $phone = $q->param('phone'); my $fax = $q->param('fax'); my $address = $q->param('address'); my $email = $q->param('email'); my($sec, $min, $hour, $day, $month, $year)=(localtime)[0,1,2,3,4,5]; $hour = $hour + $Greenwich_mean_time_difference; $year += 1900; $month++; if($month < 10){ $month = "0$month"; } if($day < 10) { $day = "0$day"; } print "Content-Type: download/x-vcard\n\n"; print "BEGIN:VCARD\nVERSION:2.1\n"; print "N:$lname;$fname\n"; print "FN:$fname $lname\n"; print "ORG:$office\n"; print "TITLE:$title\n"; print "TEL;WORK;VOICE:(616) $phone\n"; print "TEL;WORK;FAX:(616) $fax\n"; print "ADR;WORK:;;$address, MW;$city;$state;$zip;United States of America\n"; print "LABEL;WORK;ENCODING=QUOTED-PRINTABLE:$address, MW=0D=0A$city, $state $zip=0D=0AUnited States of America\n"; print "EMAIL;PREF;INTERNET:$email\@somewhere.com\n"; print "REV:$year$month$dayT$hour$min$secZ\n"; print "END:VCARD\n"; exit;