Skip to content

Instantly share code, notes, and snippets.

@ammarfaizi2
Created June 1, 2023 16:10
Show Gist options
  • Save ammarfaizi2/275a118dd9257044e01bd31525e30c6b to your computer and use it in GitHub Desktop.
Save ammarfaizi2/275a118dd9257044e01bd31525e30c6b to your computer and use it in GitHub Desktop.
<?php
if (!isset($_GET["key"]) || $_GET["key"] !== "secure your endpoint") {
http_response_code(403);
exit(0);
}
header("Content-Type: text/plain");
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER["REMOTE_ADDR"] ?? "";
echo file_get_contents("https://freedns.afraid.org/dynamic/update.php?your_key=x&address=".urlencode($ip));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment