scottybwoy Posted August 4, 2006 Share Posted August 4, 2006 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.phphome.php --> checks for authentication TRUE if not send to login.phplogin.php --> scans ActiveDirectory retrieves the name of user, checks to see if it exists in the Database if TRUE pass back to home.phphome.php --> loads home.confhome.conf --> defines styles+templates & calls config.incconfig.inc --> defines the Framework and Calls many classesIs 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. Quote Link to comment https://forums.phpfreaks.com/topic/16528-wheres-this-point-to-please-read-the-bottom-bit/ Share on other sites More sharing options...
Ninjakreborn Posted August 4, 2006 Share Posted August 4, 2006 config.inc would be dumb if you have includes doconfig.inc.php that's all I can say because I haven't gotten into php oop yet. Quote Link to comment https://forums.phpfreaks.com/topic/16528-wheres-this-point-to-please-read-the-bottom-bit/#findComment-69112 Share on other sites More sharing options...
scottybwoy Posted August 4, 2006 Author Share Posted August 4, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/16528-wheres-this-point-to-please-read-the-bottom-bit/#findComment-69122 Share on other sites More sharing options...
Ninjakreborn Posted August 4, 2006 Share Posted August 4, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/16528-wheres-this-point-to-please-read-the-bottom-bit/#findComment-69123 Share on other sites More sharing options...
scottybwoy Posted August 4, 2006 Author Share Posted August 4, 2006 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.localI 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] Quote Link to comment https://forums.phpfreaks.com/topic/16528-wheres-this-point-to-please-read-the-bottom-bit/#findComment-69175 Share on other sites More sharing options...
scottybwoy Posted August 4, 2006 Author Share Posted August 4, 2006 How do you flag messages as resolved Quote Link to comment https://forums.phpfreaks.com/topic/16528-wheres-this-point-to-please-read-the-bottom-bit/#findComment-69273 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.