Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Using PHP to Make Basic vCalendar/iCalendar Events
MIME Type Setups
A standard vCalendar file has an extension of .vcs and MIME type of text/x-vCalendar. If you use iCalendar, the MIME type is "text/Calendar" and the extension is .ics.
You'll need to tell Apache to send the linked-to file to PHP for parsing, and then tell PHP to send it with the vCalendar MIME type. The easiest way to do this is to have a .php file that sends a stream of data as a vCalendar file to the browser. This is accomplished by calling the header function at the very top of your script. For vCalendars:

<?php
    header
("Content-Type: text/x-vCalendar");
    
header("Content-Disposition: inline; filename=MyvCalFile.vcs");
?>
An alternative is to have a .vcs or .ics file with PHP code, but you'll need to make the appropriate changes to your server's httpd.conf and mime.types files. Add .vcs (or .ics) to httpd.conf's AddType application/x-httpd-php line and add the appropriate MIME type to your mime.types file.
On the client side, the browser must have the text/x-vCalendar MIME type registered, and, ideally, it should be told to directly open up the vCalendar file with the calendaring application. Most browsers should have this pre-configured. The rest will probably prompt the user for the application to open the file with. You may want to include help text on what this .vcs file does, and, if necessary, how to configure MIME type settings.
Next Page

[Page 1]  [Page 2]  


Comments:
iCal and Email (outlook)Paul McMahon11/03/07 06:22
Scheduler/ CalendarDarlene02/13/06 13:57
event icalendararbind kumar12/09/05 08:44
Multiple Events/Calendar Export?Judah Anthony10/17/05 19:42
subcription and multiple dates?Jody Whitesides08/25/05 16:29
Web CalendarHarish Balakrishnan08/12/05 23:56
articlePiotr Tomaszewski12/02/04 16:34
Multiple EventsSteve Godwin12/12/03 23:40
RE: TimeZone issue in Outlook 2000roger11/17/03 16:43
RE: iCal and emailChristian Berg05/06/03 11:18
iCalendar extension for PHPJoakim Recht02/18/03 19:46
Hex ValueJames Jeffers12/10/02 17:26
RE: TimeZone issue in Outlook 2000Shu-Wai Chow10/26/02 01:55
TimeZone issue in Outlook 2000Jeff10/23/02 20:59
RE: whats wrong with my output?Shu-Wai Chow10/22/02 10:23
RE: whats wrong with my output?Flaimo10/21/02 20:21
whats wrong with my output?Flaimo10/19/02 16:00
RE: iCal and emailShu-Wai Chow10/18/02 16:41
iCal and emailGrok10/12/02 20:03
RE: not ok for MozillaShu-Wai Chow10/11/02 16:15
RE: not ok for Mozillayves10/11/02 15:45
RE: not ok for MozillaShu-Wai Chow10/10/02 15:14
not ok for MozillaYves Glodt10/09/02 04:37
event calendersubash10/08/02 02:48
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.