-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathadddomain.php
More file actions
24 lines (19 loc) · 1.02 KB
/
Copy pathadddomain.php
File metadata and controls
24 lines (19 loc) · 1.02 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
<?php
require_once 'header.inc.php';
$token=trim(escapeshellarg($_REQUEST["txtToken"])," '");
$acctnum=trim(escapeshellarg($_REQUEST["txtAcct"])," '");
$name=trim(escapeshellarg($_REQUEST["txtName"])," '");
$TTL=trim(escapeshellarg($_REQUEST["txtTTL"])," '");
$email=trim(escapeshellarg($_REQUEST["txtEMail"])," '");
$comment=trim(escapeshellarg($_REQUEST["txtComment"])," '");
$resp=shell_exec('curl -X POST -i -k -d \'{"domains":[{"name":"'.$name.'","emailAddress":"'.$email.'"'.(empty($TTL)?'':', "ttl":'.$TTL).(empty($comment)?'':', "comment":"'.$comment.'"').'}]}\' -H "X-Auth-Token: '.$token.'" -H "Content-Type: application/json" https://dns.api.rackspacecloud.com/v1.0/'.$acctnum.'/domains 2>&1');
?>
<p>Add domain request submitted</p>
<button name="btnBack" type="reset" onClick="history.go(-1);">Back</button>
<?php
//debugging output
echo "<hr/>Raw response:<br/>";
echo "<div style=\"border: 1px solid #000; height: 9em; overflow: auto; margin: 0.5em;\">";
echo nl2br($resp);
echo "</div>";
require_once 'footer.inc.php';