#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    france
    Posts
    35
    Rep Power
    15
    Sorry for the last one )

    I'd just like to know where I can put functions or classes I'd like to use in several pages of my site.

    Is there some kind of inheritance or do I have to include them in a file I call every time a page opens ?

    Thanks

    -
    J0f
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    If you have access to hte php.ini file you can set the auto_prepend_file to a file that holds the classses you want to use on every page, but you will still need to instantiate it on the page like

    $class = new Yourclassname;

    I prefer not to use the auto_prepend because it will show up on every page. I prefer to just include the page at the top of the pages I want to use it on like:

    include("./myclasses");
    $class = new Yourclassname;

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 11:45 PM
  2. problem with functions
    By veni123 in forum C Programming
    Replies: 8
    Last Post: February 5th, 2004, 03:22 PM
  3. Functions page - php, mysql
    By liberate in forum Project Help Wanted
    Replies: 1
    Last Post: January 22nd, 2004, 12:44 PM
  4. Functions page - php, mysql
    By liberate in forum PHP Development
    Replies: 5
    Last Post: January 19th, 2004, 11:24 PM
  5. Certain functions not working with PHP 4.3.3
    By napoleon_bona_p in forum PHP Development
    Replies: 2
    Last Post: January 14th, 2004, 03:02 AM

IMN logo majestic logo threadwatch logo seochat tools logo