DMR Code error

S1lv3rdo7

Regular Member
Joined
Jul 17, 2010
Messages
486
Reaction score
325
I used the DMR script from this thread.

http://www.blackhatworld.com/blackh...0996-blank-referer-v2-0-meta-refresh-dmr.html

These two files are located in a directory with WordPress installed on it. I don't know if that has anything to do with it. I changed the files names to tracking and tracking 2. Here is the page code and the error.

PHP Error

Code:
[B]Warning[/B]:  Cannot modify header information - headers already sent  by (output started at  /home/silverdo/public_html/thepickupartistblog.com/tracking.php:1) in [B]/home/silverdo/public_html/thepickupartistblog.com/tracking.php[/B] on line [B]9[/B]

Tracking.php
Code:
 <?php

    $referer = $_SERVER['HTTP_REFERER'];

    if($referer == "")
    
{

header("Location: http://www.mb01.com/lnk.asp?o=4990&c=57066&a=51894");

}else{

echo "<meta http-equiv=\"refresh\"content=\"0;url=http://thepickupartistblog.com/tracking2.php\">";

}
?>

Tracking2.php

Code:
 <?php

    $referer = $_SERVER['HTTP_REFERER'];

    if($referer == "")
    
{

header("Location: http://www.mb01.com/lnk.asp?o=4990&c=57066&a=51894");

}else{

echo "<meta http-equiv=\"refresh\"content=\"0;url=http://google.com\">";

}
?>

I don't know what's causing the header problem. Any help is appreciated!
 
I have this problem a lot, just by looking into the error code :)

I never quite remember how I fixed those always, but I do remember one thing:

http://www.daniweb.com/web-developm...odify-header-information.headers-already-sent

search in google for:
php ob_start "headers already sent"


I'm not sure if this is correct, but for all my php scripts I include ob_start() at the very top, and ob_end_flush() at the very bottom.

<?php
ob_start();
....
blablablabal
blablablabal
...
ob_end_flush();
?>
 
Healzer your the man! Rep added!

Added

<?php
ob_start();
....
blablablabal
blablablabal
...
ob_end_flush();
?>

and changed

header("Location: http://www.mb01.com/lnk.asp?o=4990&c=57066&a=51894");

gets changed to

echo "<meta http-equiv=\"refresh\"content=\"0;url=http://www.mb01.com/lnk.asp?o=4990&c=57066&a=51894\">";

worked like a charm. I'll update the other thread in case someone else has this problem.
 
Back
Top