SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast Zero G's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question include functions?

    Hey,

    I have been moving some of my functions into some include files but when ever I try to use one of the functions PHP tells me that there’s an error on that line. Is there anything special that you have to do to use functions from include files?

  2. #2
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    can we see the code you're using?

    If you do it like they show at www.php.net/include you'll be fine.
    Mike
    It's not who I am underneath, but what I do that defines me.

  3. #3
    SitePoint Enthusiast Zero G's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heres what i was doing

    the include... (tstinc.php)
    PHP Code:
    <?php
     
    function SayHello() {
        echo(
    "Hello Web!");
     }
    ?>
    the php page
    PHP Code:
    <?php
      
    include("tstinc.php");
     
      
    SayHello();
    ?>

  4. #4
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Perhaps you don't have permission? Check to see what tstinc.php is CHMOD'd at. And are the files in the same directory?
    Mike
    It's not who I am underneath, but what I do that defines me.

  5. #5
    SitePoint Enthusiast Zero G's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have gotten includes to work when i do this

    PHP Code:
    <?php
      
    echo("hello web");
    ?>

  6. #6
    SitePoint Addict devil cat's Avatar
    Join Date
    Apr 2003
    Location
    Reno
    Posts
    344
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know that I have problems with using include files with the extension ".php". Still not sure why, but it's possible that you are having the same kind of problem.


Bookmarks

Posting Permissions

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