--- Michael Sullivan <[EMAIL PROTECTED]> wrote:

> Given the code below:
> 
> <?
>    session_start();
>    include("miscfunc.php");
>    $loggedin = get_var("loggedin");
>    
>    if (!isset($loggedin)) //Security code goes here
>    {
>       print "Not logged in.<br><br>\n";
>       include("index.php");
>    }
>    else
>    {
>       include("dbconnect.php");
>       .
>       .
>       .
>    }
> ?>
> 
> I'm getting this error:
> 
> Fatal error: Call to undefined function get_var() in
> /home/festival/webspace/html/dbconnect.php on line 3
> 
> Why is it that dbconnect.php that I'm including cannot make use of
> get_var() (included from miscfunc.php)?  Every other .php file in this
> project does this exact same thing perfectly.  Why is this particular
> script giving this error?  

Since your include() call does not have a path, it will try to locate it in the
same directory as the program currently running.  (This can get confusing when
there are multiple levels of include() or require()).  If it is not found in
the same directory, it will try to search the other directories in the
include_path.

Is this script in a different directory than miscfunc.php ?

A permission issue could cause the include() to fail.

Custom functions may be spelling and case sensitive.  I trust you have
double-checked this.

Have you made any changes to miscfunc.php recently which might create a parse
error?

One solution would be to use:

include_once("miscfunc.php");

at the top of your dbconnect.php script.

James D. Keeline
http://www.Keeline.com
http://www.ITeachPHP.com



Community email addresses:
  Post message: php-list@yahoogroups.com
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-list/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to