By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,876 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,876 IT Pros & Developers. It's quick & easy.

[Q] Opinions on this site design

P: n/a
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.php.

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=someinformati on

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... ===
Jul 17 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
"Eric" <eg*************@verizon.net> wrote in message
news:1g3sw11.le82pbmhdazrN%eg*************@verizon .net...
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.php.

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=someinformati on

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?


People think that this is done every day.

Jul 17 '05 #2

P: n/a
SwissCheese <Sw*********@cfl.rr.com> wrote:
People think that this is done every day.


Interesting.

I have yet to find a site that is based solely around this idea.
Can you point to one?

Now, considering that there is rarely a single solution that solves all
problems, in what ways would the design break down?
--
== 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... ===
Jul 17 '05 #3

P: n/a
Carved in mystic runes upon the very living rock, the last words of Eric
of comp.lang.php make plain:
SwissCheese <Sw*********@cfl.rr.com> wrote:
People think that this is done every day.


Interesting.

I have yet to find a site that is based solely around this idea.
Can you point to one?


I don't know that I'd say it's done every day. I don't have any
statistics or anything, but it seems to me more common to have different
functions in different files. That said, Phormation is done the way you
describe, with all links pointing back to the index file, which pulls in
code according to the functionality indicated.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #4

P: n/a
Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.php make plain:
Phormation is done the way you describe, with all links pointing back to
the index file, which pulls in code according to the functionality
indicated.


Sorry, I should have been more specific -- I didn't realize there were so
many Phormation's out there:

http://www.phorm.com/phormation.php3

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #5

P: n/a

"Eric" <eg*************@verizon.net> wrote in message
news:1g3sw11.le82pbmhdazrN%eg*************@verizon .net...
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.php.

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=someinformati on

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... ===


The only comments I can throw forward on this is that some search engines
might find difficulty in indexing any meta tags - but if its hidden behind a
username/password then I gather you're not too bothered on search engines -
Secondly, because you would have few (if any) static pages, you should
ensure your server could handle the traffic. PHP IMHO is not hungry, but it
will eat more resources than ordinary 'flat' or static html... Lastly... you
could encounter debugging problems since I believe any faults you do find
will only report the script name and not any arguements that might have been
passed.

I hope this gives you some food for thought...
Jul 17 '05 #6

P: n/a
eg*************@verizon.net (Eric) wrote in message news:<1g3t2yz.1a9e9lnp5sadbN%eg*************@veriz on.net>...
SwissCheese <Sw*********@cfl.rr.com> wrote:
People think that this is done every day.


Interesting.

I have yet to find a site that is based solely around this idea.
Can you point to one?


cars.webquezt.com They actually pass the commands by encoding.

But, IMHO people usually prefer individual files for individual
purpose (aka decentralized concept). It is easy to fix the problem, if
the entire code for the job is in individual files say signup.php,
login.php, etc.

---
"He who created the god was a fool; he who spreads his name is a
scoundrel and he who worships him is a barbarian."---Periyar, Famous
Tamil Rationalist
Email: rrjanbiah-at-Y!com
Jul 17 '05 #7

P: n/a
eg*************@verizon.net (Eric) schrieb:
What do people think?


It doesn't look unusual.

Regards,
Matthias
Jul 17 '05 #8

P: n/a
Eric wrote:
What I have found that most sites do would be to take the user to, for
example, http://<address>/register.php
Yes, this is generally the better from what you intent below.
Here is the meat of the alternative I was considering.

The 'Register' link would be:

http://<address>/index.php?func=register


http://www.w3.org/Provider/Style/URI

http://www.w3.org/QA/Tips
http://www.w3.org/QA/Tips/readable-uri
http://www.w3.org/QA/Tips/uri-choose

--
Stanimir

Jul 17 '05 #9

P: n/a
On Sun, 02 Nov 2003 20:15:22 GMT, eg*************@verizon.net (Eric)
wrote:
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. ....
What do people think?


What do you wish to achieve with this approach? It seems slightly more
complex than the straightforward approach, and I can't immediately see
the advantage.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 17 '05 #10

P: n/a
Randell D. <yo**************************@yahoo.com> wrote:
The only comments I can throw forward on this is that some search engines
might find difficulty in indexing any meta tags - but if its hidden behind a
username/password then I gather you're not too bothered on search engines
Right...do not want the search engines to index beyond the default page
that would appear when no 'func' was defined.
Secondly, because you would have few (if any) static pages, you should
ensure your server could handle the traffic.
Good point. My page will be a low traffic one.
Lastly... you could encounter debugging problems since I believe any
faults you do find will only report the script name and not any
arguments that might have been passed.
Another good point. I agree, it is unlikely that arguments passed would
be directly reported, but I believe the URL being used would be
available in the field and that should provide sufficient information as
I will be using the GET method.

If nothing else, if a problem is experienced, the path to that problem
should be known and would provide sufficient information to aid in
solving the problem.
I hope this gives you some food for thought...


It did. Thank you.

--
== 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... ===
Jul 17 '05 #11

P: n/a
Stanimir Stamenkov <s7****@netscape.net> wrote:
Here is the meat of the alternative I was considering.

The 'Register' link would be:

http://<address>/index.php?func=register


http://www.w3.org/Provider/Style/URI
http://www.w3.org/QA/Tips
http://www.w3.org/QA/Tips/readable-uri
http://www.w3.org/QA/Tips/uri-choose


That is some great information. Thank you.

I shall have to reconsider my approach.
--
== 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... ===
Jul 17 '05 #12

P: n/a
"Eric" <eg*************@verizon.net> wrote in message
news:1g3t2yz.1a9e9lnp5sadbN%eg*************@verizo n.net...
SwissCheese <Sw*********@cfl.rr.com> wrote:
People think that this is done every day.


Interesting.

I have yet to find a site that is based solely around this idea.
Can you point to one?

Now, considering that there is rarely a single solution that solves all
problems, in what ways would the design break down?


Eric,

It really depends on what you are trying to accomplish for yourself. Why
are you trying to keep everything together in one file - what is the
purpose? The only upside I can think of is that you would have only one file
for the server to cache so that may be a little faster. I have a site that
i'm planning and my first thought was to do it the same way - but the more
my plan comes together the more it seems rediculous to try to jam all the
functionality into one file. Just the overhead of all the error checking
every time you add new functions...
Jul 17 '05 #13

P: n/a
Stephen Poley <sb*****@xs4all.nl> wrote in message news:<4c********************************@4ax.com>. ..
On Sun, 02 Nov 2003 20:15:22 GMT, eg*************@verizon.net (Eric)
wrote:
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.

...
What do people think?


What do you wish to achieve with this approach? It seems slightly more
complex than the straightforward approach, and I can't immediately see
the advantage.


The idea is centralized approach.

For example,
if ($func=="register")
include("includes/register.inc.php");
else if ($func=="login")
include("includes/login.inc.php");
....

The problem with this approach is debugging (by 3rd programmer).

Also, you'll suffer search engine ranking problem if you don't
have mod rewrite facility as the URI is somewhat messy.

---
"Success = 10% sweat + 90% tears"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #14

P: n/a
Sometime around 3 Nov 2003 20:43:11 -0800, R. Rajesh Jeba Anbiah is
reported to have stated:
"Success = 10% sweat + 90% tears"


Success is very wet.

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 17 '05 #15

P: n/a
Mark Parnell <we*******@clarkecomputers.com.au> wrote in message news:<tt****************************@40tude.net>.. .
Sometime around 3 Nov 2003 20:43:11 -0800, R. Rajesh Jeba Anbiah is
reported to have stated:
"Success = 10% sweat + 90% tears"


Success is very wet.


Yeah :) I hope it is not dry

---
"If there is a God, he must be a sadist!"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.