You are here:  » Cross Domain Access Not Allowed - How Can I Use PricesExternal.php?

Support Forum



Cross Domain Access Not Allowed - How Can I Use PricesExternal.php?

Submitted by bat on Wed, 2011-07-06 23:25 in

I've changed my hosting provider and they don't allow cross domain access, which means I can't use pricesExternal and other similar features.
I still want to use it and I tried the below code for this page http://www.example.com/misfits_series1
(the Amazon result is just one I wrote in manually)

<?php
$common_baseHREF 
"http://www.{saved}.co.uk/shopping/";
$_GET["q"] = "Misfits Series 1";
require(
"http://www.{saved}.co.uk/shopping/pricesExternal.php");
?>

but it didn't work. As I can't use the root path, because the price tapestry is running on a different domain than the one I want the results to show up on, what should I do?

I don't want to set up the pricetapestry database on each of the individual domains as there are too many and only need a handful of price results, hence the reason I used pricesExternal so it was calling the prices from the Master site.

Submitted by support on Thu, 2011-07-07 08:42

Hi bat,

Have a go with..

<?php
require("http://www.example.com/shopping/pricesExternal.php?q=".urlencode("Misfits Series 1"));
?>

(replace example.com with your domain name of course)

Cheers,
David.
--
PriceTapestry.com

Submitted by bat on Thu, 2011-07-07 09:05

Wow! David, you are a legend, sir. :)
Works a treat.

Just a tiny question, I use logos on the master site and I know logos won't show up on the external sites but is it possible to get the Merchant name text to show up instead, cos its not appearing?
See here for what I mean: http://www.example.com/misfits_series1

Submitted by support on Thu, 2011-07-07 09:13

Hi Bat,

What you could do is give the full URL to the logos so that they do show up on the external site, but looking at your example I also noticed a problem with the path to jump.php.

Both should be fixed actually by altering $config_baseHREF in pricesExternal.php to contain the full URL to the external site rather than just the path. In your pricesExternal.php look for the following code around line 60:

  $q = (isset($_GET["q"])?tapestry_normalise($_GET["q"],":\."):"");

...and REPLACE with:

  $config_baseHREF = "http://www.example.com/shopping/";
  $q = (isset($_GET["q"])?tapestry_normalise($_GET["q"],":\."):"");

(replace example.com with your domain name - exactly as you used in $common_baseHREF in the original calling code)

...and that should fix logos and the jump link...

Cheers,
David.
--
PriceTapestry.com

Submitted by bat on Thu, 2011-07-07 09:37

It indeed does the fix the logos and jump.
Thanks David for your super prompt replies and help!