Created
June 3, 2014 19:37
-
-
Save wmantly/791ff30b27bfde9dc581 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//ip.json | |
{ | |
"192.168.2.1" : { | |
"pass" : true | |
}, | |
"0.0.0.0" : { | |
"pass" : true | |
}, | |
"300.2.3333" : { | |
"pass" : false | |
}, | |
"300.2.333.3" : { | |
"pass" : false | |
} | |
} | |
//makeJSON.php | |
<html> | |
<head> | |
<title>JSON Test Maker</title> | |
</head> | |
<body> | |
<?php | |
$json_data = file_get_contents('ip.json'); | |
$array = json_decode($json_data, true); | |
echo "<form method='post'>"; | |
foreach ($array as $key => $value) { | |
?> | |
<label>Value</label><br /> | |
<input type="text" value="<?=$key?>" /><br /> | |
<label>Valid</label> | |
<input type="checkbox" name="valid" value="true" <?=$value['pass'] ? 'checked' : ''?> /><br /> | |
<label>Comments</label><br /> | |
<textarea><?=$value['comment']?></textarea><br /> | |
<hr /> | |
<?php | |
} | |
?> | |
<input type="submit" /> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment