dimanche 17 juillet 2016

How to display different

I currently have the following code I have mashed from other stack overflow answers but it doesn't work and no code after it loads either.

    <?php function checkOnline($domain) {
   $curlInit = curl_init($domain);
   curl_setopt($curlInit,CURLOPT_CONNECTTIMEOUT,10);
   curl_setopt($curlInit,CURLOPT_HEADER,true);
   curl_setopt($curlInit,CURLOPT_NOBODY,true);
   curl_setopt($curlInit,CURLOPT_RETURNTRANSFER,true);

   //get answer
   $response = curl_exec($curlInit);

   curl_close($curlInit);
   if ($response) return true;
   return false;
}
if(checkOnline('http://ift.tt/2a1oQeQ')) { ?>
<div id="LLup"><marquee behavior="scroll" direction="left"><strong>LEARNLINK IS CURRENTLY ONLINE</strong></marquee></div>
<?php ;} else { ?>
<div id="LLdown"><marquee behavior="scroll" direction="left"><strong>LEARNLINK IS CURRENTLY OFFLINE</strong></marquee></div>

<?php } ?>

Am I retarded or what because the code looks good to me.

Aucun commentaire:

Enregistrer un commentaire