is this wrong?
Posted: Fri Aug 07, 2009 7:58 am
Hi,
I am quite new to PHP but I am making a simple CMS as a fun project to help me test me knowledge. I have already made the log-in but the way I have developed it just seems too easy compared to other applications I have seen.
I have index.php and log-in.php then a data folder the data folder contains config.php and connect.php these handle the database connection and a few other things.
I also have a file called functions.php this is where I have been storing almost everything! (I also have images, css and jquery folders in this data folder)
So this functions.php document looks a little like this:
class user_functions {
function validate_user
{
some code
}
function log_out
{
some code
}
} ect...
so ill be adding more classes when I need them e.g. a class that contains functions that deal with site stats or functions for adding content etc..
I can then just call my functions from the login.php (like user_functions->validate_user) and it works beautifully and makes loads of sense to me.
but When i look at open source programs they user about 2 million different files to do the same job... where am i going wrong?
Thanks
Lawrence
I am quite new to PHP but I am making a simple CMS as a fun project to help me test me knowledge. I have already made the log-in but the way I have developed it just seems too easy compared to other applications I have seen.
I have index.php and log-in.php then a data folder the data folder contains config.php and connect.php these handle the database connection and a few other things.
I also have a file called functions.php this is where I have been storing almost everything! (I also have images, css and jquery folders in this data folder)
So this functions.php document looks a little like this:
class user_functions {
function validate_user
{
some code
}
function log_out
{
some code
}
} ect...
so ill be adding more classes when I need them e.g. a class that contains functions that deal with site stats or functions for adding content etc..
I can then just call my functions from the login.php (like user_functions->validate_user) and it works beautifully and makes loads of sense to me.
but When i look at open source programs they user about 2 million different files to do the same job... where am i going wrong?
Thanks
Lawrence