summaryrefslogtreecommitdiff
path: root/ip/template.php
blob: 50e9b740345b09bdc8182bf4db6df3b40cbfcfa5 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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&amp;header=1&amp;output=json</code>
			<!--p class="">JSON: <code>$ curl http://tools.iamfabulous.de/ifconfig/&amp;geoip=1&amp;header=1&amp;output=json</code></p-->

		</div>
	</div>
</div>
	
	<?php require("../tools/footer.php"); ?>