diff options
| author | root | 2015-04-01 23:53:58 +0200 |
|---|---|---|
| committer | root | 2015-04-01 23:53:58 +0200 |
| commit | a31396fb8c67f27a0055e4c4a6fa95e3cde24d1a (patch) | |
| tree | 8e5f72013ffe1fda6ab64514a79943f83d841e51 /ip/template.php | |
| parent | 6ec371bff3d3eda0c535fe773c292f66bd746a7a (diff) | |
| download | tools.iamfabulous.de-a31396fb8c67f27a0055e4c4a6fa95e3cde24d1a.tar.gz | |
Small improvements.
Diffstat (limited to 'ip/template.php')
| -rw-r--r-- | ip/template.php | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/ip/template.php b/ip/template.php new file mode 100644 index 0000000..50e9b74 --- /dev/null +++ b/ip/template.php @@ -0,0 +1,132 @@ +<!doctype html> +<html> +<head> + <meta charset="utf-8"> + <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> + <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> + <style> + <?php echo file_get_contents("../tools/style.css"); ?> + </style> + <noscript><style>.navbar{margin-bottom:0;}</style></noscript> + <title>IP API</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel='shortcut icon' href='../tools/favicon.ico' type='image/x-icon'> +</head> +<body> + <?php require("../tools/navbar.php"); ?> +<div class="container"> + <div class="text-center"> + <div class="row"> + <h1>Ifconfig</h1> + <h3>Basic IP API/Look up.</h3> + <hr> + <?php if( isset($geoip) ){ + ?> + + <h3 class="text-left"><strong>IP API</strong></h3> + <dl class="dl-horizontal"> + <?php + foreach($geoip as $key => $value){ + echo "<dt>".str_replace('_', ' ', ucfirst($key))."</dt><dd class='text-left'>".$value."</dd>"; + } + ?> + </dl> + <?php + } + if ( isset($header) ){ + ?> + <h3 class="text-left"><strong>HTTP Header</strong></h3> + <dl class="dl-horizontal"> + <?php + foreach($header as $key => $value){ + echo "<dt>".$key."</dt><dd class='text-left'>".$value."</dd>"; + } + ?> + </dl> + <?php + } + ?> + + <form class="form-horizontal"> + <fieldset> + + <!-- Form Name --> + <legend></legend> + + <!-- Text input--> + <div class="form-group"> + <label class="col-md-4 control-label" for="input">IP/Domain</label> + <div class="col-md-4"> + <input id="input" name="ip" placeholder="Look up a host based on IP or FQDN." class="form-control input-md" type="text"> + <!--span class="help-block text-left">Look up a host based on IP or FQDN.</span--> + </div> + </div> + + + <div class="text-left"> + <div class="form-group"> + <label class="col-md-4 control-label" for="geoip">Show GeoIP Data</label> + <div class="col-md-4"> + <input id="geoip" name="geoip" value="1" type="checkbox" checked> + </div> + </div> + </div> + + <div class="text-left"> + <div class="form-group"> + <label class="col-md-4 control-label" for="requestheader">Show Request Header</label> + <div class="col-md-4"> + <input id="requestheader" name="header" value="1" type="checkbox" checked> + </div> + </div> + </div> + +<div class="text-center"> +<!-- Multiple Radios (inline) --> +<div class="form-group text-left"> + <label class="col-md-4 control-label" for="output"></label> + <!--label class="col-md-4" for="output">Output Format</label--> + <div class="col-md-4"> + <label class="radio-inline" for="output-0"> + <input name="output" id="output-0" value="html" checked="checked" type="radio"> + HTML + </label> + <label class="radio-inline" for="output-1"> + <input name="output" id="output-1" value="json" type="radio"> + JSON + </label> + <label class="radio-inline" for="output-2"> + <input name="output" id="output-2" value="php" type="radio"> + PHP (serialized) + </label> +<span class="help-block text-left">Choose output format.</span> + </div> +</div> +</div> + + <!-- Button --> + <div class="form-group"> + <label class="col-md-4 control-label" for=""></label> + <div class="col-md-4"> + <button id="" name="" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span> Look Up</button> + </div> + </div> + + <!--input type="hidden" name="output" value="html"--> + + </fieldset> + </form> + <hr> + + <h4>Command Line Interface: </h4> + <!--p class="">Command Line Interface: <code>$ curl http://tools.iamfabulous.de/ifconfig/</code></p--> + Get IP: <code>$ curl http://tools.iamfabulous.de/ifconfig/</code> => <?php echo $_SERVER['REMOTE_ADDR']; ?><br> + JSON: <code>$ curl http://tools.iamfabulous.de/ifconfig/?output=json</code><br> + Get everything: <code>$ curl http://tools.iamfabulous.de/ifconfig/?geoip=1&header=1&output=json</code> + <!--p class="">JSON: <code>$ curl http://tools.iamfabulous.de/ifconfig/&geoip=1&header=1&output=json</code></p--> + + </div> + </div> +</div> + + <?php require("../tools/footer.php"); ?> |
