forked from tkompare/flushots2013
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathical.php
More file actions
25 lines (25 loc) · 660 Bytes
/
Copy pathical.php
File metadata and controls
25 lines (25 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/*
* Echo an iCalendar for jquery.icalendar.js
*
* Written by Keith Wood (kbwood{at}iinet.com.au) July 2008
* Altered by Tom Kompare (tom@kompare.us) July 2013
*/
ini_set("display_errors", 1);
error_reporting(E_ALL & ~E_NOTICE);
// Only answer from its own host name.
$hostArray = explode(':',$_SERVER['HTTP_HOST']);
if($_SERVER['SERVER_NAME'] == $hostArray[0])
{
$content = $_GET["content"];
header("Content-type: text/calendar");
header("Content-length: ".strlen($content));
header("Content-disposition: attachment; filename=reminder.ics");
echo $content;
}
else
{
header("Location:" . trim($_SERVER['HTTP_REFERER']));
exit();
}
?>