ini_set('display_errors', 'On');// start the session
error_reporting(E_ALL);
session_start();
// database connection config
$dbHost = 'yoongda';
$dbUser = '
yoongd
';
$dbPass = 'xxxxxx';
$dbName = '
yoongd
a';
// setting up the web root and server root for this shopping cart application
$thisFile = str_replace('\', '/', __FILE__);
$docRoot = $_SERVER['DOCUMENT_ROOT'];
$webRoot = str_replace(array($docRoot, 'library/config.php'), '', $thisFile);// these are the directories where I will store all category and product images
$srvRoot = str_replace('library/config.php', '', $thisFile);
define('WEB_ROOT', $webRoot);
define('SRV_ROOT', $srvRoot);
define('CATEGORY_IMAGE_DIR', 'images/category/');// some size limitation for the category and product images all category image width must not exceed 75 pixels
define('PRODUCT_IMAGE_DIR', 'images/product/');
define('MAX_CATEGORY_IMAGE_WIDTH', 75);// Setting up value of product image width to 'true'
define('LIMIT_PRODUCT_WIDTH', true);// maximum width for all product image
define('MAX_PRODUCT_IMAGE_WIDTH', 300);// the width for product thumbnail
define('THUMBNAIL_WIDTH', 75);
if (!get_magic_quotes_gpc()) {// since all page will require a database access and the common library is also used by all it's logical to load these library here
if (isset($_POST)) {
foreach ($_POST as $key => $value) {
$_POST[$key] = trim(addslashes($value));
}
}
if (isset($_GET)) {
foreach ($_GET as $key => $value) {
$_GET[$key] = trim(addslashes($value));
}
}
}
require_once 'database.php';// get the shop configuration ( name, addres, etc ), all page need it
require_once 'common.php';
$shopConfig = getShopConfig();However, An error occurs when my application connect to my hosting database.
I post my question on forum for an advise.
and this is some replies that help me shot out the problem.
so that means I should use the address on my hosting instead of yoongda in
to// database connection config
$dbHost = 'yoongda';
$dbUser = 'yoongd
';
$dbPass = 'xxxxxx';
$dbName = 'yoongd
a';
$dbHost = 'yoongda.db.xxxxxx.hostedresource.com';and connection is done successfully.
$dbUser = 'yoongda';
$dbPass = 'xxxxxx';
$dbName = 'yoongda';
No comments:
Post a Comment