PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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:
<?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>";
}
}
?>
If you're using a closing php tag (?>) in your include file, make sure there's no space or new lines after it.
What's your URL look like that you're trying to go to?
Make sure to call exit or die after you send the header (otherwise your script tag will run and mess up the header() call)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
none of above worked
please visit this link tho see what happens and click on one of the ad links: http://www.php.jothost.com/adsense/test.php
I need something to move the page out of the iframe. in that page i'm using header( 'Location: ' .$url ) ; other codes didn't work though
that's loading the destination url in the iframe again. in addition, how do i write the code with $url instead of location.html to avoid parse errors?
how can i load the page in full screen?