Activity Stream
48,167 MEMBERS
6884 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com

    Default Easy php includes

    just like to share a tip with you for when your programming your websites etc

    PHP Code: 
    //Index.php

    /*
    ** First we need to know the exact path to where we am and define it
    */

    define("APPLICATION_PATH",str_replace("\\","/",dirname(__FILE__)));

    //then we need tell PHP to add our includes path to there own

    $current_paths get_include_path();
    $new_paths = array($current_paths,APPLICATION_PATHS  "/includes/");
    set_include_path(implode(PATH_SEPARATOR,$new_paths));

    /*
    ** No usually you will have to include your files like so
    ** include 'includes/myfile.php';
    ** but we can include as below
    */

    require_once('myfile.php');

    //This way it will search for myfile.php in all the paths you add into the above array :) 
    litewarez Reviewed by litewarez on . Easy php includes just like to share a tip with you for when your programming your websites etc //Index.php /* ** First we need to know the exact path to where we am and define it */ define("APPLICATION_PATH",str_replace("\\","/",dirname(__FILE__))); Rating: 5
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  2.   Sponsored Links

  3.     
    #2
    Respected Developer
    Website's:
    PlatinumW.org NexusDDL.com HD-United.org CheckLinks.org FLVD.org
    Nice trick Lite , I always use this for classes, http://us.php.net/manual/en/language.oop5.autoload.php

  4.     
    #3
    Member
    holy crap
    I always feel difficult to find relative paths
    this will help me a lot
    Thanks for sharing the tip
    Coding Horror Fan
    I don't read PM's frequently .

  5.     
    #4
    Member
    thanks for the share

  6.     
    #5
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Yes desi boy i use that define in every script i build... its nix compatible and never faild me

    Also use the autoload feature along side this aswell for using non-public php includes

    function __autoload($Class,$args){
    include "../../system/"strtolower($Class) . ".php";
    return new $Class($args);
    }

    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Easy To Start Home Business - Easy Formula to Be Successful
    By GarryField in forum Webmasters, Money Making
    Replies: 0
    Last Post: 25th Feb 2014, 12:57 PM
  2. Multiupload alternatives that includes Mediafire
    By manic32 in forum File Host Discussion
    Replies: 8
    Last Post: 17th May 2012, 03:32 PM
  3. [Selling] NeoDDL.net Starting Bid: 6$ (Includes NeoShare.net)
    By Laz0r in forum Completed Transactions
    Replies: 0
    Last Post: 30th Sep 2011, 11:49 AM
  4. Warning: require_once(includes/class_yui.php)......
    By Mitko06 in forum Technical Help Desk Support
    Replies: 8
    Last Post: 17th Jan 2011, 10:50 AM
  5. New Rapidleech| includes 7 Premium Accounts
    By andrezman in forum Webmaster Resources
    Replies: 10
    Last Post: 25th Jul 2010, 12:51 PM

Tags for this Thread

BE SOCIAL