Location: PHPKode > scripts > Sitemap Creator > get_sitemap.php
	Sitemap Creator 0.1, a php script that creates Sitemap 0.90 aka google,yahoo and msn sitemaps for your site
	It can be downloaded from http://walid.kurtubba.com/
	License: GPL

	Walid GadElKarim, hide@address.com

	Opens gzipped sitemap with the right headers
	also sends email to webmaster 
$smap = $_GET['sitemap'];
$smap = preg_replace('#^.*/([^/]*)$#', '$1', $smap);
$smap = 'files/'.$smap;
if($settings['sendemails'] && preg_match("#(msnbot|Lycos_Spider|eMiragorobot|Slurp|Ask Jeeves|WebCrawler|Scooter|Google)#si", $_SERVER['HTTP_USER_AGENT']))
	mail($settings['email'], 'Sitemap crawled on '.date(" h:i:s a ( l d  of  F Y )"), $_SERVER['HTTP_USER_AGENT'].' has viewed your '.$smap.' on '.date(" h:i:s a ( l d  of  F Y )")."\nUsing ip http://whois.domaintools.com/".$_SERVER['REMOTE_ADDR'], 'From:'.$settings['email']);
	@header('Content-Length: '.filesize($smap));
	@header('Content-type: text/xml; charset=UTF-8');
	@header("Expires: " . gmdate("D, d M Y H:i:s",time()+(60*60*24)) . " GMT");
	@header('Content-Encoding: gzip' );
	$pf = @fopen( $smap, 'rb' );
	while (!@feof($pf)) {
	   $buffer = @fread($pf, 1000000);
	   echo $buffer;

	@Header ("HTTP/1.1 404 Not Found");
	@header("Status: 404 Not Found");
	echo 'Sitemap file not found';
	if($settings['sendemails']) mail($settings['email'], 'Sitemap not found', $_SERVER['HTTP_USER_AGENT'].' could not find '.$smap.' on '.date(" h:i:s a ( l d  of  F Y )")."\nUsing with ip http://whois.domaintools.com/".$_SERVER['REMOTE_ADDR'], 'From:'.$settings['email']);
Return current item: Sitemap Creator