-
Notifications
You must be signed in to change notification settings - Fork 0
/
help.php
executable file
·229 lines (225 loc) · 18.4 KB
/
help.php
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<?php
/**
* My IPv4 or IPv6 REST Services API
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Chronolabs Cooperative http://syd.au.snails.email
* @license ACADEMIC APL 2 (https://sourceforge.net/u/chronolabscoop/wiki/Academic%20Public%20License%2C%20version%202.0/)
* @license GNU GPL 3 (http://www.gnu.org/licenses/gpl.html)
* @package myip-api
* @since 1.0.1
* @author Dr. Simon Antony Roberts <[email protected]>
* @version 1.0.7
* @description A REST Services API that returns either or both or all IPv4, IPv6 addresses of a caller!
* @link http://internetfounder.wordblockquotess.com
* @link https://github.com/Chronolabs-Cooperative/MyIP-API-PHP
* @link https://sourceforge.net/p/chronolabs-cooperative
* @link https://facebook.com/ChronolabsCoop
* @link https://twitter.com/ChronolabsCoop
*
*/
$ip = getIP(true);
$netbios = getNetbios();
$ipv4 = getHostByNamel($netbios);
$ipv6 = getHostByNamel6($netbios, false);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta property="og:title" content="<?php echo API_VERSION; ?>"/>
<meta property="og:type" content="api<?php echo API_TYPE; ?>"/>
<meta property="og:image" content="<?php echo API_URL; ?>/assets/images/logo_500x500.png"/>
<meta property="og:url" content="<?php echo (isset($_SERVER["HTTPS"])?"https://":"http://").$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; ?>" />
<meta property="og:site_name" content="<?php echo API_VERSION; ?> - <?php echo API_LICENSE_COMPANY; ?>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="rating" content="general" />
<meta http-equiv="author" content="[email protected]" />
<meta http-equiv="copyright" content="<?php echo API_LICENSE_COMPANY; ?> © <?php echo date("Y"); ?>" />
<meta http-equiv="generator" content="Chronolabs Cooperative (<?php echo $place['iso3']; ?>)" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo API_VERSION; ?> || <?php echo API_LICENSE_COMPANY; ?></title>
<!-- AddThis Smart Layers BEGIN -->
<!-- Go to http://www.addthis.com/get/smart-layers to customize -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50f9a1c208996c1d"></script>
<script type="text/javascript">
addthis.layers({
'theme' : 'transparent',
'share' : {
'position' : 'right',
'numPreferredServices' : 6
},
'follow' : {
'services' : [
{'service': 'facebook', 'id': 'ChronolabsCoop'},
{'service': 'twitter', 'id': 'ChronolabsCoop'},
{'service': 'twitter', 'id': 'OpenRend'},
{'service': 'twitter', 'id': 'SimonXaies'},
{'service': 'facebook', 'id': 'mynamesnot'},
]
},
'whatsnext' : {},
'recommended' : {
'title': 'Recommended for you:'
}
});
</script>
<!-- AddThis Smart Layers END -->
<link rel="stylesheet" href="<?php echo API_URL; ?>/assets/css/style.css" type="text/css" />
<!-- Custom Fonts -->
<link href="<?php echo API_URL; ?>/assets/media/Labtop/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Labtop Bold/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Labtop Bold Italic/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Labtop Italic/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Labtop Superwide Boldish/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Labtop Thin/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Labtop Unicase/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/LHF Matthews Thin/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Life BT Bold/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Life BT Bold Italic/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Prestige Elite/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Prestige Elite Bold/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo API_URL; ?>/assets/media/Prestige Elite Normal/style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="<?php echo API_URL; ?>/assets/css/gradients.php" type="text/css" />
<link rel="stylesheet" href="<?php echo API_URL; ?>/assets/css/shadowing.php" type="text/css" />
</head>
<body>
<div class="main">
<img style="float: right; margin: 11px; width: auto; height: auto; clear: none;" src="<?php echo API_URL; ?>/assets/images/logo_350x350.png" />
<h1><?php echo API_VERSION; ?> -- <?php echo API_LICENSE_COMPANY; ?></h1>
<p>This is an API REST Service returns your caller or all reference to AAAA + A Records IPv4 or IPv6 addresses from the source caller in JSON, XML, Serialisation, HTML and RAW outputs.</p>
<h2>You current calling details are as follows:</h2>
<blockquote>
<table width="100%">
<tr>
<td class="help-title-text" style="width: auto; text-align: right; font-size: 1.2343em; margin-right: 29px; vertical-align: top; text-align: right;">Remote Calling <?php echo (validateIPv4($ip)?"IPv4":"IPv6"); ?>: </td>
<td class="help-url-example" style="width: auto; text-align: center; font-weight: bold; font-size: 1.1123em; text-align: left; vertical-align: middle;"><?php echo $ip; ?></td>
</tr>
<?php if ($netbios != $ip) { ?>
<tr>
<td class="help-title-text" style="width: auto; text-align: right; font-size: 1.2343em; margin-right: 29px; vertical-align: top; text-align: right;">Remote Calling NetBIOS: </td>
<td class="help-url-example" style="width: auto; text-align: center; font-weight: bold; font-size: 1.1123em; text-align: left; vertical-align: middle;"><?php echo $netbios; ?></td>
</tr>
<?php } ?>
<?php if (count($ipv4) > 0) { ?>
<tr>
<td class="help-title-text" style="width: auto; text-align: right; font-size: 1.2343em; margin-right: 29px; vertical-align: top; text-align: right;">All DNS IPv4 for NetBIOS: </td>
<td class="help-url-example" style="width: auto; text-align: center; font-weight: bold; font-size: 1.1123em; text-align: left; vertical-align: middle;"><?php foreach($ipv4 as $id => $addy) { echo $addy . (($id<count($ipv4)-1)?'<br/>':''); } ?></td>
</tr>
<?php } ?>
<?php if (count($ipv6) > 0) { ?>
<tr>
<td class="help-title-text" style="width: auto; text-align: right; font-size: 1.2343em; margin-right: 29px; vertical-align: top; text-align: right;">All DNS IPv6 for NetBIOS: </td>
<td class="help-url-example" style="width: auto; text-align: center; font-weight: bold; font-size: 1.1123em; text-align: left; vertical-align: middle;"><?php foreach($ipv6 as $id => $addy) { echo $addy . (($id<count($ipv6)-1)?'<br/>':''); } ?></td>
</tr>
<?php } ?>
</table>
</blockquote>
<h2>Code API Documentation</h2>
<p>You can find the phpDocumentor code API documentation at the following path :: <a href="<?php echo API_URL . '/'; ?>docs/" target="_blank"><?php echo API_URL . '/'; ?>docs/</a>. These should outline the source code core functions and classes for the API to function!</p>
<h2>PHP Document Output</h2>
<p>This is done with the <em>*.php</em> extension at the end of the url, there is only static calls to this REST API for the IPv4 or IPv6 address to be returned.</p>
<blockquote>
<font class="help-title-text">This will return the IPv4 or IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myip.php" target="_blank"><?php echo API_URL . '/'; ?>v1/myip.php</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 + IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/allmyip.php" target="_blank"><?php echo API_URL . '/'; ?>v1/allmyip.php</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv4.php" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv4.php</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv6.php" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv6.php</a></font><br /><br />
</blockquote>
<h3 class="help-title-text">Example on how to call in PHP to return your result from the API is as follows:~</h3>
<blockquote class="help-url-example">
<?php echo str_replace("\n", "<br />", htmlspecialchars(sprintf(file_get_contents(__DIR__ . DS . 'include' . DS . 'data' . DS . 'example.php.txt'), API_URL))); ?>
</blockquote>
<h2>HTML Document Output</h2>
<p>This is done with the <em>*.html</em> extension at the end of the url, there is only static calls to this REST API for the IPv4 or IPv6 address to be returned.</p>
<blockquote>
<font class="help-title-text">This will return the IPv4 or IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myip.html" target="_blank"><?php echo API_URL . '/'; ?>v1/myip.html</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 + IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/allmyip.html" target="_blank"><?php echo API_URL . '/'; ?>v1/allmyip.html</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv4.html" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv4.html</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv6.html" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv6.html</a></font><br /><br />
</blockquote>
<h3 class="help-title-text">Example on how to call in PHP to return your result from the API is as follows:~</h3>
<blockquote class="help-url-example">
<?php echo str_replace("\n", "<br />", htmlspecialchars(sprintf(file_get_contents(__DIR__ . DS . 'include' . DS . 'data' . DS . 'example.html.txt'), API_URL))); ?>
</blockquote>
<h2>TEXT Document Output</h2>
<p>This is done with the <em>*.txt</em> extension at the end of the url, there is only static calls to this REST API for the IPv4 or IPv6 address to be returned.</p>
<blockquote>
<font class="help-title-text">This will return the IPv4 or IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myip.txt" target="_blank"><?php echo API_URL . '/'; ?>v1/myip.txt</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 + IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/allmyip.txt" target="_blank"><?php echo API_URL . '/'; ?>v1/allmyip.txt</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv4.txt" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv4.txt</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv6.txt" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv6.txt</a></font><br /><br />
</blockquote>
<h3 class="help-title-text">Example on how to call in PHP to return your result from the API is as follows:~</h3>
<blockquote class="help-url-example">
<?php echo str_replace("\n", "<br />", htmlspecialchars(sprintf(file_get_contents(__DIR__ . DS . 'include' . DS . 'data' . DS . 'example.txt.txt'), API_URL))); ?>
</blockquote>
<h2>Serialisation Document Output</h2>
<p>This is done with the <em>*.serial</em> extension at the end of the url, there is only static calls to this REST API for the IPv4 or IPv6 address to be returned.</p>
<blockquote>
<font class="help-title-text">This will return the IPv4 or IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myip.serial" target="_blank"><?php echo API_URL . '/'; ?>v1/myip.serial</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 + IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/allmyip.serial" target="_blank"><?php echo API_URL . '/'; ?>v1/allmyip.serial</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv4.serial" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv4.serial</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv6.serial" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv6.serial</a></font><br /><br />
</blockquote>
<h3 class="help-title-text">Example on how to call in PHP to return your result from the API is as follows:~</h3>
<blockquote class="help-url-example">
<?php echo str_replace("\n", "<br />", htmlspecialchars(sprintf(file_get_contents(__DIR__ . DS . 'include' . DS . 'data' . DS . 'example.serial.txt'), API_URL))); ?>
</blockquote>
<h2>JSON Document Output</h2>
<p>This is done with the <em>*.json</em> extension at the end of the url, there is only static calls to this REST API for the IPv4 or IPv6 address to be returned.</p>
<blockquote>
<font class="help-title-text">This will return the IPv4 or IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myip.json" target="_blank"><?php echo API_URL . '/'; ?>v1/myip.json</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 + IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/allmyip.json" target="_blank"><?php echo API_URL . '/'; ?>v1/allmyip.json</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv4.json" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv4.json</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv6.json" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv6.json</a></font><br /><br />
</blockquote>
<h3 class="help-title-text">Example on how to call in PHP to return your result from the API is as follows:~</h3>
<blockquote class="help-url-example">
<?php echo str_replace("\n", "<br />", htmlspecialchars(sprintf(file_get_contents(__DIR__ . DS . 'include' . DS . 'data' . DS . 'example.json.txt'), API_URL))); ?>
</blockquote>
<h2>XML Document Output</h2>
<p>This is done with the <em>*.xml</em> extension at the end of the url, there is only static calls to this REST API for the IPv4 or IPv6 address to be returned.</p>
<blockquote>
<font class="help-title-text">This will return the IPv4 or IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myip.xml" target="_blank"><?php echo API_URL . '/'; ?>v1/myip.xml</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 + IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/allmyip.xml" target="_blank"><?php echo API_URL . '/'; ?>v1/allmyip.xml</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv4 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv4.xml" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv4.xml</a></font><br /><br />
<font class="help-title-text">This will return all the DNS IPv6 of the caller to the API</font><br/>
<font class="help-url-example"><a href="<?php echo API_URL . '/'; ?>v1/myipv6.xml" target="_blank"><?php echo API_URL . '/'; ?>v1/myipv6.xml</a></font><br /><br />
</blockquote>
<h3 class="help-title-text">Example on how to call in PHP to return your result from the API is as follows:~</h3>
<blockquote class="help-url-example">
<?php echo str_replace("\n", "<br />", htmlspecialchars(sprintf(file_get_contents(__DIR__ . DS . 'include' . DS . 'data' . DS . 'example.xml.txt'), API_URL))); ?>
</blockquote>
<h2 style="margin-top: 33px;">The Author</h2>
<p>This was developed by Dr. Simon Antony Roberts in 2018 and is part of the Chronolabs Cooperative API REST Services + Systems.<br/><br/>This is open source which you can download from <a href="https://github.com/Chronolabs-Cooperative/MyIP-API-PHP">https://github.com/Chronolabs-Cooperative/MyIP-API-PHP</a> contact the scribe <a href="mailto:[email protected]">[email protected]</a></p></body>
</div>
</html>
<?php