Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://web.archive.org/web/20120419230026/http://jamiebicknell.tumblr.com/post/413492676/ics-generator-php-class" rel="nofollow noreferrer">http://web.archive.org/web/20120419230026/http://jamiebicknell.tumblr.com/post/413492676/ics-generator-php-class</a></p> <p><strong>Note:</strong> original blog post is gone; preserving with arhcive.org link.</p> <hr> <p>Copy and paste the information of the above link:</p> <pre><code>&lt;?php class ICS { var $data; var $name; function ICS($start,$end,$name,$description,$location) { $this-&gt;name = $name; $this-&gt;data = "BEGIN:VCALENDAR\nVERSION:2.0\nMETHOD:PUBLISH\nBEGIN:VEVENT\nDTSTART:".date("Ymd\THis\Z",strtotime($start))."\nDTEND:".date("Ymd\THis\Z",strtotime($end))."\nLOCATION:".$location."\nTRANSP: OPAQUE\nSEQUENCE:0\nUID:\nDTSTAMP:".date("Ymd\THis\Z")."\nSUMMARY:".$name."\nDESCRIPTION:".$description."\nPRIORITY:1\nCLASS:PUBLIC\nBEGIN:VALARM\nTRIGGER:-PT10080M\nACTION:DISPLAY\nDESCRIPTION:Reminder\nEND:VALARM\nEND:VEVENT\nEND:VCALENDAR\n"; } function save() { file_put_contents($this-&gt;name.".ics",$this-&gt;data); } function show() { header("Content-type:text/calendar"); header('Content-Disposition: attachment; filename="'.$this-&gt;name.'.ics"'); Header('Content-Length: '.strlen($this-&gt;data)); Header('Connection: close'); echo $this-&gt;data; } } ?&gt; </code></pre> <p>Output the ICS file to the browser and give the user the option to open or save</p> <pre><code>&lt;?php $event = new ICS("2009-11-06 09:00","2009-11-06 21:00","Test Event","This is an event made by Jamie Bicknell","GU1 1AA"); $event-&gt;show(); ?&gt; </code></pre> <p>Save the ICS file onto the server in the current working directory</p> <pre><code>&lt;?php $event = new ICS("2009-11-06 09:00","2009-11-06 21:00","Test Event","This is an event made by Jamie Bicknell","GU1 1AA"); $event-&gt;save(); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload