how to redirect?
Posted: Thu Sep 20, 2007 12:21 am
Hi
I need to redirect to the advertiser's website after some analysis. but header is not working
i use another tag that sometimes works and sometimes not:
is there a solution? i'm still having problem. the original code is:
searchclicks.php:
I need to redirect to the advertiser's website after some analysis. but header is not working
i use another tag that sometimes works and sometimes not:
Code: Select all
echo "<script> window.parent.ifrmTEXTFRNewWin('$url')</script>";searchclicks.php:
Code: Select all
<?php
include 'global.php';
$keyword=$_SESSION['q'];
$publisher=clean($_GET['publisher']);
$advertiser=clean($_GET['advertiser']);
$listing=clean($_GET['listing']);
$price=getcost($keyword,$listing);
$sql2="SELECT * FROM advertiser WHERE id='$advertiser' ";
$result2=mysql_query($sql2) or die (mysql_error());
$row2=mysql_fetch_array($result2);
$advertiserbalance=$row2['balance'];
if ($advertiserbalance<$price) echo "The advertiser does not have enough balance in his/her account";
else{
$advertiserbalance-=$price;
$sql3="SELECT * FROM publisher WHERE id='$publisher' ";
$result3=mysql_query($sql3) or die (mysql_error());
$row3=mysql_fetch_array($result3);
$publisherbalance=$row3['balance'];
$price=$price*3/4 ;
$publisherbalance+=$price;
$sqlu1= "UPDATE advertiser SET balance='$advertiserbalance' WHERE id='$advertiser'";
$resultup1=mysql_query($sqlu1) or die(mysql_error()) ;
if (!$resultup1) echo "There was a problem during the analysis. Please contact us to inform aout the issue";
else{
$sqlu2= "UPDATE publisher SET balance='$publisherbalance' WHERE id='$publisher'";
$resultup2=mysql_query($sqlu2) or die(mysql_error()) ;
$sql4="SELECT * FROM listing WHERE id='$listing' ";
$result4=mysql_query($sql4) or die (mysql_error());
$row4=mysql_fetch_array($result4);
$url=$row4['url'];
//var_dump($row4);
//header("Location : $url");
//header('Location: '.$url);
echo "<script> window.parent.ifrmTEXTFRNewWin('$url')</script>";
}
}
?>