Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-28-2002, 02:59 PM   PM User | #1
bobtest
New to the CF scene

 
Join Date: Jul 2002
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
bobtest is an unknown quantity at this point
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.
bobtest is offline   Reply With Quote
Old 07-28-2002, 05:40 PM   PM User | #2
bobtest
New to the CF scene

 
Join Date: Jul 2002
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
bobtest is an unknown quantity at this point
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.
bobtest is offline   Reply With Quote
Old 07-29-2002, 02:57 AM   PM User | #3
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,911
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
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)
firepages is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:18 AM.


Advertisement
Log in to turn off these ads.