Hi all
I've been messing with PHP for a while now and have reached a point
where I can make it do just about anything that I want it to do. That
doesn't mean that I can make it do anything, far from it, just that I've
got to the point where I've got no 'real world' projects to further my
knowledge.
My next goal is to make my code much more graceful and efficient.
For example, I've written a CMS. To make this work, I have to create
about 5 or 6 template pages, eg:
1. content.php - this selects from the content table where id=x
2. news.php - this selects from the news table where id=x
3. allnews.php - this selects from the news table where today >
release_date and today < closing_date
I'm sure that there must be a better way of doing this so that if, for
example, a customer wants to change the look and feel of the site, I
only have to change ONE page instead of 5 or 6.
The problem is, I don't know what I should be learning about next. It's
like knowing that there's a more efficient way to get from A to B but
not knowing that you need to learn to drive because you don't know the
existence of cars, if that makes sense. I have a feeling that this
could all be accomplished through using functions in an external
functions.inc file or something. Should I be using case and switch and
passing some sort of 'action' flag with the URL - &flag=news or
something - so that it knows which query to run?
I'm just a bit lost now. I'm not looking for someone to do it for me
but maybe someone who can tell me what I should be reading about next.
Cheers
Andy
I've been messing with PHP for a while now and have reached a point
where I can make it do just about anything that I want it to do. That
doesn't mean that I can make it do anything, far from it, just that I've
got to the point where I've got no 'real world' projects to further my
knowledge.
My next goal is to make my code much more graceful and efficient.
For example, I've written a CMS. To make this work, I have to create
about 5 or 6 template pages, eg:
1. content.php - this selects from the content table where id=x
2. news.php - this selects from the news table where id=x
3. allnews.php - this selects from the news table where today >
release_date and today < closing_date
I'm sure that there must be a better way of doing this so that if, for
example, a customer wants to change the look and feel of the site, I
only have to change ONE page instead of 5 or 6.
The problem is, I don't know what I should be learning about next. It's
like knowing that there's a more efficient way to get from A to B but
not knowing that you need to learn to drive because you don't know the
existence of cars, if that makes sense. I have a feeling that this
could all be accomplished through using functions in an external
functions.inc file or something. Should I be using case and switch and
passing some sort of 'action' flag with the URL - &flag=news or
something - so that it knows which query to run?
I'm just a bit lost now. I'm not looking for someone to do it for me
but maybe someone who can tell me what I should be reading about next.
Cheers
Andy
Comment