<?
include ('./mysql_connect.php');
$debug = false;
/////////////// START DOMAIN CAPTURE BLOCK ////////////////
$domainz = substr($_SERVER['HTTP_HOST'], strpos($_SERVER['HTTP_HOST'], '.')+1);
if (strlen($domainz) <= 6) {
$domainz = $_SERVER['HTTP_HOST'];
if($debug == true) { echo '<p>var $domainz - Length: ' . strlen($domainz) . ' - Value: ' . $domainz . ' - Sub Domain: No</p>'; }
} else {
$domainz = substr($_SERVER['HTTP_HOST'], strpos($_SERVER['HTTP_HOST'], '.')+1);
if($debug == true){ echo '<p>var $domainz - Length: ' . strlen($domainz) . ' - Value: ' . $domainz . ' - Sub Domain: Yes</p>'; }
}
//////////////// END DOMAIN CAPTURE BLOCK /////////////////
/////////////// START DOMAIN DEFAULT BLOCK ////////////////
// add a catch all default.
//$domainz = "Holding Page"; //set this to whatever you want as your <h1></h1> tag on the page and update the below sql.
//INSERT INTO `seldoms` (`id`, `domain`, `title`, `description`, `price`, `added`)
//VALUES (NULL, 'Holding Page', 'Default Holding Page', 'Sales Jagon', 'Mid £XXX', NOW());
$queryt = "SELECT domain FROM seldoms WHERE domain = '$domainz' LIMIT 1";
$resultt = mysql_query($queryt);
$count = mysql_num_rows($resultt);
if($count == 0) {
$domainz = "Holding Page"; //update this to match.
if($debug == true){ echo '<p>var $domainz - Length: ' . strlen($domainz) . ' - Value: ' . $domainz . ' - Database: False <br> Query: ' . $queryt . '</p>'; }
}
//////////////// END DOMAIN DEFAULT BLOCK /////////////////
/////////////// STATS BLOCK START ////////////////
//CREATE TABLE `modsanc_seldom`.`stats` (
//`id` INT NOT NULL AUTO_INCREMENT ,
//`url` VARCHAR( 70 ) NOT NULL ,
//`referer` VARCHAR( 256 ) NOT NULL ,
//`client` VARCHAR( 512 ) NOT NULL ,
//`added` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
//PRIMARY KEY ( `id` ) ,
//INDEX ( `id` )
//) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci
$debugstat = 0;
$ref = mysql_real_escape_string($_SERVER['HTTP_REFERER']);
$cli = mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']);
$ips = mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
$query2 = "INSERT INTO `stats` (`id`, `ip`, `url`, `referer`, `client`, `added`) VALUES (NULL, '$ips', '$domainz', '$ref', '$cli', NOW());";
$result = mysql_query($query2);
if ($debugstat==1) { //debug
echo "Query Result: <pre>$result</pre><br />
Query Sumitted: <pre>$query2</pre>";
if($result != "1") {
$error = mysql_errno().": ".mysql_error();
echo "Error Code: ID:10T<br />
Error Description: <pre>$error</pre>\n";
} else {
echo "Stat Point has been added.<br>";
}
}//end debug
/////////////// STATS BLOCK END ////////////////
$query = "SELECT id, domain, title, description, price, date_format(added, '%d/%m/%Y \@ %h:%i %p') AS adds FROM seldoms WHERE domain = '$domainz' LIMIT 1";
$doms = mysql_query($query) or die("Select Failed!");
while ($row = mysql_fetch_array($doms)) {
?>
We use essential cookies to make this site work, and optional cookies to enhance your experience.