Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to create Calendar Event?

Status
Not open for further replies.

bdichiara

Programmer
Joined
Oct 11, 2006
Messages
206
Location
US
I was wondering if this was possible. I have a web based calendar designed in PHP and I would like to know if it is possible to create a clickable link that will add an event to a user's Outlook Calendar. It would be ok if it only worked in IE, i'm just wondering if it's possible and how to do it. Thanks

_______________
_brian.
 
Yes. This is fairly simple. Have your application response return:

.setContentType("text/calendar;charset=ISO-8859-1");
.setHeader("Content-Disposition", "attachment; filename=FileNameHere.ics");


write("BEGIN:VCALENDAR");
write("METHOD:PUBLISH");
write("VERSION:2.0");
write("BEGIN:VEVENT");
write("DTSTAMP:20070122T170000Z"); //same as DTSTART, but ending in Z
write("DTSTART:20070122T170000"); //update start time accordingly
write("DTEND:20070122T180000); //update start time accordingly
write("SUMMARY:Summary Goes Here");
write("LOCATION:Location Goes Here");
write("UID:UniqueIdGoesHere");
write("DESCRIPTION:Description Goes Here");
write("STATUS:TENTATIVE");
write("END:VEVENT");
write("END:VCALENDAR");


This will be supported by most email clients (iCal, outlook, thunderbird, gmail, yahoo, etc)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top