Warning message

Hello,
I’m new to the forum, hope this is the right place to ask this.

Warning message on the index page;

Warning: Cannot modify header information - headers already sent by (output started at /home/proxyisl/public_html/index.php:6) in /home/proxyisl/public_html/PHProxy.class.php on line 627

Thanks to anyone than can help.

elbow

You are trying to send more Header information after you have already started to send HTML

Are you using the header() function?

Perhaps a snippit of your code posted could be more revealing.

Would you like me to post the entire index.php file?

Since the error is on line 627, that means there are at least 627 lines of code, so NO!!!

If you could localize it to that area (Perhaps lines 600 through 650 would suffice as a starting point).

Also Point out WHICH line is 627. Don’t forget to make use of the CODE or PHP tags in the PHPBB (See posting guidelines at http://phphelp.com/guidelines.php )

Hope this is what you need.

Ok, here are lines 599-625:

[code] function proxify_css_url($url)
{
$url = trim($url);
$delim = ‘’;

    if (strpos($url, '"') === 0)
    {
        $delim = '"';
        $url   = trim($url, '"');
    }
    else if (strpos($url, "'") === 0)
    {
        $delim = "'";
        $url   = trim($url, "'");
    }

    $url = preg_replace('#\(.)#', '$1', $url);
    $url = trim($url);
    $url = $this->proxify_url($url);
    $url = preg_replace('#([(),s'"\])#', '\$1', $url);

    return $delim . $url . $delim;
}

function set_flags($flags)
{
    if (is_numeric($flags))

[/code]

lines 626-715:

[code] {
setcookie(‘flags’, $flags, time()+(47246060), ‘’, $this->http_host);
$this->flags[‘include_form’] = $flags{0} == 1 ? 1 : 0;
$this->flags[‘remove_scripts’] = $flags{1} == 1 ? 1 : 0;
$this->flags[‘accept_cookies’] = $flags{2} == 1 ? 1 : 0;
$this->flags[‘show_images’] = $flags{3} == 1 ? 1 : 0;
$this->flags[‘show_referer’] = $flags{4} == 1 ? 1 : 0;
$this->flags[‘rotate13’] = $flags{5} == 1 ? 1 : 0;
$this->flags[‘base64_encode’] = $flags{6} == 1 ? 1 : 0;
$this->flags[‘strip_meta’] = $flags{7} == 1 ? 1 : 0;
$this->flags[‘strip_title’] = $flags{8} == 1 ? 1 : 0;
$this->flags[‘session_cookies’] = $flags{9} == 1 ? 1 : 0;
}
else if (isset($_COOKIE[‘flags’]) && is_numeric($_COOKIE[‘flags’]) && strlen($_COOKIE[‘flags’]) == count($this->flags))
{
$this->set_flags($_COOKIE[‘flags’]);
}
else
{
$flags = ‘’;
foreach ($this->flags as $flag)
{
$flags .= $flag;
}

        $this->set_flags($flags);
    }
}

function set_request_headers()
{
    $path = preg_replace('#/{2,}#', '/', $this->url_segments['path']);
    $path = preg_replace('#([^.]+)(./)*#', '$1', $path);
    while ($path != ($path = preg_replace('#/[^/.]+/../#', '/', $path)));
    $path = preg_replace('#^/(../)*#', '/', $path);
    $path = preg_replace('#[^a-zA-Z0-9$-_.+!*'(),;/?:@=&]+#e', "'%'.dechex(ord('$0'))", $path);

    $headers  = "{$this->request_method} $path" . (isset($this->url_segments['query']) ? '?' . preg_replace('#[^a-zA-Z0-9$-_.+!*'(),;/?:@=&]+#e', "urlencode('$0')", urldecode($this->url_segments['query'])) : '') . " HTTP/1.0rn";
    $headers .= "Host: {$this->url_segments['host']}:{$this->url_segments['port']}rn";

    if (isset($_SERVER['HTTP_USER_AGENT']))
    {
        $headers .= 'User-Agent: ' . $_SERVER['HTTP_USER_AGENT'] . "rn";
    }
    if (isset($_SERVER['HTTP_ACCEPT']))
    {
        $headers .= 'Accept: ' . $_SERVER['HTTP_ACCEPT'] . "rn";
    }
    else
    {
        $headers .= "Accept: */*;q=0.1rn";
    }
    if ($this->flags['show_referer'] == 1)
    {
        $headers .= "Referer: {$this->url_segments['base']}rn";
    }
    if (($cookies = $this->get_cookies('COOKIE')) != '')
    {
        $headers .= "Cookie: $cookiesrn";
    }
    if (!empty($this->basic_auth_header))
    {
        $headers .= "Authorization: Basic {$this->basic_auth_header}rn";
    }
    if ($this->request_method == 'POST')
    {
        if (!empty($_FILES) && (bool)ini_get('file_uploads'))
        {
            $this->data_boundary = 'PHProxy-' . md5(uniqid(rand(), true));
            $this->set_post_body('FILES/VARS', $_POST);
            $this->set_post_body('FILES/FILES', $_FILES);
            $headers .= "Content-Type: multipart/form-data; boundary={$this->data_boundary}rn";
            $headers .= "Content-Length: " . strlen($this->post_body) . "rnrn";
            $headers .= $this->post_body;
            $headers .= "--{$this->data_boundary}--";
        }
        else
        {
            $this->set_post_body('POST/VARS', $_POST);
            $headers .= "Content-Type: application/x-www-form-urlencodedrn";
            $headers .= "Content-Length: " . strlen($this->post_body) . "rnrn";
            $headers .= $this->post_body;
        }
    }

    $headers .= "rn";

    $this->request_headers = $headers;
}

[/code]

Thanks, again

This appears to be a “pre-made” script. Although it’s policy to not troubleshoot pre-made scripts (in favor of the developers own support site), I would suggest that you probably need to enable output_buffering in your PHP.INI just looking at how things are being done.

Once enabled, you will probably have to restart your webserver for changes to take affect.

Look for output buffering in your php.ini and there is usually a comment there to describe it.

Sponsor our Newsletter | Privacy Policy | Terms of Service