I've written a script to generate an iCal calendar from events in my database. Here's a sample output:
Going back to the basics a bit you cannot upload your PHP script, some calendar clients allow you to subscribe to a URL to pick up an iCal feed, make sure this is what you are doing and that you are not trying to upload the PHP script file.
If that is OK, then we can look at the definition. According to the documentation the
ORGANIZER parameter is optional, if it is included it has to have a colon
: and a cal-address which must be a URI. Your
ORGANIZER fields look like this:
They should look like this:
Where URI doesn't necessarily have to be a mailto, here are some examples. For convenience an email address can be added like this...
Or a phone number...
You can include a web of ftp URLs as well as some other less used things. Alternatively the parameter is not required, so you can simply remove it.
Also it appears that the
VEVENT is missing a
UID and a
DTSTAMP which are required properties.
UID can be an identifier of your choosing but it should be globally unique. I'll take the moment to explain what is meant by globally unique by describing the implications of the
UID parameter. The calendar client will use this to identify the event, if you use an id of an event that already exists in the calendar it will update that event thinking you mean for it to do that, therefore it must not match the id of an existing event. If you think of adding events to lots of different calendar clients that may also contain events, this is why it must by "globally" unique. There is a
uniqid() function you can use in PHP which might help create your own globally unique identifiers.
DTSTAMP is the time the event was created or last updated.
The white-space in your definition is inconsistent, the documentation does not discuss white-space between parameters and values but all examples are shown without whitespace so you might also want to strip any non-essential whitespace...
It might not hurt but there is the possibility. I would also start off with trying one event with the bare minimum of parameters just to check it is the iCal definition causing the issue.
BEGIN:VCALENDAR VERSION:2.0 PRODID:-//hacksw/handcal//NONSGML v1.0//EN BEGIN:VEVENT UID:20121229T212000Z-test-1 DTSTAMP:20121229T212000Z DTSTART:20130128T173000Z DTEND:20130128T193000Z END:VEVENT END:VCALENDAR
You might want to check your PHP script is using the correct mime-type as well
text/calendar. If it isn't you can add the
Content-Type header to the response using the
I hope this helps...