function base64url_encode(string $bin): string { return rtrim(strtr(base64_encode($bin), '+/', '-_'), '='); } function fw_click_sign_string_product(int $productID, string $table, int $ts): string { return "v1|product|{$productID}|{$table}|{$ts}"; } function fw_make_sig(string $signingString): string { return base64url_encode(hash_hmac('sha256', $signingString, FW_CLICK_SECRET, true)); } // GET PRODUCT FROM DATABASE /*if ($_GET['merchantName'] == "wayfair") { header("Location: https://furnishwell.co.uk/$_GET[mainCat]/$_GET[subCat]/$_GET[subCatTwo]/?redirect=wayfair", true, 301); exit(); } if ($_GET['merchantName'] == "habitat") { header("Location: https://furnishwell.co.uk/$_GET[mainCat]/$_GET[subCat]/$_GET[subCatTwo]/?redirect=habitat", true, 301); exit(); }*/ $table = test_input(strtolower(str_replace("-", "", $_GET['mainCat']))); $prodTitle = test_input(strip_tags(ucwords(str_replace("-", " ", $_GET['title'])))); if ($prodTitle == $_GET['title'] && $_GET['merchantName'] == "bensons-for-beds") { // FUCKED UP IN 301 BELOW WHERE title WAS LEFT AS IN DB AND NOT LOWERCASED!!! header("Location: https://furnishwell.co.uk/$_GET[mainCat]/$_GET[subCat]/$_GET[subCatTwo]/$_GET[merchantName]/$prodTitle/", true, 301); exit(); } // NEED TO CHECK MERCHANT AS WELL BECAUSE MORE THAN ONE MERCHANT WITH SAME PRODUCT NAMES $getmerchantname = test_input(strip_tags(ucwords(str_replace("-", " ", $_GET['merchantName'])))); // TO ADD NEW PAGES FOR QUERIES LIKE "gold round mirrors" CAN NOT USE htaccess // SO HAVE HAD TO USE Q AS MERCHANTNAME BECAUSE OF URL STRUCTURE // SO IF merchantName == q INCLUDE THE NEW KEYWORDS PAGE if ($getmerchantname == "Q") { $subCatThree = $prodTitle; include("cat-list-keywords-v5.php"); exit(); } $merchantnamesql = $conn->prepare("SELECT * FROM merchants WHERE merchantName = ? LIMIT 1"); $merchantnamesql->bind_param("s", $getmerchantname); $merchantnamesql->execute(); $merchantnameresult = $merchantnamesql->get_result(); $merchantnamerow = $merchantnameresult->fetch_assoc(); $merchantnameID = $merchantnamerow['merchantID']; $merchantDelivery = $merchantnamerow['delivery']; $merchantFinance = $merchantnamerow['finance']; $merchantWarranty = $merchantnamerow['warranty']; $merchantpriceMatch = $merchantnamerow['priceMatch']; $productlocsql = $conn->prepare("SELECT productID, prodtable FROM productlocs WHERE title = ? AND merchantID = '$merchantnameID' LIMIT 1"); $productlocsql->bind_param("s", $prodTitle); $productlocsql->execute(); $productlocresult = $productlocsql->get_result() or die ('Unable to execute query. '.$productsql.''. mysqli_error($conn)); $rowloc = $productlocresult->fetch_assoc(); $subCatGet = strip_tags(ucwords(str_replace("-", " ", $_GET['subCat']))); $productsql = $conn->prepare("SELECT productID, discountID, merchantID, mainCat, subCat, subCatTwo, title, longDesc, price, salePrice, img1, material, construction, manuf, affUrl, viewCount, deeplink FROM $table WHERE title = ? LIMIT 1"); $productsql->bind_param("s", $prodTitle); $productsql->execute(); $productresult = $productsql->get_result() or die ('Unable to execute query. '.$productsql.''. mysqli_error($conn)); $productscount = $productresult->num_rows; // LETS CHECK BENSONS if ($productscount == 0 && $_GET['merchantName'] == "bensons-for-beds") { $prodTitle = substr($prodTitle, 0, 25); $prodTitle = "$prodTitle%"; $productsql = $conn->prepare("SELECT productID, discountID, merchantID, mainCat, subCat, subCatTwo, title, longDesc, price, salePrice, img1, material, construction, manuf, affUrl, viewCount, deeplink FROM $table WHERE title LIKE ? AND merchantID = '4' ORDER BY price ASC LIMIT 1"); $productsql->bind_param("s", $prodTitle); $productsql->execute(); $productresult = $productsql->get_result() or die ('Unable to execute query. '.$productsql.''. mysqli_error($conn)); $productscount = $productresult->num_rows; if ($productscount == 1) { // MOVED DUE TO CAT CHANGE $row = $productresult->fetch_assoc(); $mainCatUrl = strtolower(str_replace(' ', '-', $row['mainCat'])); $subCatUrl = strtolower(str_replace(' ', '-', $row['subCat'])); $subCatTwoUrl = strtolower(str_replace(' ', '-', $row['subCatTwo'])); $title = strtolower(str_replace(' ', '-', $row['title'])); header("Location: https://furnishwell.co.uk/$mainCatUrl/$subCatUrl/$subCatTwoUrl/$_GET[merchantName]/$title/", true, 301); exit; } if ($productscount == 0) { header("HTTP/1.0 404 Not Found"); include ("../404.php"); exit; } } $productscountmoved = "11"; if ($productscount == 0) { // PRODUCT NOT FOUND - MOVED - 301 THE USER - IF STILL CAN'T FIND 404 $tables = array("livingroom", "diningroom", "garden", "kitchen", "office", "homefurnishings", "lighting", "kitchen", "bedroom"); foreach( $tables as $value ) { $productsql = $conn->prepare("SELECT productID, discountID, merchantID, mainCat, subCat, subCatTwo, title, longDesc, price, salePrice, img1, material, construction, manuf, affUrl, viewCount, deeplink FROM $value WHERE title = ? AND merchantID = ? LIMIT 1"); $productsql->bind_param("si", $prodTitle, $merchantnameID); $productsql->execute(); $productresult = $productsql->get_result() or die ('Unable to execute query. '.$productsql.''. mysqli_error($conn)); $productscountmoved = $productresult->num_rows; if ($productscountmoved == 1) { // MOVED DUE TO CAT CHANGE $row = $productresult->fetch_assoc(); $mainCatUrl = strtolower(str_replace(' ', '-', $row['mainCat'])); $subCatUrl = strtolower(str_replace(' ', '-', $row['subCat'])); $subCatTwoUrl = strtolower(str_replace(' ', '-', $row['subCatTwo'])); header("Location: https://furnishwell.co.uk/$mainCatUrl/$subCatUrl/$subCatTwoUrl/$_GET[merchantName]/$_GET[title]/", true, 301); exit; } } } // IF ITS NOT MOVED THEN POSS ITS IN THE DISCONTINUED TABLE if ($productscountmoved == 0) { $productsql = $conn->prepare("SELECT productID, discountID, merchantID, mainCat, subCat, subCatTwo, title, longDesc, price, salePrice, img1, material, construction, manuf, affUrl, viewCount, deeplink FROM discontinued WHERE title = ? AND merchantID = ? LIMIT 1"); $productsql->bind_param("si", $prodTitle, $merchantnameID); $productsql->execute(); $productresult = $productsql->get_result() or die ('Unable to execute query. '.$productsql.''. mysqli_error($conn)); $productscountdiscont = $productresult->num_rows; if ($productscountdiscont == 0) { header("HTTP/1.0 404 Not Found"); include ("../404.php"); exit; } } // CONTINUE - PRODUCT FOUND $row = $productresult->fetch_assoc(); //UPDATE THE VIEWCOUNT if (preg_match('/bot|crawl|curl|dataprovider|search|get|spider|find|java|majesticsEO|google|yahoo|teoma|contaxe|yandex|libwww-perl|Seekport|facebookexternalhit/i', $_SERVER['HTTP_USER_AGENT'])) { // is bot do not update viewCount } else { // IS USER //UPDATE PRODUCT VIEW COUNT $viewCount = $row['viewCount'] + 1; $updateCountSql = "UPDATE $table SET viewCount = \"$viewCount\" WHERE productID = \"$row[productID]\""; $viewcountresult = $conn->query($updateCountSql); } //SET AFFILIATE LINKS AS PER MERCHANT /*$merchantsql = $conn->prepare("SELECT * FROM merchants WHERE merchantID = ? LIMIT 1"); $merchantsql->bind_param("i", $row['merchantID']); $merchantsql->execute(); $merchantresult = $merchantsql->get_result(); $merchantrow = $merchantresult->fetch_assoc();*/ $merchantName = $merchantnamerow['merchantName']; $affPlatform = $merchantnamerow['affPlatform']; // used to display affiliate platform scripts $awind = $merchantnamerow['awinid']; // SET URL FOR MERCHANT LOGO AND PROFILE ETC $merchantProfileUrl = strtolower(str_replace(" ", "-", $merchantnamerow['merchantName'])); //require_once __DIR__ . 'outlink_helper.php'; // provides build_outlink() //$table = $row['table']; // from your context //$productID = (int)$row['productID']; // from your query //$url = build_outlink('/item-out', $table, $productID); //$outlinkprod = ''; //$outlinkprod = '/item-out/'.$table.'/'.$row['productID'].'/'; // SET THE OUT LINK AS DEFAULT products TABLE $ts = time(); $sig = fw_make_sig(fw_click_sign_string_product((int)$row['productID'], $table, $ts)); $outlinkprod = '/item-out/'.$table.'/'.$row['productID'].'/?ts='.$ts.'&sig='.rawurlencode($sig); $ping = ""; $ping = ""; /*if ($merchantrow['affPlatform'] == "CJ" && $row['deeplink'] != "") { // IF CJ (WAYFAIR) GET DEEPLINK $outlink = substr(strrchr($row['deeplink'], "="), 1); $outlinkprod = rawurldecode($outlink); $ping = "yes"; } */ /* if ($merchantnamerow['affPlatform'] == "AWIN") { // IF CJ (WAYFAIR) GET DEEPLINK $outlink = $row['affUrl'].'&clickref=fwlink'; $outlinkprod = rawurldecode($outlink); $ping = "yes"; } */ /* if ($merchantnamerow['affPlatform'] == "AWIN" && $row['deeplink'] != "") { // IF CJ (WAYFAIR) GET DEEPLINK $deeplink = rawurlencode($row['deeplink']); $outlinkprod = ''.$merchantnamerow['merchantAffUrl'].''.$deeplink.''; $outlinkprod = rawurldecode($outlinkprod); //if ($merchantrow['merchantID'] == 46) { //$deeplink = str_replace("btfy.com", "beautify.co.uk", $deeplink); //} //$outlinkprod = rawurldecode($deeplink); $ping = "yes"; // CONVERT A LINK SHIT /*if ($merchantrow['merchantID'] == 26) { $outlink = $row['affUrl'].'&clickref=fwlink'; $outlinkprod = rawurldecode($outlink); $ping = "yes"; } if ($merchantrow['merchantID'] == 8) { $outlink = $row['affUrl'].'&clickref=fwlink'; $outlinkprod = rawurldecode($outlink); $ping = "yes"; } } */ // SET URL PARAMATERS AND BREADCRUMBS AND subCat / subCatTwo $mainCatUrl = strtolower(str_replace(" ", "-", $row['mainCat'])); $subCatUrl = strtolower(str_replace(" ", "-", $row['subCat'])); $subCatTwoUrl = strtolower(str_replace(" ", "-", $row['subCatTwo'])); $mainCat = $row['mainCat']; $subCat = $row['subCat']; $subCatTwo = $row['subCatTwo']; $title = $row['title']; $productID = $row['productID']; $discountID = $row['discountID']; $merchantID = $row['merchantID']; $longDesc = $row['longDesc']; $price = $row['price']; $salePrice = $row['salePrice']; $img1 = $row['img1']; $manuf = ucwords($row['manuf']); $affUrl = $row['affUrl']; $viewCount = $row['viewCount']; $deeplink = $row['deeplink']; if ($merchantName == "Made") { $merchantName = "MADE.COM"; } if ($merchantName == "Olivias") { $merchantName = "Olivia's"; } if ($merchantName == "Furniture At Work") { $merchantName = "Furniture @ Work"; } if ($merchantName == "Aj Products") { $merchantName = "AJ Products"; } if ($merchantName == "Oak Furniture Land") { $merchantName = "Oak Furnitureland"; } if ($merchantName == "Qd Stores") { $merchantName = "QD Stores"; } if ($merchantName == "Rise And Fall") { $merchantName = "Rise & Fall"; } if ($merchantName == "Cox And Cox") { $merchantName = "Cox & Cox"; } $breadcrumbs = 'furnish well > '.$mainCat.' > '.$subCat.' > '.$subCatTwo.' > '.$merchantName.' '.$subCatTwo.' > '.$row['title'].''; // SEE IF DISCOUNT IS AVAILABLE $discountAmount = ""; if ($discountID != 0) { $discInfoSql = $conn->prepare("SELECT * FROM discounts WHERE discountID = ? LIMIT 1"); $discInfoSql->bind_param("i", $discountID); $discInfoSql->execute(); $resultDiscInfo = $discInfoSql->get_result(); $rowDiscInfo = $resultDiscInfo->fetch_assoc(); $discountCodeAmount = ''.$rowDiscInfo['discountAmount'].''; $discountAmount = ''.$rowDiscInfo['discountAmount'].''; $discountDesc = ''.$rowDiscInfo['discountDesc'].''; if ($rowDiscInfo['discountType'] == "discount") { $discType = "Discount Code"; } if ($rowDiscInfo['discountType'] == "sale") { $discType = "Store Sale"; } if ($rowDiscInfo['discountType'] == "deal") { $discType = "Deal"; } } ?> <br /> <b>Warning</b>: Undefined variable $prodTitle in <b>/home/furnishwellco/public_html/categories/products-v5.php</b> on line <b>319</b><br />
furnish well
×
furnish well
×

