-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathip.php
More file actions
31 lines (29 loc) · 731 Bytes
/
ip.php
File metadata and controls
31 lines (29 loc) · 731 Bytes
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
<?php
include 'header.php';
if(isset($_POST['sub']))
{
$ip=` sudo ifconfig | grep 'inet addr:'`;
$who=`sudo who`;
}
?>
<center>
<div class="container">
<div class="jumbotron">
<form action="ip.php" method="post">
<p><button class="btn btn-primary btn-lg" role="button" name="sub" value="ip">Know your IP!</button>
<button class="btn btn-primary btn-lg" role="button" name="sub" value="who">Check WHO!!</button></p></form>
<?php
$sub=$_POST['sub'];
if($sub=="ip"){
echo '<label class="alert alert-primary"><pre>'.$ip.'</pre></label>';
}
if($sub=="who")
{
echo '<label class="alert alert-primary"><pre>'.$who.'</pre></label>';
}
?>
</div>
</div>
</center>
</body>
</html>