not redirecting
Posted: Fri Aug 31, 2007 9:23 am
Hi
I use a page for some analysis and then redirect the user to the correct url. but the users are not redirected.
the first url that is called is similar to:
http://127.0.0.1/adcenter/clicks.php?ad ... &listing=8
and the page clicks.php is :
when i enter that url in the address bar, the result is not $url. why?
I use a page for some analysis and then redirect the user to the correct url. but the users are not redirected.
the first url that is called is similar to:
http://127.0.0.1/adcenter/clicks.php?ad ... &listing=8
and the page clicks.php is :
Code: Select all
<?php
include 'global.php';
$adid=clean($_GET['adid']);
$publisher=clean($_GET['publisher']);
$advertiser=clean($_GET['advertiser']);
$listing=clean($_GET['listing']);
$sql="SELECT * FROM adsetting WHERE id='$adid'";
$result=mysql_query($sql)or die (mysql_error());
$row=mysql_fetch_array($result);
$keyword=$row['keyword'];
$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'];
header("Location : $url ");
}
}
?>