scratch – Diff between revs 57 and 62
?pathlinks?
Rev 57 | Rev 62 | |||
---|---|---|---|---|
Line 66... | Line 66... | |||
66 | #### Store the file. |
66 | #### Store the file. |
|
67 | atomized_put_contents($userPath.'.html', $_POST['data']); |
67 | atomized_put_contents($userPath.'.html', $_POST['data']); |
|
68 | break; |
68 | break; |
|
69 | case 'LOAD': |
69 | case 'LOAD': |
|
70 | if(!file_exists($userPath.'.html')) { |
70 | if(!file_exists($userPath.'.html')) { |
|
71 | header('File not found.', true, 404); |
71 | ### If the file does not exist, present an empty file instead of 404. |
|
- | 72 | echo ''; |
||
72 | return; |
73 | return; |
|
73 | } |
74 | } |
|
74 | ### Set no-cache |
75 | ### Set no-cache |
|
75 | header('Content-Type: text/html; charset=utf-8'); |
76 | header('Content-Type: text/html; charset=utf-8'); |
|
76 | header('Cache-Control: no-cache, no-store, must-revalidate'); |
77 | header('Cache-Control: no-cache, no-store, must-revalidate'); |