Results 1 to 5 of 5
-
24th Nov 2009, 06:14 PM #1OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comEasy 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: 5Join 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
-
24th Nov 2009, 07:47 PM #2Respected DeveloperWebsite's:
PlatinumW.org NexusDDL.com HD-United.org CheckLinks.org FLVD.orgNice trick Lite
, I always use this for classes, http://us.php.net/manual/en/language.oop5.autoload.php
Current projects:
Megaupload Premium Multifetch Script | FF Plugin: Tinypic and Imagevenue Image Remoter
Projects in hiatus:
IPB Linkchecker Bot | VB Linkchecker Bot
-
25th Nov 2009, 05:41 AM #3Member
holy crap
I always feel difficult to find relative paths
this will help me a lot
Thanks for sharing the tipCoding Horror Fan
I don't read PM's frequently .
-
25th Nov 2009, 06:28 AM #4Member
thanks for the share
-
25th Nov 2009, 09:18 AM #5OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comYes 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
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Easy To Start Home Business - Easy Formula to Be Successful
By GarryField in forum Webmasters, Money MakingReplies: 0Last Post: 25th Feb 2014, 12:57 PM -
Multiupload alternatives that includes Mediafire
By manic32 in forum File Host DiscussionReplies: 8Last Post: 17th May 2012, 03:32 PM -
[Selling] NeoDDL.net Starting Bid: 6$ (Includes NeoShare.net)
By Laz0r in forum Completed TransactionsReplies: 0Last Post: 30th Sep 2011, 11:49 AM -
Warning: require_once(includes/class_yui.php)......
By Mitko06 in forum Technical Help Desk SupportReplies: 8Last Post: 17th Jan 2011, 10:50 AM -
New Rapidleech| includes 7 Premium Accounts
By andrezman in forum Webmaster ResourcesReplies: 10Last Post: 25th Jul 2010, 12:51 PM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...