Error =

WARNING: Cannot modify header information - headers already sent by (output
started at /home/zoneof5/public_html/index-dev.html:10) in line 1528 of file
common.inc.php

 

Which comes from me trying to take a login script and put it into an
existing .html file with .htaccess configured to parse php scripts.

 

Research yields that the header needs to be loaded before anything.

The header is being called by another file “common.inc.php”

 

How do I safely extract this call from the existing script and place the
call at the beginning of the .html or just simply fix the error?

 

Php code;

 

 

<?php

include('./amember/config.inc.php');

$t = & new_smarty();

$_product_id = array('ONLY_LOGIN');

if (isset($_REQUEST['amember_redirect_url']))

    $_SESSION['amember_redirect_url'] = $_REQUEST['amember_redirect_url'];

function rcmp_begin_date($a, $b){

    return strcmp($b['begin_date'], $a['begin_date']);

}

include($config['plugins_dir']['protect'] . '/php_include/check.inc.php');

$payments = & $db->get_user_payments(intval($_SESSION['_amember_id']), 1);

usort($payments, 'rcmp_begin_date');

$now = date('Y-m-d');

$urls = array();

foreach ($payments as $k=>$v){

    if (($v['expire_date'] >= $now) && ($v['begin_date'] <= $now)) {

        $p = get_product($v['product_id']);

        $url = $p->config['url'];

        if (strlen($url)){

            $urls[] = $url;

        }

    }

}

if ($_SESSION['amember_redirect_url']) {

        $redirect = $_SESSION['amember_redirect_url'];

        unset($_SESSION['amember_redirect_url']);

} elseif (count(array_unique($urls)) == 1){

    if (in_array('htpasswd_secure', $plugins['protect'])){

        $member_login_pw = 

        htpasswd_secure_get_login($_SESSION['_amember_user']['login']).

        ':'.

        htpasswd_secure_get_passwd($_SESSION['_amember_user']['pass']);

        $redirect = add_password_to_url($urls[0], $member_login_pw);

    } else {

        if ($config['display_member_pw_urls']) {

             $member_login_pw = 

             $_SESSION['_amember_user']['login'].

             ':'.

             $_SESSION['_amember_user']['pass'];

             $redirect = add_password_to_url($urls[0], $member_login_pw);

        } else {

            $redirect = add_password_to_url($urls[0]);

        }

    }

} else {

    $redirect = $config['root_url'] . "/amember/member.php";

}

#print_r($urls);

html_redirect("$redirect", 0, 'Redirect', _LOGIN_REDIRECT);

?>


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.8/1064 - Release Date: 10/11/2007
3:09 PM
 

Reply via email to