Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Using function libraries with my PHP Script. How?

    Hi. I have a function library that I want to use with a script I am writing. I am using the include("script.php"); command inside my script but when I use any of the functions it tells me they are undefined. What am I doing wrong? Thanks.

  • #2
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Server stuff

    I used phpinfo() to look at the server configuration of my remote server. I specifically looked at

    include_path .:/usr/local/lib/php .

    I am trying to use a class file in the

    include("script.php");

    part of my php script. do i need to put "script.php" into this location? If so - how do i access .:/usr/local/lib/php ?

    Thanks.

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    Where is your class? if its in the same directory then it should work, PHP looks first at where you say your script is , oin your case the same directory & if it can not find it there it looks in your include path (which you really would not be using on a shared host)

    but are you getting an error from the include() ?
    try
    require('script.php');echo "script.php has been found";

    if your page does not die at that line then your class has been included but there is an error within it which is why you get undefined function warnings
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

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