View file includes/modules/out.php

File size: 651B
<?php
$id = isset( $_GET['id'] ) ? (int) $_GET['id'] : 0;

if( !$sql->query("SELECT * FROM `" . CATALOGUE_SITES . "` WHERE `id` = " . $id . ";") )
{
	put_error(DBMS_ERROR, htmlspecialchars($sql->error['message']), __LINE__, __FILE__);
}

if( $sql->num_rows() < 1 )
{
	redirect( gen_uri('index', '', '', '', false) );
}

$site = $sql->fetch_assoc();

if( !$sql->query("UPDATE `" . CATALOGUE_SITES . "` SET `out_today` = `out_today` + 1, `out` = `out` + 1 WHERE `id` = " . $id . ";") )
{
	put_error(DBMS_ERROR, htmlspecialchars($sql->error['message']), __LINE__, __FILE__);
}

redirect('http://' . $site['site'] . $site['path']);
?>