Re: PHP function error

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: PHP function error
Date: 2005-03-02 13:53:26
Message-ID: 5.2.1.1.0.20050302084822.049cfb60@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

At 04:43 AM 3/2/05, Sarah, Godfrey, Matthew & Vera wrote:

>I am trying to run the following code but get the following error:
>
>Fatal error: Call to undefined function show_title() in
>d:\webhost\build\index.php on line 13
>
>
>This file is called "index.php"
>
><? include "dynamic.php"; ?>
><? if (empty($id)) $id = "Home"; ?>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>< <? show_navigation($id); ?> <? show_content($id); ?>
>The other file "dynamic.php" has the following functions
>
>/* dynamic.inc.php */

Five (at least) problems:

1) you error message says that error occured on line 13 of index.php, but
the index.php file you show us does not have 13 lines in it.

2) You say the include file is called "dynamic.php", but the first line of
that file has "dynamic.inc.php" - which is it.

3) You should normally use "require" instead of "include" in this situation.

4) I'm guessing you are running with "register_globals" on, which not a
good idea; if it is off, the above code (line wid $id) will not work.

5) These problems have nothing to do with PostgresSQL, so this post is
off-topic. I suggest you find a php newbie list.

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Sarah, Godfrey, Matthew & Vera 2005-03-02 14:04:45 Re: PHP function error
Previous Message Sarah, Godfrey, Matthew & Vera 2005-03-02 13:53:03 PHP function error ** SOLVED **