qfetch("SELECT * FROM ".$pfx."_offers WHERE id=$_GET[id] AND `show`=1 AND pid='$pid'"); if(!empty($offer['id'])){ $redirlink = str_replace("[userid]", $userdata['id'], $offer['link']); header("location: $redirlink"); } else access_error(); exit(); } if(isset($_POST['submit']) && $_POST['u_searchby'] != ""){ $result = $db->query("SELECT * FROM ".$pfx."_offers WHERE `show`='1' AND pid='$pid' ORDER by $_POST[u_searchby] $_POST[u_orderby] "); $matches = $db->num_rows($result); } else $result = $db->query("SELECT * FROM ".$pfx."_offers WHERE `show`=1 AND pid='$pid' ORDER by weight ASC"); $offersrows = 3; $offerscount = 0; while($offers = $db->fetch($result)){ if($offerscount==$offersrows){ $divtag = "