This commit is contained in:
2024-02-02 17:51:48 -07:00
parent a0d32ba8fe
commit 61421c7294
6 changed files with 241 additions and 16 deletions

View File

@@ -52,17 +52,22 @@ function getDnsServersInfo() {
$dnsServers = getDnsServersInfo();
// Function to check server status
// Modified checkServerStatus function
function checkServerStatus($server) {
$port = 53; // DNS port, change if necessary
$timeout = 10; // Timeout in seconds
$timeout = 30; // Timeout in seconds
// Debug: Output the server being checked
# echo "Checking status of server: $server<br>";
$fp = @fsockopen($server, $port, $errno, $errstr, $timeout);
if ($fp) {
fclose($fp);
# echo "Server $server is Online<br>"; // Debug: Server is online
return "Online";
} else {
# echo "Server $server is Offline - Error: $errstr ($errno)<br>"; // Debug: Server is offline
return "Offline";
}
}
@@ -79,12 +84,15 @@ function checkServerStatus($server) {
<header>
<nav>
<?php if (!isset($_SESSION['username'])): ?>
<a href="/?page=main">Home</a> |
<a href="/?page=login">Login</a> |
<a href="/?page=register">Register</a>
<a href="/?page=register">Register</a> |
<a href="/?page=whois">WHOIS</a>
<?php else: ?>
<a href="/?page=main">Home</a> |
<a href="/?page=user_domains">My Account</a> |
<a href="/?page=domain_register">Register Domain</a> |
<a href="/?page=whois">WHOIS</a> |
<a href="/?page=main&action=logout">Logout</a><br><br>
<span>Welcome, <?php echo htmlspecialchars($_SESSION['username']); ?></span>
<?php endif; ?>