ב הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותشسdggרות הל555ה התafhgfh
במסgרות ה gh//شی הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותהתנדaghhhhו12ין יעל, המעציfghfghfע
/
www-data
/
newsitesimages
/
bhopal
/
x
/
Upload FileeE
HOME
<?php // Multi Domain Live Checker (HTTPS with HTTP fallback) // Usage: open in browser, paste domains (one per line), submit // API: POST domains (text) or ?format=json to get JSON output ini_set('display_errors', '0'); error_reporting(0); function normalize_domain(string $raw): string { $domain = trim($raw); $domain = preg_replace('/^[^\w]+|[^\w.-]+$/', '', $domain ?? ''); // Remove scheme if present $domain = preg_replace('#^https?://#i', '', $domain); // Remove path $domain = explode('/', $domain, 2)[0]; return strtolower($domain); } function build_url(string $domain, string $scheme = 'https'): string { return $scheme . '://' . $domain . '/'; } function resolve_ip(string $host): string { $host = trim($host); if ($host === '') return ''; // Try IPv4 first via gethostbyname $ip = @gethostbyname($host); if ($ip && $ip !== $host && filter_var($ip, FILTER_VALIDATE_IP)) return $ip; // Try DNS A records if (function_exists('dns_get_record')) { $recordsA = @dns_get_record($host, DNS_A); if (is_array($recordsA)) { foreach ($recordsA as $rec) { if (!empty($rec['ip']) && filter_var($rec['ip'], FILTER_VALIDATE_IP)) return $rec['ip']; } } // Try IPv6 if available if (defined('DNS_AAAA')) { $recordsAAAA = @dns_get_record($host, DNS_AAAA); if (is_array($recordsAAAA)) { foreach ($recordsAAAA as $rec) { if (!empty($rec['ipv6']) && filter_var($rec['ipv6'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) return $rec['ipv6']; } } } } return ''; } function http_probe(string $url, int $timeoutSec = 6): array { $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_NOBODY => true, // HEAD first (faster) CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLOPT_CONNECTTIMEOUT => min(3, $timeoutSec), CURLOPT_TIMEOUT => $timeoutSec, CURLOPT_RETURNTRANSFER => true, CURLOPT_USERAGENT => 'DomainChecker/1.0 (+https://example) PHP/' . PHP_VERSION, CURLOPT_SSL_VERIFYPEER => false, // We only care about reachability CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_HEADER => true, ]); $start = microtime(true); $res = curl_exec($ch); $totalTime = (int) round((microtime(true) - $start) * 1000); $curlErrNo = curl_errno($ch); $curlErr = $curlErrNo ? curl_error($ch) : ''; $httpCode = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $effectiveUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); $primaryIp = curl_getinfo($ch, CURLINFO_PRIMARY_IP); // Some servers block HEAD; try a lightweight GET if HEAD failed without HTTP code if ($curlErrNo !== 0 || $httpCode === 0) { curl_setopt_array($ch, [ CURLOPT_NOBODY => false, CURLOPT_RANGE => '0-0', // fetch 1st byte only ]); $start = microtime(true); $res = curl_exec($ch); $totalTime = (int) round((microtime(true) - $start) * 1000); $curlErrNo = curl_errno($ch); $curlErr = $curlErrNo ? curl_error($ch) : ''; $httpCode = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $effectiveUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); $primaryIp = curl_getinfo($ch, CURLINFO_PRIMARY_IP); } curl_close($ch); return [ 'url' => $url, 'effective_url' => $effectiveUrl ?: $url, 'http_code' => $httpCode, 'ip' => $primaryIp ?: '', 'ok' => ($httpCode >= 200 && $httpCode < 400), 'time_ms' => $totalTime, 'error' => $curlErr, ]; } function check_one_domain(string $rawDomain, int $timeout): array { $domain = normalize_domain($rawDomain); if ($domain === '') { return [ 'input' => $rawDomain, 'domain' => '', 'status' => 'invalid', 'ok' => false, 'details' => 'Empty/invalid domain', ]; } // Try HTTPS first $httpsUrl = build_url($domain, 'https'); $r1 = http_probe($httpsUrl, $timeout); if ($r1['ok']) { $host = parse_url($r1['effective_url'] ?: $httpsUrl, PHP_URL_HOST) ?: $domain; $ip = $r1['ip'] ?: resolve_ip($host); return [ 'input' => $rawDomain, 'domain' => $domain, 'status' => 'up', 'ok' => true, 'scheme' => 'https', 'http_code' => $r1['http_code'], 'time_ms' => $r1['time_ms'], 'ip' => $ip, 'url' => $r1['effective_url'], ]; } // Fallback to HTTP $httpUrl = build_url($domain, 'http'); $r2 = http_probe($httpUrl, $timeout); if ($r2['ok']) { $host = parse_url($r2['effective_url'] ?: $httpUrl, PHP_URL_HOST) ?: $domain; $ip = $r2['ip'] ?: resolve_ip($host); return [ 'input' => $rawDomain, 'domain' => $domain, 'status' => 'up', 'ok' => true, 'scheme' => 'http', 'http_code' => $r2['http_code'], 'time_ms' => $r2['time_ms'], 'ip' => $ip, 'url' => $r2['effective_url'], ]; } // Down or errors $details = trim(($r1['error'] ?: '') . ' ' . ($r2['error'] ?: '')); $code = $r1['http_code'] ?: $r2['http_code'] ?: 0; $fallbackIp = resolve_ip($domain); return [ 'input' => $rawDomain, 'domain' => $domain, 'status' => 'down', 'ok' => false, 'http_code' => $code, 'time_ms' => max($r1['time_ms'] ?? 0, $r2['time_ms'] ?? 0), 'ip' => $r1['ip'] ?: $r2['ip'] ?: $fallbackIp, 'url' => $r1['effective_url'] ?: $r2['effective_url'] ?: build_url($domain), 'details' => $details, ]; } function render_html(array $results, string $domainsRaw, int $timeout): void { $total = count($results); $up = count(array_filter($results, fn($r) => !empty($r['ok']))); $down = $total - $up; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Multi Domain Checker</title> <style> body{font-family: Arial, sans-serif; background:#0f172a; color:#e5e7eb; margin:0} .container{max-width:1100px; margin:0 auto; padding:24px} .card{background:#111827; border:1px solid #1f2937; border-radius:10px; padding:16px} textarea{width:100%; min-height:160px; background:#0b1220; color:#e5e7eb; border:1px solid #1f2937; border-radius:8px; padding:10px} input,button,select{background:#1f2937; color:#e5e7eb; border:1px solid #374151; border-radius:8px; padding:8px 10px} button{cursor:pointer} table{width:100%; border-collapse:collapse;} th,td{padding:10px; border-bottom:1px solid #1f2937; text-align:left; font-size:14px} th{color:#9ca3af; text-transform:uppercase; font-size:12px} .ok{color:#34d399; font-weight:bold} .bad{color:#f87171; font-weight:bold} .muted{color:#9ca3af} .row:hover{background:#0b1220} .grid{display:grid; grid-template-columns:1fr auto auto; gap:12px; align-items:center} .stats{display:flex; gap:16px; margin:10px 0} .chip{background:#0b1220; border:1px solid #1f2937; padding:6px 10px; border-radius:20px} </style> </head> <body> <div class="container"> <h1>Multi Domain Checker</h1> <div class="card" style="margin-top:12px;"> <form method="post"> <div class="grid"> <label> <div class="muted">Domains (one per line)</div> <textarea name="domains" placeholder="example.com\nexample.org\nhttps://example.net"><?php echo htmlspecialchars($domainsRaw); ?></textarea> </label> <label> <div class="muted">Timeout (s)</div> <input type="number" name="timeout" min="2" max="30" step="1" value="<?php echo (int)$timeout; ?>"> </label> <div style="align-self:end;"> <button type="submit">Check</button> </div> </div> </form> <?php if ($total > 0): ?> <div class="stats"> <div class="chip">Total: <?php echo $total; ?></div> <div class="chip ok">Up: <?php echo $up; ?></div> <div class="chip bad">Down: <?php echo $down; ?></div> </div> <div style="overflow:auto;"> <table> <thead> <tr> <th>#</th> <th>Domain</th> <th>Status</th> <th>HTTP</th> <th>Time</th> <th>IP</th> <th>URL</th> <th>Details</th> </tr> </thead> <tbody> <?php $i=1; foreach ($results as $r): ?> <tr class="row"> <td><?php echo $i++; ?></td> <td><?php echo htmlspecialchars($r['domain'] ?: $r['input']); ?></td> <td><?php echo !empty($r['ok']) ? '<span class="ok">UP</span>' : '<span class="bad">DOWN</span>'; ?></td> <td><?php echo isset($r['http_code']) ? (int)$r['http_code'] : '-'; ?></td> <td><?php echo isset($r['time_ms']) ? (int)$r['time_ms'] . ' ms' : '-'; ?></td> <td><?php echo htmlspecialchars($r['ip'] ?? ''); ?></td> <td> <?php if (!empty($r['url'])): ?> <a href="<?php echo htmlspecialchars($r['url']); ?>" target="_blank" rel="noopener noreferrer"><?php echo htmlspecialchars($r['url']); ?></a> <?php else: ?> - <?php endif; ?> </td> <td class="muted" title="<?php echo htmlspecialchars($r['details'] ?? ''); ?>"><?php echo htmlspecialchars(($r['details'] ?? '') !== '' ? ($r['details']) : '-'); ?></td> </tr> <?php endforeach; ?> </tbody> </table> </div> <?php endif; ?> </div> </div> </body> </html> <?php } // Controller $domainsRaw = isset($_POST['domains']) ? (string)$_POST['domains'] : ''; $timeout = isset($_POST['timeout']) ? max(2, min(30, (int)$_POST['timeout'])) : 6; $wantJson = isset($_GET['format']) && strtolower($_GET['format']) === 'json'; $results = []; if ($domainsRaw !== '') { $lines = preg_split('/\r?\n/', $domainsRaw); $seen = []; foreach ($lines as $line) { if (trim($line) === '') continue; $norm = normalize_domain($line); if ($norm === '' || isset($seen[$norm])) { // keep original for display if invalid if ($norm === '') { $results[] = [ 'input' => $line, 'domain' => '', 'status' => 'invalid', 'ok' => false, 'details' => 'Empty/invalid domain', ]; } continue; } $seen[$norm] = true; $results[] = check_one_domain($line, $timeout); } } if ($wantJson) { header('Content-Type: application/json'); echo json_encode([ 'count' => count($results), 'results' => $results, ]); exit; } render_html($results, $domainsRaw, $timeout);