hello there, if want to take the title from website.com with function get or curl, on his statics to show mywebsite.com (referer) how many times my website take the title from website.com to show referer mywebsite.com can someone tell me how i can make this, thanks
Do you mean you want to have a counter of how many times someone clicked a link on website.com to mywebsite.com? If so, try this (not tested); $referrer = $_POST['referrer']; if ($referrer == 'website.com'){ // do some mysql update here. } PHP: I'm to lazy to do the MySQL part myself, refer to w3schools ( http://www.w3schools.com/PHP/php_mysql_update.asp )to learn how to work with MySQL.
<?php //the site you want to grab the title from... $url = "http://website.com"; $referer = "http://mywebsite.com"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_AUTOREFERER, false); curl_setopt($curl, CURLOPT_REFERER, $referer); curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2'); $output = curl_exec($curl); preg_match('~<title>(.+?)</title>~is', $output, $a); $title = $a[1]; echo $title; ?> PHP: