hello, i want to add a popup ad to this code.. i will store the popup ad code in ads.php and i want to include ads.php in the following code.. i have tried using <?php include("ads.php")?> and also require_once("config.php"); but it gave error that headers already sent.. please help! if (isset($_GET['l'])) { $link = $db->execute("SELECT * FROM links WHERE linkcode='{$_GET['l']}'"); if (mysql_num_rows($link)>0) { $link = mysql_fetch_array($link, MYSQL_ASSOC); $db->execute("UPDATE links SET visits=" . ++$link['visits'] . " WHERE linkcode='{$_GET['l']}'") ; [B]header("Location: " . $link['linkurl']);[/B] exit; } } Code (markup):
You already have some output before sending the header. var_dump(headers_sent()); You must send any headers before ANY output is sent. Dan P.s. $link = $db->execute("SELECT * FROM links WHERE linkcode='{$_GET['l']}'"); OMG :O - Please tell me that class includes sanitization.
Send me the other files too, one of those is sending output to the browser. Remember, if you are NOT outputting any HTML, you should NOT include the ending ?> tag. e.g. config.php: Correct: <?php define('NAME', 'Danltn'); PHP: Incorrect: <?php define('NAME', 'Danltn'); ?> PHP: