Well guys, I always have a problem where by I can never decide or I'm never sure if the structure of my website is any good.
I'll explain the situation. I am a web developer for a company, and want to make sure my design and code is easy to follow. This is an example of the back end structure of the content management system:
./admin/ <----------- this is where the php files are. The aim is to keep php code out of it, and to have 99% html and 1% php. This is due to some designers needing to access the directory
./admin/include/ <------------ php files are in here, 99% php and 1% html. This is what is called from the ./admin/ files
So, in include I have the OO PHP files. In the ./admin/ directory I have mostly html like this:
<html>
.......... html ...... html.....
<body>
<?php $product = new Product; $product->list_products($_POST); ?>
</body>
</html>
So the php is hardly present.
In the php file, list_products is a form and table, then outputs the products. The administrator selects the product clicks the "edit", "delete" buttons and the form is posted to itself.
At the top of the php file is a switch that reads $POST['submit']. If it = "Edit" then it does: header("Location: ../admin/product-edit.php?id=$POST['id']&action='edit'
Not really sure if any of that made sense, but was just wondering if you think that is the best structure to follow. RE-USABILITY and maintenence are very very important.
What do you think? Did you even understand what I was trying to say ? 😃