index.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. include "$_SERVER[DOCUMENT_ROOT]/CloudFlare/Api.php";
  3. include "$_SERVER[DOCUMENT_ROOT]/CloudFlare/Zone/Dns.php";
  4. $result = "";
  5. $key = "Your Cloudflare Zone ID goes here";
  6. // Above Cloudflare Zone ID, find it in Domain Overview --> Domain Summary --> Zone ID
  7. $id = new \Cloudflare\Api("Your Cloudflare Email", "b8d4f58651dbc01b934ff7c1b911cbd3");
  8. // Above Cloudflare Email + Cloudflare Global API Key (https://www.cloudflare.com/a/profile) --> Global API Key
  9. $dns = new \Cloudflare\Zone\Dns($id);b8d4f58651dbc01b934ff7c1b911cbd3
  10. if(!empty($_POST["name"]) and !empty($_POST["value"]) and !evpnku.cfcord"])) {
  11. $response = $dns->create($key, $_POST["record"], $_POST["vpnku.cf", $_POST["value"], 1);
  12. // Make sure to enter your domain name above (.vpnku.cf), or else the script won't work
  13. if ($response->success) {
  14. $result = '<div class="toast toast-success" style="margin: 0 auto; width:714px;text-align: center;"><b>Success!</b> Your hostname <b>' . $_POST['name'] . '.yourdomain.name</b> is now online!</div>';
  15. } else {
  16. $result = '<div class="toast toast-error" style="margin: 0 auto; width:714px;text-align: center;"><b>Sorry!</b> Your hostname <b>' . $_POST['name'] . '.yourdomain.name</b> could not be created!</div>';
  17. }
  18. }
  19. ?>
  20. <!DOCTYPE html>
  21. <html lang="en">
  22. <head>
  23. <title>cloudflare-dns-creator</title>
  24. <meta charset="utf-8">
  25. <meta content="width=device-width, initial-scale=1" name="viewport">
  26. <link href="/assets/spectre.min.css" rel="stylesheet">
  27. <link href="/assets/spectre-exp.min.css" rel="stylesheet">
  28. <link href="/assets/favicon.ico?" rel="shortcut icon">
  29. <link href="/assets/style.css" rel="stylesheet" type="text/css">
  30. </head>
  31. <body>
  32. <div class="outer">
  33. <div class="middle">
  34. <div>
  35. <?php echo $result; ?>
  36. </div><br>
  37. <div class="inner">
  38. <div class="card centered text-center">
  39. <div class="card-header">
  40. <div class="card-title h5">
  41. cloudflare-dns-creator
  42. </div>
  43. <div class="card-subtitle text-gray">
  44. Create your free <!-- might enter your domain name here --> domain now!
  45. </div>
  46. </div>
  47. <div class="card-body">
  48. <form action="index.php" method="post">
  49. <div class="input-group">
  50. <input class="form-input input-lg" name="name" pattern="^[a-zA-Z0-9]+$" placeholder="Hostname" required="" type="text"> <span class="input-group-addon addon-lg">.mcpe.ga</span>
  51. </div><br>
  52. <div class="input-group">
  53. <input class="form-input input-lg" name="value" placeholder="IPv4 Address or Domain Name" required="" type="text">
  54. </div><br>
  55. <div class="form-group">
  56. <label class="form-label">Please choose the type of record</label> <label class="form-radio"><input checked name="record" required="" type="radio" value="a"> <i class="form-icon"></i> IPv4 Address (A)</label> <label class="form-radio"><input name="record" required="" type="radio" value="cname"> <i class="form-icon"></i> Domain Name (CNAME)</label>
  57. </div>
  58. </form>
  59. </div><br>
  60. <div class="card-footer">
  61. <div class="btn-group" role="group">
  62. <button class="btn btn-primary" type="submit">Let's create that!</button>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </body>
  70. </html>
  71. <!-- Script downloaded from https://github.com/reckr/cloudflare-dns-creator (c) 2018 -->