We have a calendar created via PHP and MySQL. Upon clicking on an event and viewing the full details of the event, we'd like to add a link that would download that event to Microsoft Outlook. The data for the download would come from the database which we'd Query via the unique ID for the event.
Any ideas what format or how we'd go about creating the necessary PHP code to call the database, gather the event details, put them into the necessary format to work with Outlook and export the data to a file format that Outlook would automatically open?
Which describes the format of a vCalendar-type file (extension .vcs). However I was not able to find a way to automatically import a vcs file into Outlook-- it seems the only way to do it is open Outlook and use the "import" utility inside the application. Perhaps there is a way to automate it, but I was not able to find it.
Thanks for the response. I don't know much about the VCS format. I have seen the export to outlook calendar on a few different sites and they use the ICS format each time.
They have an icon of a calendar next to the title of the event which is a link to a file called event_ics.php that generates the ICS file. I've contacted this website to see if they'd be willing to share their code but if anyone else has any ideas of how to do this, I'd be greatful.
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Looks like ics is = to vcs pretty much. Here's the file on the WNYMusic site:
Code:
BEGIN:VCALENDAR
VERSION:1.0
PRODID:Wnymusic.com Web Calendar
TZ:-05
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY:The Revenue
LOCATION:Club Infinity
URL;VALUE=URI:http://www.wnymusic.com/calendar.php?event_id=11672
DESCRIPTION;ENCODING=QUOTED-PRINTABLE: Tickets available at Club Infinity Box Office (716)565-0110, Tickets.com, Tops Supermarkets. Free Parking. All shows are 18 and up (if under 18, must be accompanied by someone over 21).
DTSTART:20070814T070000
DTEND:20070814T090000
END:VEVENT
END:VCALENDAR
Seems to me you can create a file in this format (fopen, fwrite), stick an ics extension on it, and there you go.
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.