Hello all. In this little snippet below, the script is supposed to take non-JS browsers and redirect them, and take JS supported browsers and open a new window and redirect them.
Here's what it does:
It take the current page and redirects them, and pop's up a new window with the current page.
That's backwards.
Could someone tell me why please?
<?php
if($row['affurl'] !== ""){
$clicktime = date("m/d/y h:m:s A");
$clickip = $_SERVER['REMOTE_ADDR'];
$product = $add;
$clicksql = @mysql_query("SELECT MAX(clickid)+1 FROM ".$prefix."store_affstats");
$clickid = @mysql_result($clicksql, 0);
@mysql_query("INSERT INTO ".$prefix."store_affstats (clickid, product, clickip, clicktime) VALUES ('$clickid', '$product', '$clickip', '$clicktime')");
?>
<noscript> <?php
header("Location: ".$row['affurl']);
exit;
?> </noscript>
<script language="JavaScript" type="text/javascript">
window.open(location.href="<?php echo $row['affurl']; ?>");
</script>
<?php
}
?>
TY.