-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeleteRecord.php
More file actions
55 lines (51 loc) · 2.06 KB
/
deleteRecord.php
File metadata and controls
55 lines (51 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require "helpers.php";
if (
isset($_POST['data']) && isset($_POST['recordType']) && isset($_POST['subdomain']) && isset($_POST['ttl']) &&
isset($_POST['aux']) && intval($_POST['ttl'] >= 0) && intval($_POST['aux'] >= 0)
) {
$opts = array(
'http' => array(
'method' => "GET",
'header' => "x-api-key: $apikey\r\n"
)
);
$context = stream_context_create($opts);
$data = urlencode($_POST['data']);
$recordType = urlencode($_POST['recordType']);
$subdomain = urlencode($_POST['subdomain']);
$ttl = urlencode($_POST['ttl']);
$aux = urlencode($_POST['aux']);
$response = file_get_contents("$apiAddress/deleteRecord.php?data=$data&recordType=$recordType&" .
"subdomain=$subdomain&ttl=$ttl&aux=$aux", false, $context);
if ($response == "success") {
header("Location: ./index.php?success");
die();
} else {
header("Location: ./index.php?fail");
die();
}
}
HeaderMenu();
?>
<div class="tab-content">
<div class="header">
<h2>DNS yönetim sistemi - Kayıt Sil</h2>
</div>
<div class="content">
<h2>BU İŞLEM SEÇİLEN KAYDI(<?php echo $_GET['subdomain'] . " " . $_GET['recordType'] . " " . $_GET['data'] ?>)
TAMAMEN
SİLECEKTİR.
ONAYLIYOR MUSUNUZ?</h2>
<form action="./deleteRecord.php" method="POST">
<div class="form-group">
<input type="hidden" id="data" name="data" value="<?php echo htmlspecialchars($_GET['data']); ?>" />
<input type="hidden" id="recordType" name="recordType" value="<?php echo $_GET['recordType']; ?>" />
<input type="hidden" id="subdomain" name="subdomain" value="<?php echo $_GET['subdomain'] ?>" />
<input type="hidden" id="ttl" name="ttl" value="<?php echo $_GET['ttl']; ?>" />
<input type="hidden" id="aux" name="aux" value="<?php echo $_GET['aux']; ?>" />
</div>
<button type="submit" class="btn btn-primary">Kaydı Sil</button>
</form>
</div>
</div>