-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathip4.php
94 lines (90 loc) · 3.23 KB
/
ip4.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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
if(isset ($_POST['rno']) && !empty($_POST['rno']))
{
$rno = $_POST['rno'];
if($rno>100)
{
$rnolast=$rno%100;
}
else{
$rnolast=$rno;
}
$rnostart=($rno-$rnolast)/100;
if(($rno>=1 && $rno<=91)||($rno>=101 && $rno<=191)||($rno>=201 && $rno<=291)) //ground floor
{
if($rnolast>=1 && $rnolast<=12)
{
$gate=40;
}
else if($rnolast>=13 && $rnolast<=23){
$gate=100;
}
else if($rnolast>=24 && $rnolast<=37){
$gate=100;
}
else if($rnolast>=38 && $rnolast<=47){
$gate=70;
}
else if($rnolast>=48 && $rnolast<=61){
$gate=160;
}
else if($rnolast>=62 && $rnolast<=69){
$gate=130;
}
else if($rnolast>=70 && $rnolast<=83){
$gate=230;
}
else if($rnolast>=84 && $rnolast<=91){
$gate=200;
}
$r=$gate+$rnostart;
$s=$r+10;
?> <p style="font-size:25px; line-height: 10px;"><b>IP</b>
<?php
echo ': 10.2.'."$r".'.'."$rnolast".' or '.'10.2.'."$s".'.'."$rnolast".'<br>';?></p>
<p style="font-size:25px;"><b>Gateway</b>
<?php
echo ': 10.2.'."$gate".'.250'.'<br>'; ?></p>
<p style="font-size:25px;"><b> Subnet mask</b>
: 255.255.224.0
</p>
<img src="images/prefixlength.jpg" alt="Use prefix length = 19" style="max-width:400px">
<p style="font-size:25px;"><b> DNS Server</b>
: 10.200.1.11 / 10.200.11.1
</p>
<hr>
<?php
}
else
{
echo 'Please put the room no. b/w 1 to 91, 101 to 191 & 201 to 291';
}
}
?>
<h2 style="font-size:30px;"> Hostel 2 IP Address Allocation.</h2>
<h4 style="font-size:24px;"><i>Write Your Room No. b/w 1 to 91, 101 to 191 & 201 to 291 to get your IP Address.</i></h4>
<form name="ip" method="post" action="ip4.php" >
<table >
<tr>
<td >
<p style="font-size:20px;"> Room No. </p>
</td>
<td>
<input type="text" name="rno" style="font-size:20px;">
</td>
</tr>
<tr>
<td>
<input type="submit" value="Get ip" style="font-size:20px;"">
</td>
</tr>
</table>
</form>
</body>
</html>