Results 1 to 7 of 7

Thread: need help with php include
      
   

  1. #1
    luckystars62 is offline Private First Class
    Join Date
    Jan 2007
    Location
    Texas
    Posts
    7

    Question need help with php include

    I'm trying to use the php include for my header, etc on a new site and I'm getting this error message....

    Fatal error: Cannot redeclare header() in /home/pnyejnk/public_html/lowcarbjourney/header.php on line 31


    What am I doing wrong?
    the site is www.lowcarbjourney.com and I'm just getting it started. There's not much there yet so I was going to do the php includes for the header, menu bar, left bar and right bar.

    I thought I followed the instructions by the letter, but obviously not......

    The header is saved on page "header.php"
    I'm trying it on a page named "myths.php"

    (Sorry.......I posted this in the Tips and Tricks forum by accident already and then realized it didn't belong there. Can someone delete that post since it was in the wrong forum?)

  2. #2
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: need help with php include

    Will you post lines like 28-35

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  3. #3
    luckystars62 is offline Private First Class
    Join Date
    Jan 2007
    Location
    Texas
    Posts
    7

    Default Re: need help with php include

    Not sure how to do that...
    I did a view source on the published header page and it just shows the same error message as I posted above.

  4. #4
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: need help with php include

    The actual php code isn't show in the source. Open the file and copy and paste the php code

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  5. #5
    luckystars62 is offline Private First Class
    Join Date
    Jan 2007
    Location
    Texas
    Posts
    7

    Default Re: need help with php include

    Okay.......pasting in the whole code from the page html on the header.php page. The blue text is the php code that was added per instructions from the tips/tricks forum.


    <? function header() { ?>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <TITLE>Untitled Page</TITLE>
    <META name="GENERATOR" content="Created by BlueVoda">
    <STYLE type="text/css">
    div#container
    {
    width: 1025px;
    position: relative;
    margin-top: 0px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    }
    body
    {
    text-align: center;
    margin: 0;
    }
    </STYLE>
    </HEAD>
    <BODY bgcolor="#FFFFFF" text="#000000">
    <DIV id="container">
    <IMG src="lcjheader3.jpg" alt="" align="top" border="0" width="895" height="105" style="position:absolute;left:0px;top:0px;width:89 5px;height:105px;z-index:0">
    </DIV>
    </BODY>
    </HTML>
    <?
    }
    ?>


  6. #6
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: need help with php include

    Rename your "header.php" in "header1.php" or "myheader.php"or something like that. Change the code in the html box accordingly.

    Please have a look at your other thread. You have the same answer there.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  7. #7
    luckystars62 is offline Private First Class
    Join Date
    Jan 2007
    Location
    Texas
    Posts
    7

    Default Re: need help with php include

    Yes! That did it! Thanks!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49