Results 1 to 7 of 7

Thread: Very Urgent, Help Appreciated!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    New Orleans, LA
    Posts
    161

    Angry Very Urgent, Help Appreciated!

    http://www.merkamericaco.com/ is the full address.

    http://merkamericaco.com/ results in an odd error.

    Once you hit "Buy Now" on any product you get the following:

    Headers sent in file: /home/merkamericaco/public_html/index.php on line: 1
    Here is the code:

    PHP Code:
    <?php

    /**
     * define path to application files
     */
    define'APPS_FILES''../apps_files' );

    require 
    APPS_FILES '/config/config.php';

    require 
    APPS_FILES '/init.php';

    RPC_Db::addConnection'default'$config['database']['default'] );

    RPC_Registry::set'config'$config );

    $router = new RPC_Controller_Router_Rewrite();

    $http_host explode'.'$_SERVER['HTTP_HOST'] );

    if( 
    $_SERVER['SERVER_PORT'] != '443' )
    {
        if( 
    $http_host[0] != 'secure' && substr$_SERVER['SERVER_NAME'], 0) != 'www' )
        {
            
    header'Location: http://www.' $_SERVER['SERVER_NAME'] . '' . @$_SERVER['REQUEST_URI'] );
            exit;
        }
    }

    if( 
    $http_host[0] == 'secure' )
    {
        if( 
    $_SERVER['SERVER_PORT'] != '443' )
        {
            
    header'Location: ' WEB_ADDRESS );
            exit;
        }
        
    $url $_SERVER['REQUEST_URI'];
        if( 
    trim$url'/' ) != 'checkout/payment' &&
            
    trim$url'/' ) != 'g/callback' &&
            
    trim$url'/' ) != 'checkout/index' &&
            
    trim$url'/' ) != 'checkout/data' &&
            
    trim$url'/' ) != 'checkout/login' &&
            
    trim$url'/' ) != 'checkout/register' &&
            
    trim$url'/' ) != 'checkout/finish' )
        {
            
    header'Location: ' WEB_ADDRESS '/' trim$url'/' ) );    
            exit;
        }
    }
    else
    {
        if( 
    $_SERVER['SERVER_PORT'] == '443' )
        {
            
    header'Location: ' WEB_ADDRESS );
            exit;
        }

        
    $router->rewrite'^([a-zA-Z0-9\-\_]+)\/c([0-9]+)$''/category/index/params/id/$2' );
        
    $router->rewrite'^([a-zA-Z0-9\-\_]+)\/p([0-9]+)$''/product/index/params/id/$2' );
        
    $router->rewrite'^([a-zA-Z0-9\-\_]+)\/o([0-9]+)$''/product/offer/params/id/$2' );
        
    $router->rewrite'^page\/([a-zA-Z0-9\-]+)$''/page/view/params/url/$1' );
        
    $router->rewrite'^admin$''/admin/auth/login'true );
    }

    $dispatcher = new RPC_Controller_DispatcherPATH_ROOT DS 'application' DS 'controllers' );

    $front = new RPC_Controller_Front$dispatcher$router );
    try { 
    $front->dispatch(); }
    catch( 
    Exception $e ) { if( strpos$e->getMessage(), 'does not exist' ) !== false ) { header'Location: /page_not_found.html' ); exit; } }

    RPC_Db::factory()->disconnect();

    ?>
    Obviously this is a major problem for me and I would greatly appreciate any help. If it helps, the person who touched it last said they changed the

    PHP Code:
    false ) { header'Location: /page_not_found.html' ); exit; } } 
    line but changed it back when they noticed a problem.

  2. #2
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    448

    Re: Very Urgent, Help Appreciated!

    well, first off in order for it to be accessible without the www you need to register that with your nameserver. Did it ever work without the www? The error you are getting is because you are sending headers when headers already exist. By quickly glancing at your code you should not be getting that error if the product exists so there may be more wrong than you think.
    If I helped you please rate me.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    New Orleans, LA
    Posts
    161

    Re: Very Urgent, Help Appreciated!

    Yes, I have always accessed parts of my website without www..

    Just today it started with these odd messages and that one error message. I notice that these messages only ever show up if you type an incorrect URL, other than when you click buy now on the shopping cart.

  4. #4
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    448

    Re: Very Urgent, Help Appreciated!

    What error message are you getting when you access it without the www. I only get a blank screen. Who is your webhost?
    If I helped you please rate me.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    New Orleans, LA
    Posts
    161

    Re: Very Urgent, Help Appreciated!

    When I try without www. I do not get an error message, I get:

    &#239;&#187;&#191;

  6. #6
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Very Urgent, Help Appreciated!

    Copy all of the contents out of the file, paste it into notepad and re-save the file.

    It looks like they probably saved it as unicode and it added some "invisible" characters to the beginning. That would explain the header issues you're receiving, since it would print out those characters before the header was sent.

  7. #7
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Very Urgent, Help Appreciated!

    The bytes at the beginning of a unicode file at known as the byte order mark or BOM. Unfortunately version of PHP < 6 can do not interpret unicode files.

    Save the file as ASCII and it should be ok.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width