Example #1
0
  $Id: redirect.php,v 1.10 2003/06/05 23:31:31 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
require 'includes/application_top.php';
switch ($HTTP_GET_VARS['action']) {
    case 'banner':
        $banner_query = tep_db_query("select banners_url from " . TABLE_BANNERS . " where banners_id = '" . (int) $HTTP_GET_VARS['goto'] . "'");
        if (tep_db_num_rows($banner_query)) {
            $banner = tep_db_fetch_array($banner_query);
            tep_update_banner_click_count($HTTP_GET_VARS['goto']);
            tep_redirect($banner['banners_url']);
        }
        break;
    case 'url':
        if (isset($HTTP_GET_VARS['goto']) && tep_not_null($HTTP_GET_VARS['goto'])) {
            $check_query = tep_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_url = '" . tep_db_input($HTTP_GET_VARS['goto']) . "' limit 1");
            if (tep_db_num_rows($check_query)) {
                tep_redirect('http://' . $HTTP_GET_VARS['goto']);
            }
        }
        break;
    case 'manufacturer':
        if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
            $manufacturer_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int) $HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int) $languages_id . "'");
            if (tep_db_num_rows($manufacturer_query)) {
Example #2
0
/**
 * osCommerce Online Merchant
 *
 * @copyright (c) 2016 osCommerce; https://www.oscommerce.com
 * @license MIT; https://www.oscommerce.com/license/mit.txt
 */
use OSC\OM\HTML;
use OSC\OM\HTTP;
use OSC\OM\OSCOM;
require 'includes/application_top.php';
switch ($_GET['action']) {
    case 'banner':
        $Qbanner = $OSCOM_Db->get('banners', 'banners_url', ['banners_id' => $_GET['goto']]);
        if ($Qbanner->fetch() !== false) {
            tep_update_banner_click_count($_GET['goto']);
            HTTP::redirect($Qbanner->value('banners_url'));
        }
        break;
    case 'url':
        if (isset($_GET['goto']) && tep_not_null($_GET['goto'])) {
            $Qcheck = $OSCOM_Db->get('products_description', 'products_url', ['products_url' => HTML::sanitize($_GET['goto'])], null, 1);
            if ($Qcheck->fetch() !== false) {
                HTTP::redirect('http://' . $Qcheck->value('products_url'));
            }
        }
        break;
    case 'manufacturer':
        if (isset($_GET['manufacturers_id']) && is_numeric($_GET['manufacturers_id'])) {
            $Qmanufacturer = $OSCOM_Db->get('manufacturers_info', 'manufacturers_url', ['manufacturers_id' => $_GET['manufacturers_id'], 'languages_id' => $OSCOM_Language->getId()]);
            if ($Qmanufacturer->fetch() !== false) {