Jump to content


Photo

configure.php specifically


  • Please log in to reply
4 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 11 October 2006 - 01:30 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 11 October 2006 - 02:04 PM

What your talking about can't really be done unless your using objects in php5. Then, you can use the autoload 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.

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 11 October 2006 - 02:09 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 11 October 2006 - 02:16 PM

They just seem like config file switches or something. eg... if you had a file config.php

<?php
  if ($c) {
    include "mysql.conn.php";
  }
?>

then.. on your page you could have....

<?php
  $c = true;
  include "config.php";
?>

seems a very messy way to do things though IMO. Whats the harm in using includes? Thats exactly what they are there for?

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 11 October 2006 - 02:47 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users