Ninjakreborn Posted October 11, 2006 Share Posted October 11, 2006 Is there a point in me having session start inclusion on a page by page basis.I know for database connection, I want it this way to save resources.What I am wanting to try.How do I set up voluntary inclusion.On a page by page basisLike I have one include, that is always included.then I have a bunch of other includes on that page, but none of them are included automatically, instead I would have to set them to true within the page itself, based on which one's I needed, this would prevent unnecessary parsing of the php engine??How do I do that. Quote Link to comment https://forums.phpfreaks.com/topic/23662-configurephp-specifically/ Share on other sites More sharing options...
trq Posted October 11, 2006 Share Posted October 11, 2006 What your talking about can't really be done unless your using objects in php5. Then, you can use the [url=http://au.php.net/autoload]autoload[/url] function.Otherwise, you'll have to manually include files as they are needed.You can also set a php.ini directive to include a file on every page, not sure what its called exactly off the top of my head, but search your php.ini and you should see it. Quote Link to comment https://forums.phpfreaks.com/topic/23662-configurephp-specifically/#findComment-107422 Share on other sites More sharing options...
Ninjakreborn Posted October 11, 2006 Author Share Posted October 11, 2006 I saw someone do something before, it worked, it was just with php, I was wondering if there were other ways.What he is doing is$variable ['something']['false'] = includeor whateverhe has been doing programming in php for well over 3 years, someone who has been training me, but I don't know what he is doing. then on the page he wants the include to work at, he just put's down like 1-2 words, and it's included in that page.He just puts$variable['true']and it includes the proper ones.Also for session starthe has something setupso at the top of the page, if he want's sessions start active, then when he includes his system file he simply types$sand session's are started, the same with mysql connect, but with it he does$mysql['c']['true']or something.I don't get it. Quote Link to comment https://forums.phpfreaks.com/topic/23662-configurephp-specifically/#findComment-107425 Share on other sites More sharing options...
trq Posted October 11, 2006 Share Posted October 11, 2006 They just seem like config file switches or something. eg... if you had a file [i]config.php[/i][code=php:0]<?php if ($c) { include "mysql.conn.php"; }?>[/code]then.. on your page you could have....[code=php:0]<?php $c = true; include "config.php";?>[/code]seems a very messy way to do things though IMO. Whats the harm in using includes? Thats exactly what they are there for? Quote Link to comment https://forums.phpfreaks.com/topic/23662-configurephp-specifically/#findComment-107427 Share on other sites More sharing options...
Ninjakreborn Posted October 11, 2006 Author Share Posted October 11, 2006 see, I was going to use a config file, and have my functions set up different based on what functions, like all file functions are going to be in file.inc.phpall validation related functions are in validation.inc.phpex-cetera, that's what I am working, on that was how I was thinking of setting it up, then have them all included on one page, with expressions to help me decide which ones are placed on the page. I could just let it include them all, but that is unnecessary parsing for the php engine, Iw ould rather have it include them on an add needed basis, but including them all individually, will just get annoying. Quote Link to comment https://forums.phpfreaks.com/topic/23662-configurephp-specifically/#findComment-107449 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.