Jump to content

Page Modes


smerny

Recommended Posts

I'm still fairly new to PHP and I just want to make sure I develop the right habits.Is it better practice to use page modes so that you have less pages? For example I could have one page for each: login, logout, edit, createor I could use one page called account or member or something and use links like <a href="account.php?mode=create">Register</a>...Is it just designer preference or is one better practice than the other or what?

Link to comment
Share on other sites

Traditionally, when you have logins, you have a "Login" and "Register" link next to each other. Near the username and password boxes, regardless of where they are (on all other pages, or on a separate page), you should also have the "Register" link.If you have a separate login page, then once logged in, the login link should turn into a log out link, and the register link should turn into a "Profile" link, or shuold I say "edit". The reason is, of course, that those two actions (loging out and editing) are only applicable to logged in users.From the end user's point of view, as long as you follow the above, it doesn't really matter how is your file system structured.From a developer's point of view, I'd have one page for registering and one for logging in. The rest should be embedded into the rest of the site, with links to those two when not logged in. The "Profile" page should be part of the "rest of the site", since it's still something for logged in users only. By that I mean that (in my point of view at least) a separate page should be created only when it's applicable to all users (logged in or otherwise), and when something needs to be partially hidden, it should be embedded into something that checks if the conditions are met.That last one is of course subjective. I'm sure other people might come up with their own answers for their own reasons.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...