You are here:  » Links that return back to the originating page

Support Forum



Links that return back to the originating page

Submitted by Paul1107 on Tue, 2009-12-22 16:03 in

Hi David,

I know you're busy at the moment...

But hopefully this will be a quickie?

I am using a script you did for me a little while ago node/2533

I am using it to list direct links to winter sales pages of my merchants

<?php
  
global $config_databaseServer;
  global 
$config_databaseUsername;
  global 
$config_databasePassword;
  global 
$config_databaseName;
  global 
$config_databaseTablePrefix;
  require(
"C:/xampp/htdocs/mystore/config.php");
 require(
"C:/xampp/htdocs/mystore/includes/database.php");
  
$links["Boden"] = "http://tidd.ly/e0f448d5";
  
$sql "SELECT * FROM `".$config_databaseTablePrefix."feeds` ORDER BY merchant";
  
database_querySelect($sql,$rows);
  
$rows[] = array("merchant" => "Faith Shoes");
  
$rows[] = array("merchant" => "French Connection");
    
$merchants = array();
  foreach(
$rows as $row)
  {
    
$merchants[] = $row["merchant"];
  }
  
sort($merchants);
  print 
"<ul>";
  foreach(
$merchants as $merchant)
  {
    print 
"<li><a href='".$links[$merchant]."'>".$merchant."</a></li>";
  }
  print 
"</ul>";
?>

Again testing it on a localhost, it works, though there are a number of links which 1) Instead of having the affiliate link to the sales page of the merchant, has instead a link back to the orginating page? and 2) The links I thought I overode so it would n't use the feed name still appear. (It that makes sense?)

Any ideas as to how I mind overcome this please

Regards

Paul

Submitted by support on Thu, 2009-12-24 02:40

Hi Paul,

It sounds like it's more likely a problem with the links than the script. What I would do is double check the link that is being generated by right-clicking the link and using "Copy Link Location", and then paste the URL directly into a new browser window.

Also check that you have $links entries for all merchants; otherwise the link will be empty; and the effect of that will be (in most browsers) just to reload the current page - which sounds like what may be happening...

Cheers,
David.