Bug Tracker

Ticket #4764: if_modified_since.php

File if_modified_since.php, 331 bytes (added by lawrencepit, 13 years ago)
Line 
1<?php
2error_reporting(0);
3
4$ts = $_REQUEST['ts'];
5
6$ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false;
7if ($ifModifiedSince == $ts) {
8    header('HTTP/1.0 304 Not Modified');
9    die; // stop processing
10}
11
12header("Last-Modified: " . $ts);
13echo "OK: " . $ts;
14
15?>