1234567891011121314 |
- <?php
- if(isset($_POST['type']) && $_POST['type']==="addNewIp")
- {
- $prevJson = json_decode(file_get_contents("db.json"));
- $newIp = new stdClass();
- $newIp->name = $_POST['name'];
- $newIp->schedule = $_POST['schedule'];
- $newIp->status = "off";
- $prevJson->{$_POST['ip']} = $newIp;
- file_put_contents("db.json",json_encode($prevJson));
- echo "did it";
- }
- ?>
|