aboutsummaryrefslogtreecommitdiffstats
path: root/api/guestbook-proxy.php
diff options
context:
space:
mode:
authorsillylaird <sillyfanboy@gmail.com>2026-09-03 00:33:59 +0000
committersillylaird <sillyfanboy@gmail.com>2026-09-03 00:33:59 +0000
commit898b52edcb47bcb3e9d6106e74ca73e74ea01e70 (patch)
tree85c6ee5ad58b860144551184d4cf86b560c62b91 /api/guestbook-proxy.php
downloadwww-main.tar.gz
www-main.zip
import live www.sillylaird.ca webrootHEADmain
Diffstat (limited to '')
-rw-r--r--api/guestbook-proxy.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/api/guestbook-proxy.php b/api/guestbook-proxy.php
new file mode 100644
index 0000000..63f1446
--- /dev/null
+++ b/api/guestbook-proxy.php
@@ -0,0 +1,29 @@
+<?php
+// Proxy for guestbook comments — sidesteps browser CORS restrictions.
+// PHP fetches happen server-to-server with no CORS enforcement.
+
+header('Content-Type: text/html; charset=utf-8');
+header('Cache-Control: no-store, no-cache');
+header('X-Robots-Tag: noindex');
+
+$url = 'https://guestbook.sillylaird.ca/guestbook-comments.php';
+$ctx = stream_context_create([
+ 'http' => [
+ 'timeout' => 8,
+ 'user_agent' => 'SillyLaird-Proxy/1.0',
+ 'ignore_errors' => true,
+ ],
+ 'ssl' => [
+ 'verify_peer' => true,
+ 'verify_peer_name' => true,
+ ],
+]);
+
+$html = @file_get_contents($url, false, $ctx);
+
+if ($html === false) {
+ http_response_code(502);
+ exit;
+}
+
+echo $html;