-
Notifications
You must be signed in to change notification settings - Fork 0
/
_index.php
140 lines (112 loc) · 5.22 KB
/
_index.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
<?php
$version="";
$server_name="";
$server_port="";
if (getenv('HOME') == ''){ // Not set when running as service
$root= substr($_SERVER["DOCUMENT_ROOT"],0,-4); // this alternative with limitations
} // gets path to folder UniServerZ
else{ // Set when run as standard program
$root= getenv('HOME'); // this is the ideal method to
} // get the path to folder UniServerZ
$file="$root\home\us_config\us_config.ini" ; // Name and path of configuration file
if (file_exists($file) && is_readable($file)){ // Check file
$settings=parse_ini_file($file,true); // parse file into an array
$version=$settings["APP"]["AppVersion"]; // get parameter
}
$file="$root\home\us_config\us_user.ini" ; // Name and path of user configuration file
if (file_exists($file) && is_readable($file)){ // Check file
$settings=parse_ini_file($file,true); // parse file into an array
$server_name=$settings["USER"]["US_SERVERNAME"]; // get parameter
$server_port=$settings["USER"]["AP_PORT"]; // get parameter
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Uniform Server ZeroXV - test page</title>
<meta name="Description" content="The Uniform Server ZeroXV" />
<meta name="Keywords" content="The Uniform Server, MPG, Mike Gleaves, Ric, UniServer, Olajide, BobS, SudeepJD, BrainStorm, sbourdon " />
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
</head>
<style type="text/css">
/*****************************************/
.intro{
margin-top:10px;
margin-bottom:10px;
padding:3px;
font-size:11px;
font-family:Verdana;
background-color: #E7E7FD;
border-top:1px solid #4f4f97;
border-bottom:1px solid #4f4f97;
}
/*****************************************/
</style>
<body>
<div id="wrap">
<div id="header">
<a href="https://www.uniformserver.com"><img src="images/logo.png" align="left" alt="The Uniform Server Zero" /></a>
<div id="header_txt" >
<div style="position:absolute;">
ZeroXV <?php print "- ".$version; ?> </p>
</div>
</div>
</div>
<div id="content">
<h1>Welcome to The Uniform Server</h1>
<p class="intro">This test page <b>index.php</b> was served from root folder UniServerZ\<b>www</b>
<span style='display:<?php print("none")?>'><br /> If no PHP module is installed, Apache returns php directives un-processed.</span>
</p>
<div align="center" >
<img src="images/padlock2.gif" alt="Padlock" />
</div>
<p class="intro"><b><i>Note</i>:</b> Please read manual page: <a href="/us_docs/manual/quick_start_guide.html#Installing your Website or Test pages">Installing your Website or Test pages</a>.</p>
<!-- splash page link -->
<!-- <?php print("--" . ">");?>
<table>
<tr>
<td>
<h2>Server links</h2>
<p> <a href="http://<?php echo($server_name.':'.$server_port) ?>/us_splash/index.php" target="_blank" >Splash page</a> - Displays server specification and useful links.</p>
<p> <a href="http://<?php echo($server_name.':'.$server_port) ?>/us_opt1/index.php" target="_blank" >PhpMyAdmin</a>.</p>
<p> <a href="http://<?php echo($server_name.':'.$server_port) ?>/us_extra/phpinfo.php" target="_blank" >PHP Info</a>.</p>
</td>
</tr>
</table>
<?php print("<"."!"."--")?> -->
<!-- subdirs -->
<!-- <?php print("--" . ">");?>
<table>
<tr><td><h2>Served Subdirectories</h2></td></tr>
</table>
<table width=100%>
<?php $n = 0; foreach (scandir("./") as $file){
if (is_dir($file) && !in_array($file, array(".", "..", "css", "images"))){
$n++;
echo ($n % 3 ? (($n+1) % 3 ? "<tr><td width=33%>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td>" : "<td width=33%>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td>") : "<td>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td></tr>");
}
}
echo ($n == 0 ? "<tr><td style='color: red;' colspan='3'>None</td></tr>" : ($n % 2 == 0 ? "" : "<td></td></tr>"));?>
</table>
<?php print("<"."!"."--")?> -->
<!-- php files -->
<!-- <?php print("--" . ">");?>
<table>
<tr><td><h2>Served PHP Files</h2></td></tr>
</table>
<table width=100%>
<?php $n = 0; foreach (scandir("./") as $file){
if (strtolower(strrchr($file, '.'))==".php" && $file!="index.php"){
$n++;
echo ($n % 3 ? (($n+1) % 3 ? "<tr><td width=33%>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td>" : "<td width=33%>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td>") : "<td>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td></tr>");
}
}
echo ($n == 0 ? "<tr><td style='color: red;' colspan='3'>None</td></tr>" : ($n % 2 == 0 ? "" : "<td></td></tr>"));?>
</table>
<?php print("<"."!"."--")?> -->
<div id="divider">Developed By <a href="https://www.uniformserver.com/">The Uniform Server Development Team</a></div>
</div>
</div>
</body>
</html>