Jump to content

Disable Webpages Using MYSQL and PHP


winmastergames

Recommended Posts

function webPageActive($url)
{
    $checkingState = @mysql_fetch_array(@mysql_query("select * from `table_of_urls` where `url`='$url'"))
    
    if($checkingState['site_active'] != 'TRUE')
        {
            exit("Sorry, this website is innactive at the moment");
        }
}

function selfURL() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; } function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }





put this at the top of the pages to be checked:    webPageActive(selfURL());

 

Just edit the sql and you should be right... pm me if you have any problems.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.