Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    In my file adminfunctions.php file, I have:
    PHP Code:
    <?php

            
    function maketableheader($text)
                    {
                        echo(
    "<div id=\"heading\">$text</div>");
                    }

            function 
    makesubtableheader($text)
                    {
                        echo(
    "<div id=\"subheading\">$text</div>");
                    }
    ?>
    And then in another file, say index.php, when I use:

    PHP Code:
            <?php
                        
    require("adminfunctions.php");
                        
    maketableheader("Site Stats");
            
    ?>
    I get this error (The function works, but I also get the error)

    Fatal error: Cannot redeclare maketableheader() (previously declared in c:\localhost\www\movie-shot\admin\adminfunctions.php:3) in c:\localhost\www\movie-shot\admin\adminfunctions.php on line 3
    assassingod - vB.org Moderator :ichatsmile:

  2.  

  3. #2
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    The problem is with this line
    PHP Code:
    function maketableheader($text
    I don't know what is wrong with it though. Do you have the right names for cells/tables/etc.
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  4. #3
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Yeah, I saw that - and I have no idea what's wrong with it
    assassingod - vB.org Moderator :ichatsmile:

  5. #4
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Edit: I've fixed it now,thanks anyway
    assassingod - vB.org Moderator :ichatsmile:

  6. #5
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    What was the problem, so that others that may come along with a similar problem may figure it out .. ?
    - Brian

  7. #6
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    I had accidently required adminfunctions.php somewhere else, so I was requiring it twice
    assassingod - vB.org Moderator :ichatsmile:


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:20 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com