How can i do this

2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 6, 2014   (RSS)

By KCMedia - October 5, 2014

Hi

i have this code that checks if i website is alive or not i need this for some google functions for google tag manager but how can i put the url inside the current php code.

This is the code that checks the url is alive how can i place this inside the $url = <?php echo htmlencode($record['url']) ?>

<?php
$url = 'THIS IS WHRE THE URL GOES';
$array = get_headers($url);
$string = $array[0];
if(strpos($string,"200")) {
    echo '<span style="color:#7cdefe; font-weight: bold">Active</span>';
} else {
    echo '<span style="color:#ff0000; font-weight: bold">Not Active</span>';
}
?>

Thanks



Craig

KC Media Solutions

www.kcmedia.biz