Forum Moderators: coopster
http://www.example.com/stats/request.php?tag=site
using file_get_contents where "stats" is a stripped out version of the website's URL. So, I created this:
<?php
$statsdomain = $_SERVER['HTTP_HOST'];
$statsdomainlink = str_replace("www.", "", $statsdomain);
$statsdomainlink = str_replace(".", "_", $statsdomainlink);
$file = file_get_contents ('http://www.example.com/stats/request.php?tag=.'$statsdomainlink');
Echo $file;
?>
where am I going wrong?
Any help would be appreciated.
Thanks
Mike
<?php
$filename = $_SERVER['HTTP_HOST'];
$filename = str_replace("www.", "gggg", $filename);
$filename = str_replace(".", "_", $filename);
$filename = str_replace("gggg", "http://www.example.com/stats/request.php?tag=", $filename);
$file = file_get_contents ($filename);
Echo $file;
?>