<?php
session_start();
ini_set('display_errors', 'On');
//ob_start("ob_gzhandler");
error_reporting(E_ALL);
// database connection config
$dbHost = 'localhost';
$dbUser = 'root';
$dbPass = '1234';
$dbName = 'sql';
$email = "[email protected]";
ini_set("memory_limit","20M");
// setting up the web root and server root for
// this shopping cart application
$weburl = "http://www.XXXXX.net"; //บรรทัดนี้ คืออะไรครับ ???????????????????
$thisFile = str_replace('\\', '/', __FILE__);
$docRoot = $_SERVER['DOCUMENT_ROOT'];
$webRoot = str_replace(array($docRoot, 'library/config.php'), '', $thisFile);
$srvRoot = str_replace('library/config.php', '', $thisFile);
define('WEB_ROOT', $webRoot);
define('SRV_ROOT', $srvRoot);
// these are the directories where we will store all
// category and product images
define('CATEGORY_IMAGE_DIR', 'imgs/cat/');
define('PRODUCT_IMAGE_DIR', 'imgs/cat2/');
define('BANNER_IMAGE_DIR', 'imgs/banner/');
define('ACTIVITY_IMAGE_DIR', 'imgs/productspost/');
define('ACTIVITY_FILE_DIR', 'imgs/Activity/');
define('PERSON_IMAGE_DIR', 'imgs/Person/');
// some size limitation for the category
// and product images
// all category image width must not
// exceed 75 pixels
define('MAX_Activity_IMAGE_WIDTH', 90);
define('MAX_PERSON_IMAGE_WIDTH', 90);
// do we need to limit the product image width?
// setting this value to 'true' is recommended
define('LIMIT_PRODUCT_WIDTH', true);
// maximum width for all product image
define('MAX_PRODUCT_IMAGE_WIDTH', 600);
define('MAX_SLIDE_IMAGE_WIDTH', 720);
define('THUMBNAIL_WIDTH_BAN', 140);
// maximum width for all product image
define('LIMIT_BANNER_WIDTH', true);
define('MAX_BANNER_IMAGE_WIDTH', 120);
define('THUMBNAIL_BANNER_WIDTH', 120);
// the width for product thumbnail
define('THUMBNAIL_WIDTH', 100);
define('THUMBNAIL_ACTIVITY_WIDTH', 100);
if (!get_magic_quotes_gpc()) {
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));
}
}
}
// 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
require_once 'database.php';
require_once 'common.php';
// get the shop configuration ( name, addres, etc ), all page need it
//$shopConfig = getShopConfig();
function get_customer_reviews($isbn)
{
$link = "http://astore.amazon.co.uk/32.lcd.tv-21/detail/".$isbn; //บรรทัดนี้ด้วย ??????
$xfile = fopen($link,"r");
// link from internet
while(!feof($xfile)){
$char = fread($xfile,5000);
$txt .= $char;
}
$xtx = str_replace('"','',$txt);
$x = str_replace("'","",$xtx);
$start = '<div id=customerReviews>';
$txtarr = explode($start,$x);
$content = explode('</div>',
$txtarr[1]);
echo $content[0];
}
?>