Tracking Pixel Code

function getAllInfos(url) {
    url += "?ver=1";
    url += "&url=" + escape(location.href);
    url += "&ref=" + escape(document.referrer);
    url += "&ua=" + escape(navigator.userAgent);
    url += "&reso=" + escape(screen.width + "x" + screen.height);
    url += "&greu=" + escape(document.body.clientWidth + "x" + document.body.clientHeight);
    url += "&rand=" + escape(Math.random());
    return url;
document.writeln("<img style=\"position:absolute;top:0px;\" src=\""+getAllInfos("")+"\">");

Find out if a domain name exists

You can user CURL to request a page and evaluate the response to determine if the page exists.

function verify_domain($domain='') {
	$url = "http://" . $domain;
	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_NOBODY, true);
	$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	if($code &gt;= 400) {
		return false;
	return true;

htaccess: set and use environment variables inside your htaccess

A while ago I learned how to set a variable in my .htaccess that can later on be user in PHP:



Something that I could not figure out was how to use the defined variable inside the htaccess. While searching for CORS implementation, I ran across this post on

There there is the answer to my question, how to set and get an environment variable in htaccess:

SetEnvIf Origin "^(.*\.example\.com)$" ORIGIN_SUB_DOMAIN=$1
<FilesMatch "\.woff$">
    Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN

htaccess: allow access control from subdomains

When having an application running on the top domain of your site you may want to allow subdomains to make ajax requests to the top domain. If that is the case, and if you do not know which subdomain will be making the request, you should consider adding the following rule to you .htaccess file in your top domain:

?View Code APACHE
SetEnvIf Origin "^(.*\.(appcropolis|simplifysites|localhost.+)\.com)$" ORIGIN_SUB_DOMAIN=$1
Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN