Jump to content

Archived

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

scottybwoy

Where's this point to? please read the bottom bit

Recommended Posts

I am following a model for a database fountend for my company, but there are many functions that I don't want or want it to do a little differently.  I've only been working with php for about a month and have not really done much programming before apart from html.  So really what I have done is just ripped loads of stuff out of the code, and changed the folder framework about a bit to something I'm a bit more comfortable working with.

This Framework is highly Object Orientated and this is what I have it doing at the moment.

index.php --> just call's home.php

home.php --> checks for authentication TRUE if not send to login.php

login.php --> scans ActiveDirectory retrieves the name of user, checks to see if it exists in the Database if TRUE pass back to home.php

home.php --> loads home.conf

home.conf --> defines styles+templates & calls config.inc

config.inc --> defines the Framework and Calls many classes

Is this a good way of doing it or could I just put index, home, login all in one file and home.conf and config.inc together also?

At the moment when home.php sends to login.php it says it can't find the file, when it's pointing in the right direction, but because the user doesn't really need to see it unless they are not entered in the database, then a message appears (speak to me), does it really have to be in a seperate file.

Share this post


Link to post
Share on other sites
config.inc would be dumb if you have includes do
config.inc.php that's all I can say because I haven't gotten into php oop yet.

Share this post


Link to post
Share on other sites
Yeah, they all end in .php anyway, just shortened it for principals sake.  Do these files run differenly or what do they represent, apart from the obvious includes and config, is it just for names sake?

Back to original post, would it be ok for them to just be put in two files?  Would it slow things down?  Or am I on the right path?

Share this post


Link to post
Share on other sites
That's the thing about php, it's about imaginition, and fun.  As far as speed, it wouldn't make a bit of different either way, the speed factor is just associated mostly with major calculations, or a lot of db calls.  Unless unfortunately your just a shitty programmer, that needs to redo his form.  As people have said before being neat is important too, by what you are currently asking, it wouldn't show things down, I like keeping alot of things, I never have so far used includes for db connections or logins, I use db's for navigational bars and things like that, but I see how it could be useful.  because on the project I am working on right now, if we switched to postgresql you couldn't count the number of database connections I have to rewrite after that, so maybe it's helpful, just do what you think is right, you don't foul either way.

Share this post


Link to post
Share on other sites
Thanks Businessman,  it helps to just clear things up in my mind.  Also back to the end of my original post, where does this url lead to?

http://my-server.my.local/database/scripts/home/%5CdatabaseC:%5C%5CInetpub%5Cwwwroot%5Cdatabase%5Cscripts%5Clogin%5Clogin.php?url=http://my-server.my.local

I want it to goto the login.php, which is located where the URI is pointed, except not in the home folder.  And why would it specify the whole location like that?

I have an unmodified version that calls to /home/home.php but displays the login.php, and I can't find any differences, and I don't know which code it's in either?

Here's a snippet of home.php
[code]

  require_once "home.conf.php";

  require_once $MESSAGE_CLASS;
  require_once $INTRANET_USER_CLASS;

  /* Session variables must be defined before session_start() method is called */
 
  class IntranetUserHomeApp extends PHPApplication {

      function run()
      {
          global $TEMPLATE_DIR;
         
          $read = $this->getRequestField('read');

          if (! $this->authorize($this->getSessionField('SESSION_USERNAME')))
          {
            $this->alert('UNAUTHORIZED_ACCESS');
          }

          $this->uid = $this->getUID();

          $themeObj = new Theme($this->dbi,null,'home');

          $this->themeObj = $themeObj;

          $this->theme = $themeObj->getUserTheme($this->uid);

          $this->template_dir = $TEMPLATE_DIR;

          if (!empty($read))
          {
              $this->updateMsgTrack();
          }

          // At this point user is authorized
          $this->displayHome();
    }


      function authorize()
      {
          return TRUE;
      }
[/code]

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.