Last active
September 4, 2017 04:40
-
-
Save Cojad/65e70fa4ddfc3372ad38245f9a063388 to your computer and use it in GitHub Desktop.
update Cloudflare with PHP file wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$postdata = array( | |
'type' => 'A', | |
'name' => 'a.xxx.tw', //你的domain name | |
'content' => '123.123.123.123' // 你要更新的對應ip地址 | |
); | |
$opts = array('http' => | |
array( | |
'method' => 'PUT', | |
'header' => "X-Auth-Email: 你的信箱@gmail.com\r\n" . | |
"X-Auth-Key: xxxxxxxxxxxxxxxxxxxxx__你的AuthKey__xx\r\n" . | |
"Content-type: application/json\r\n", | |
'content' => json_encode($postdata) | |
) | |
); | |
$context = stream_context_create($opts); | |
$result = file_get_contents('https://api.cloudflare.com/client/v4/zones/__你的zone_identifier__xxxxxxxxxxxx/dns_records/__你的RECORDID__xxxxxxxxxxxxxxxxxx', false, $context); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment