This is just a thought in my head at the moment and I wanted to get some
opinions on an idea on how to design my web site.
First, it would be a 100% (or very close to it) PHP site.
The best way to descibe this thought would be to give a specific
example.
The site would revolve around a single .php file...index.ph p.
It is a two column site. The left column is a common navigation column
and the right column is (obviously) the content column.
The site also involve user registration and login for access.
So, if a user is not logged, the left column would contain the common
username and password fields. Just below these are two links 'Register'
and 'Forgot Password'.
Assume that a new user needs to register. They would then proceed to
click on the 'Register' link.
What I have found that most sites do would be to take the user to, for
example, http://<address>/register.php
Here is the meat of the alternative I was considering.
The 'Register' link would be:
http://<address>/index.php?func= register
Now, my php code would then see that 'func' was assigned and would call
a function that would put the appropriate content in the right column.
In the 'Register' case, it would be the standard request items ask of
users (e-mail, desired username, desired password).
In the same manner, the 'Forgot Password' link would be:
http://<address>/index.php?func= forgotpassword
Now, func would essentially represent top level sections of my site.
The top level sections will have sub-sections. I would handle this by
essentially doing the following:
http://<address>/index.php?func= <majorsection>& param1=someinfo rmation
To keep index.php from growing just far to big, the major sections would
be handled in their own .php files. index.php would basically be just a
large if/elseif statement based on what func said (or did not say).
If a user, who wasn't logged in, attempted to access part of the site by
providing a 'func', access would be denied via the common session
management provided by PHP.
What do people think?
--
== Eric Gorr ========= http://www.ericgorr.net ========= ICQ:9293199 ===
"Therefore the considerations of the intelligent always include both
benefit and harm." - Sun Tzu
== Insults, like violence, are the last refuge of the incompetent... ===