Furnish Well Login

Please login to add items to your wishlist

success
0
Items in your wishlist
0
Compare Items

Warning: Undefined variable $breadcrumbs in /home/furnishwellco/public_html/categories/products-v5.php on line 455

Warning: Undefined variable $discountAmount in /home/furnishwellco/public_html/categories/products-v5.php on line 460
<br />
<b>Warning</b>:  Undefined variable $prodTitle in <b>/home/furnishwellco/public_html/categories/products-v5.php</b> on line <b>464</b><br />


Warning: Undefined variable $prodTitle in /home/furnishwellco/public_html/categories/products-v5.php on line 475


Warning: Undefined variable $row in /home/furnishwellco/public_html/categories/products-v5.php on line 481

Warning: Trying to access array offset on value of type null in /home/furnishwellco/public_html/categories/products-v5.php on line 481

Warning: Undefined variable $row in /home/furnishwellco/public_html/categories/products-v5.php on line 485

Warning: Trying to access array offset on value of type null in /home/furnishwellco/public_html/categories/products-v5.php on line 485

Warning: Undefined variable $row in /home/furnishwellco/public_html/categories/products-v5.php on line 490

Warning: Trying to access array offset on value of type null in /home/furnishwellco/public_html/categories/products-v5.php on line 490

Warning: Undefined variable $row in /home/furnishwellco/public_html/categories/products-v5.php on line 490

Warning: Trying to access array offset on value of type null in /home/furnishwellco/public_html/categories/products-v5.php on line 490
£ £
Reduced Price with a saving of £0.00 OFF
The price of this item has been reduced and may not stay at this price forever so take advantage and save now!

Warning: Undefined variable $title in /home/furnishwellco/public_html/categories/products-v5.php on line 510

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/furnishwellco/public_html/categories/products-v5.php on line 510

Warning: Undefined variable $table in /home/furnishwellco/public_html/categories/products-v5.php on line 512

Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE title LIKE ? AND merchantID = ? AND productID != ? AND subCatTwo = ? LIMIT' at line 1 in /home/furnishwellco/public_html/categories/products-v5.php:512 Stack trace: #0 /home/furnishwellco/public_html/categories/products-v5.php(512): mysqli->prepare('SELECT productI...') #1 {main} thrown in /home/furnishwellco/public_html/categories/products-v5.php on line 512