This looks really complicated. Why don't you use a simple 301 redirect?
Hi All
I've posted this same message in the following thread from earlier in the year, but is at the back of 3 pages of posts, at the risk it might get ignore there I've started this new thread.
Hiding Affiliate Link URL's?
I used Donks code below (thanks Donk) originally placed in the thread linked above, and tried to adapt it for my site.
MY site is a WORDPRESS blog, and the masking worked perfectly when my pages were in a sub directory, however for technical reasons I changed my product pages to WP pages, and since changing the masking doesn't work anymore and just opens a blank page?
Can anybody please advise where I might be going wrong?
This is in my body where the product details appear
then the link page isPHP Code:if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
while ($data = mysql_fetch_array($result))
{
extract($data);
echo "<div id='shopItem'>";
echo "<div id='shopImage'>";
echo "<a href='http://www.partydressesandmore.co.uk/link.php?product=".$data['id']."'><img src=\"" . $data['image'] . "\" id='image' alt=\"" . "\"></a></div>";
echo "<div id='shopDescription'><p class='shopDescription'>" . $data['product']. "</p> <p>" . $data['description']."</p></div>";
echo "<div id='price'><p class='price'> Price: £".$data['price']. "</p>";
echo "<a href=".$data['link']."><img src='http://www.partydressesandmore.co.uk/wp-content/themes/revolution_magazine-30/images/more.jpg' id='shopbutton' alt=''></a></div>";
echo "<div style='clear:both;'></div>";
echo "</div>";
}
Haven't got round to the INSERT yet until I can get the masking of the URL bit working.PHP Code:<?php
include ("db_connect.php"); // include your code to connect to DB.
$sql="SELECT * FROM test WHERE id='".$_GET['product']."'";
$result= mysql_query($sql);
$data=mysql_fetch_assoc($result);
if ($data['url']){
$sql="INSERT INTO links VALUES ('".$_GET['Product']."','otherdata','ipaddress')";
$result= mysql_query($sql);
header("Location: ".$data['link']);
exit;
}
else
{
// failure code
}
?>
Very new to php so forgive my Thickness and thanks to Donk for original code.
Paul[/QUOTE]
This looks really complicated. Why don't you use a simple 301 redirect?
There is also various link cloaking plugins for wordpress available.
ø Link Cloaking Plugin for WordPress | W-Shadow.com ø
Mike
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks