|
if this helps then here it is:
Product.php
<?php
require_once("_functions.php");
if (isset($_GET['print']))
echo showTemplate("{$config['template']}/print.html");
else
echo showTemplate("{$config['template']}/index.html");
?>
_functions.php
<?php
##############################################
## cpCommerce by Matthew Wilkin ##
## ╘ Copyright 2002. All Rights Reserved. ##
##############################################
## Do Not Edit Beyond This Point ##
##############################################
// Start MySQL and Sessions
session_start();
// PHP Settings
@error_reporting(E_ALL ^ E_NOTICE);
@ini_set("register_globals",0);
## Protect prefix vulnerability
if (strpos($_SERVER['PHP_SELF'],"_functions.php") !== false)
header("Location: http://{$_SERVER['HTTP_HOST']}");
if (!isset($prefix) || isset($_REQUEST['prefix'])) $prefix = "";
## Include Configuration Files
require_once("{$prefix}_config.php");
require_once("{$prefix}_gateways.php");
require_once("{$prefix}{$config['up2date_language']}");
// Session Values
if (!isset($_SESSION['cpID'])) $_SESSION['cpID'] = "guest";
if (!isset($_SESSION['cpEmail'])) $_SESSION['cpEmail'] = "";
if (!isset($_SESSION['cpPass'])) $_SESSION['cpPass'] = "";
if (!isset($_SESSION['cpItems'])) $_SESSION['cpItems'] = "";
if (!isset($_SESSION['cpQuantity'])) $_SESSION['cpQuantity'] = "";
if (!isset($_SESSION['cpPaymentInfo'])) $_SESSION['cpPaymentInfo'] = array();
if (!isset($_SESSION['cpLanguage'])) $_SESSION['cpLanguage'] = "{$config['language']}";
if (!isset($_SESSION['cpTemplate'])) $_SESSION['cpTemplate'] = "{$config['template']}";
if ($_SESSION['cpID'] == "") $_SESSION['cpID'] = "guest";
mysql_connect($config['host'],$config['user'],$config['pass']);
mysql_select_db($config['database']);
// On Page load functions
require_once("functions/onloads.func.php");
## Include Other Files
require_once("{$prefix}_variables.php");
require_once("{$prefix}_emails.php");
// Addon Function Files
// Older PHP Versions
if (phpversion() < "4.0.6" && isset($HTTP_POST_VARS))
$_POST = ($HTTP_POST_VARS);
if (phpversion() < "4.0.6" && isset($HTTP_GET_VARS))
$_GET = ($HTTP_GET_VARS);
if (phpversion() < "4.0.6" && isset($HTTP_COOKIE_VARS))
$_COOKIE = ($HTTP_COOKIE_VARS);
if (phpversion() < "4.0.6" && isset($HTTP_SERVER_VARS))
$_SERVER = ($HTTP_SERVER_VARS);
if (phpversion() < "4.0.6" && isset($HTTP_POST_FILES))
$_FILES = ($HTTP_POST_FILES);
if (phpversion() < "4.0.6" && isset($HTTP_SESSION_VARS))
$_SESSION = ($HTTP_SESSION_VARS);
// Needed Variables
$config['error'] = "";
$product = "";
$productinfo = "";
$category = "";
$categoryinfo = "";
$manufacturer = "";
$manufacturerinfo = "";
// Required Functions
require_once("functions/methods.func.php");
require_once("functions/currenc.func.php");
require_once("functions/templat.func.php");
require_once("functions/metatag.func.php");
require_once("functions/account.func.php");
require_once("functions/shpcart.func.php");
require_once("functions/subcats.func.php");
// Do Actions
if (isset($_GET['action'])) $_POST['action'] = $_GET['action'];
if (isset($_POST['submit']) || isset($_POST['action']))
if (isset($_POST['action']) && file_exists("actions/{$_POST['action']}.act.php"))
require_once("actions/{$_POST['action']}.act.php");
// Logout
if (isset($_GET['logout'])) {
checkSession("","");
header("Location: {$config['siteaddress']}{$config['maindir']}".substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],"/")+1));
}
// Redirect if necessary
if (isset($_POST['action'])) {
if (isset($_POST['m']))
header("Location: {$config['siteaddress']}{$config['maindir']}" . substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],"/")+1) .
"?m={$_POST['m']}");
else
header("Location: {$config['siteaddress']}{$config['maindir']}".substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],"/")+1));
}
?>
|