Call to undefined function displayHeader()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maverick1911
    New Member
    • Apr 2007
    • 1

    Call to undefined function displayHeader()

    Can any body help with the above error and how to fix it . here is the code refered to in the error


    Fatal error: Call to undefined function displayHeader() in C:\wamp\www\fun ctions.php on line 15

    <?php
    require( "config.php " );
    //-------------------------------------------------------------------------------------------------------
    function dbConnect()
    {
    global $dbHost, $dbUser, $dbPasswd, $dbName, $dbConn, $numComments, $table;
    $dbConn = @mysql_connect( $dbHost, $dbUser, $dbPasswd ) or error( mysql_error() );
    mysql_select_db ($dbName, $dbConn) or die("Error 2 in Application: " . mysql_error());
    }
    //-------------------------------------------------------------------------------------------------------

    function error( $error )
    {
    global $forumTitle;
    displayHeader( "Error Page" );
    echo "
    <center><h4>&lt ;Error Page&gt;</h4></center>
    <center><h4><fo nt color=#FF0000>E rror: $error</font></h4></center>
    <DIV align=center><a href=javascript :history.back() ;>Back</a>&nbsp; |&nbsp; <a href=forum.php> $forumTitle</a></DIV>";
    displayFooter() ;
    exit;
    }
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Your script is unable to find where is this functions has been defined. displayHeader() is a user defined function, include the file in the script where you have defined this.

    Comment

    Working...