Reputation: 51
I'm a total programming beginner trying to absorb HTML, PHP and MYSQL. This is my first question.
I plan to build a site that has an "admin" part and a registered user/member section that are displayed at the same time.
To give a better picture, think of YELP where there is the a part for the business-establishment's section on top and the reviews on the lower section. The difference is that the business owner/admin can access/edit the business section but will NOT be able to do so on the review part; vice-versa for the review/member-user on the bottom.
How should I plan to do the layout? WIll they be put together with two different PHP code under one html page?
Could someone please provide a layout-structure as guidance?
Example
<html>
<?php
include( businessowner_admin.php); //with all the validations etc.
inlude(registered_member.php); //with all the validations etc.
?>
</html>
Am I on the right path? Or is CSS needed to handle this?
Thanks Katy
Upvotes: 3
Views: 1022
Reputation: 26921
[preach mode on]
I think you're following the wrong way. It's generally a bad idea to have two almost completely unrelated set of functionality on a single page. And, an overall problem with PHP is that it makes incredibly easy to follow bad coding standards.
So, instead of providing you a good layout so you could toss in bad code (don't get it offensive, step one in every programmer's development - write bad code :))
vim
or emacs
- don't listen to them yet. Those are powerful beasts, but require huge amount of effort to learn and, hm... adopt them :))mysqli
or pdo
first, than move to some ORM
frameworks, like Doctrine2).All those mentioned instruments and techniques are free of charge, so the only resource required is your time, not money.
Move one step at a time. This path, walked the proper way, should not take less than a couple of months. But at the end you're going to be skilled wed-developer, suitable for the majority of the tasks.
[preach mode off]
As for the question, you'd better separate the "admin" and "frontend" pages, so you could manage access, content and styling easier. So, you could use some common parts, like header/footer, menu, etc. as an includes on those pages, but the pages itself better be separate in my opinion (and still, you'd better learn and use some
Upvotes: 4