PHP includes is causing my webpage to duplicate itself. HELP

Discussion in 'PHP' started by Cudbwrse, Aug 1, 2006.

  1. #1
    What the heck is wrong?

    I'm using this code...

    <?php include("left-nav-links/article.html"); ?>
    Code (markup):
    And have this in my htaccess file...

    AddHandler application/x-httpd-php .php .html .htm

    Any help would be appreciated.

    Thanks,
    Tabitha
     
    Cudbwrse, Aug 1, 2006 IP
  2. Sector

    Sector Peon

    Messages:
    64
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try using
    include_once("");
    instead of
    include("");

    works for me
     
    Sector, Aug 1, 2006 IP
    ahkip likes this.
  3. rjb

    rjb Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This works, but I would recommend using

    
    require_once ("");
    
    PHP:
    simply because the include() methods return an error and then continue executing the script, while the require methods halt execution.

    I would also recommend finding where else the script is being included.
     
    rjb, Aug 1, 2006 IP
  4. Cudbwrse

    Cudbwrse Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ok thanks guys. The require_once works.
     
    Cudbwrse, Aug 3, 2006 IP