Database error:
SQLSTATE[HY000] [2002] No such file or directory ' . curl_errno($ch) . ': ' . curl_error($ch); }else{ $result = urldecode($result); } curl_close($ch); return array ($result, $httpCode, $valid_url); } function br2nl($string) { return preg_replace('/\/i', "\n", $string); } function removemultibr($string) { return preg_replace("/(\s*)+/", "
", $string); } function get_meta_data($content) { $split_content = array(); $content = strtolower($content); $content = preg_replace("']*>.*'siU",'',$content); // strip js $content = preg_replace("']*>.*'siU",'',$content); // strip css $split = explode("\n",$content); foreach ($split as $k => $v) { if (strpos(' '.$v,']+(http\-equiv|name)=\"([^\"]*)\"[^>]" . "+content=\"([^\"]*)\"[^>]*>/i", $v, $split_content[],PREG_PATTERN_ORDER);; } } return $split_content; } function getlinks($contents){ //$url $original_file = $contents;//file_get_contents($url); $stripped_file = strip_tags($original_file, ""); preg_match_all("/]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is", $stripped_file, $matches); //DEBUGGING //$matches[0] now contains the complete A tags; ex: text //$matches[1] now contains only the HREFs in the A tags; ex: link return $matches; } function get_domain($url) { $pieces = parse_url($url); $domain = isset($pieces['host']) ? $pieces['host'] : ''; if (preg_match('/(?P[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) { return $regs['domain']; } return false; } // Get search engine function function getSearchEngine($url = false) { if(!$url && !$url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false) { return ''; } $refer = parse_url($url); $host = $refer['host']; if(strstr($host,'google')){ return 'Google'; }elseif(strstr($host,'yahoo')){ return 'Yahoo'; }elseif(strstr($host,'msn')){ return 'MSN'; }elseif(strstr($host,'bing')){ return 'BING'; } } // Get keywords function getKeywords($url = false) { if(!$url && !$url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false) { return ''; } $parts_url = parse_url($url); $query = isset($parts_url['query']) ? $parts_url['query'] : (isset($parts_url['fragment']) ? $parts_url['fragment'] : ''); if(!$query) { return ''; } parse_str($query, $parts_query); return isset($parts_query['q']) ? $parts_query['q'] : (isset($parts_query['p']) ? $parts_query['p'] : ''); } // check browser function check_browser() { $browsers = "mozilla msie gecko firefox "; $browsers.= "konqueror safari netscape navigator "; $browsers.= "opera mosaic lynx amaya omniweb"; $browsers = split(" ", $browsers); $userAgent = strtolower( $_SERVER['HTTP_USER_AGENT']); $l = strlen($userAgent); for ($i=0; $i<=count($browsers); $i++) { $browser = $browsers[$i]; $n = stristr($userAgent, $browser); if(strlen($n)>0) { $version = ""; $navigator = $browser; $j=strpos($userAgent, $navigator)+$n+strlen($navigator)+1; for (; $j<=$l; $j++) { $s = substr ($userAgent, $j, 1); if(is_numeric($version.$s) ) $version .= $s; else break; } } } if (strpos($userAgent, 'linux')) { $platform = 'linux'; } else if (strpos($userAgent, 'macintosh') || strpos($userAgent, 'mac platform x')) { $platform = 'mac'; } else if (strpos($userAgent, 'windows') || strpos($userAgent, 'win32')) { $platform = 'windows'; } return array( "browser" => $navigator, "version" => $version, "platform" => $platform, "userAgent" => $userAgent); } ?>