<?php
if(isset($_POST['websiteUrl'])) {
    $url = $_POST['websiteUrl'];
    
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    $status = ($httpCode === 200) ? "Online" : "Offline";
    echo $status;
}
?>
