Slip 17 - A) Write a PHP Script to display Server information in table format (Use $_SERVER).

 Solution:

<html>
<body>
<table border="1">
<tr>
<th>PHP_SELF</th>
<th>SERVER_NAME</th>
<th>HTTP_HOST</th>
<th>SCRIPT_NAME</th>
</tr>
<tr>
<?php
echo "<td>" .$_SERVER['PHP_SELF'] ."</td>";
echo "<td>" .$_SERVER['SERVER_NAME'] ."</td>";
echo "<td>" .$_SERVER['HTTP_HOST'] ."</td>";
echo "<td>".$_SERVER['SCRIPT_NAME']."</td>";
echo $_SERVER['HTTP_REFERER'];
echo "<br>";
echo $_SERVER['HTTP_USER_AGENT'];
echo "<br>";

?>
</tr>
</table>
</body>
</html>

Post a Comment

0 Comments