Jump to content

configure.php specifically


Ninjakreborn

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.