Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

configure.php specifically

Recommended Posts

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 basis

Like 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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'] = include
or whatever
he 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 start
he has something setup
so at the top of the page, if he want's sessions start active, then when he includes his system file he simply types
$s
and session's are started, the same with mysql connect, but with it he does
$mysql['c']['true']
or something.
I don't get it.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.php
all validation related functions are in validation.inc.php
ex-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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.