diff --git a/index.php b/index.php index 78f909c..d53455c 100644 --- a/index.php +++ b/index.php @@ -10,7 +10,7 @@ if ( $_REQUEST['style'] == 'ticket' || $_REQUEST['style'] == 'xbian' || $_REQUES } else { $file_type = "pdf"; } -$attachment_location = "/tmp/g1billet/".$timestamp.".".$file_type; +$attachment_location = dirname(__FILE__)."/tmp/g1billet/".$timestamp.".".$file_type; if (file_exists($attachment_location)) { header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); @@ -20,7 +20,7 @@ if (file_exists($attachment_location)) { header("Content-Length:".filesize($attachment_location)); header("Content-Disposition: attachment; filename=".$timestamp.".".$file_type); readfile($attachment_location); - unlink("/tmp/g1billet/".$timestamp.".".$file_type); + unlink(dirname(__FILE__)."/tmp/g1billet/".$timestamp.".".$file_type); die(); } else { die("Error: File not found.");