$url = "http://productsearch.linksynergy.com/productsearch";
//$url = "http://65.245.193.50/productsearch";
$token = "80e67079b2bf969b3f066ed14753ca7bd5cd5aef558afd8f2c7d6fa3df35c5b0"; // Add your LinkShare token here
$results = '';
$resturl = $url."?"."token=".$token;
if (isset($_GET["keyword"]))
{
$keyword = $_GET["keyword"];
$resturl .= "&keyword=".$keyword;
}
if (isset($_GET["cat"]))
{
$category = $_GET["cat"];
$resturl .= "&cat=".$category;
}
if (isset($_GET["max"]))
{
$maxresults = $_GET["max"];
$resturl .= "&max=".$maxresults;
}
if (isset($_GET["mid"]))
{
$mid = $_GET["mid"];
$resturl .= "&mid=".$mid;
}
$SafeQuery = urlencode($resturl);
$xml = simplexml_load_file($SafeQuery);
if ($xml)
{
foreach ($xml as $item) {
$link = $item->linkurl;
$title = $item->productname;
$imgURL = $item->imageurl;
$price = $item->price;
$merchantname = $item->merchantname;
$description = $item->description->short;
if($link != "")
$results .="
";
}
}
if ($results == '') { $results = "
Use the search bar to find advertisements from thousands of merchants.
"; }
print $results?>