Location: PHPKode > projects > Jarida > jarida_1.0/link.php
<?php

//Initialization....

require_once('./include/config.php');
require_once('./include/common.php');



switch ($db_type)
{
 case 'mysql':
   require_once('./classes/class.db.cnx.mysql.php');
   $db = new dbCnxMysql($db_host, $db_user, $db_pass, $db_name);
   break;
 case 'sqlite':
   require_once('./classes/class.db.cnx.sqlite.php');
   $db_file = "./include/" . $db_file;
   $db = new dbCnxSqlite($db_file);
   break;
}


//Initialize the Database
if(!$db->initialize())
{
  echo $db->getError();
}

require_once('./classes/Entry.php');
require_once('./classes/Link.php');

$link = new Link($db, $_GET['id']);

if($link)
{
  $query = "UPDATE tblLink SET link_visits = link_visits + 1
              WHERE link_id = " . $link->getId();

  $result = $db->doQuery($query);

  $redirect_url = $link->getUrl();

  header("Location: $redirect_url");
}


?>
Return current item: Jarida