Are you after a website overseen by a membership arrangement involving usernames and passwords?
“Oh well … but how about you over there?”
“No … oh … well … but it stands to reason in our street there’s bound to be one.”
Yes, a membership website is a common sight (and site … chortle, chortle), and a common requirement on the internet. You can just display information without it, sure, but if you want interaction from a known user, then you’ll want to involve a membership website.
Today we start you off with those login basics of a username and password, and get as far as a webpage arrangement for non-login pages that acts a lot like a template … but we are not calling it this … though you can turn it into a template scenario should you wish.
Anyway, the work is in PHP, and when we started considering it with reading of these two great books …
- PHP and MySql Web Development by Luke Welling, Laura Thomson … chapter 27
- Professional PHP Programming by Jesus Castagnetto, Haeish Rawat, Sascha Schumann, Chris Scollo, Deepak Veliath … chapter 20
… we saw that there was an alternative idea to the old HTML form element POST (or perhaps GET) method idea … so that we considered both …
- HTTP 401 authorization method (with MySql database)
- HTML form POST method (with MySql database)
… and it became apparent after a while that option 2 was a lot better way to go … though the HTTP 401 authorization method could be useful, accidentally, if by some weird arrangement you are happy to allow access to a functionality by one successful login until that browser is closed (plus some perhaps?).
Okay, but let’s concentrate on option 2 because it allows for more personal control, rather than relying on Apache (web server) concepts.
With both options, actually, you can, with a simple requirement, think of (a lot of) the (core of the) job as …
- login page is the landing page and establishes user credentials
- non-login pages (even the page of the natural web flow (ie. navigation) after the login page, which we called a member page), in simplified thinking, can all start out looking very similar, with the one difference being the answer to “what is the next page called in the natural web flow?”
… so that non-login pages must be supplied a mechanism to prove that the login page (successfully negotiated) has preceeded them … look into the use of ideas such as …
- PHP $_SESSION[] variables
- form POST settings via the calling webpage
- form GET settings via the calling webpage
- web browser cookies
- perhaps the whole job can be achieved using Ajax techniques and not leaving the login webpage
… and we used the “form POST settings via the calling webpage” as our mechanism of preference.
The proof of the pudding of a reasonable working website arrangement is to type into the address bar one of the “non-login pages” and see what happens … there is a difference in thinking, for my mind between …
- navigating within the normal working web flow (ie. not using the address bar URL at any time other than to get to the “login page”)
- using the address bar URL to jump to somewhere (as we are suggesting with the test above)
… and we’ve made it with the PHP code logic that if the second method happens, they’ll be forced to login again to continue, though can see that this is a debatable behaviour, as you may wish them to be able to do this and not have to login again. One thing is for certain though, and that is that they should not have to login again with “navigating within the normal working web flow” if they have already successfully logged in, unless you introduce a timer that makes the session peter out after a certain time. We haven’t got one of these timers, here, today, but you’d probably want to use a PHP $_SESSION[] arrangement to make this happen.
So why not try the “HTML form POST method (with MySql database)” membership website arrangement as a live run at live run? (Hint: username=myuser password=mypassword)
We’ve done those skeletal codings for 3 pages, but the difference between the second and third is negligible (I feel a template coming on?!) …
- login.php (PHP source code login.php) is the landing page that is helped along by db_connect.php (as an include file handling the connection to the MySql database), calling in the normal web flow …
- member.php (PHP source code member.php) is the page to go to after logging on, for our web application at least, calling, next, in the normal web flow …
- next.php (PHP source code next.php) is a “next” page (whose nextagain.php proposed web page was not written … but see what happens trying to go here) that is so very similar to member.php as per this link
… as you may have seen, a lot of the work occurs with the membership “logging on” logic.
Of course it must be said that there are many worked through websites out there in “Open Source” land (such as on GitHub or SourceForge repositories), and you may wish to go down that route. Sometimes, though, it is good to work through issues yourself to help aid understanding, and you may want to augment the words of this blog posting with a view of tutorial slides of a slideshow here.
If this was interesting you may be interested in this too.
Hello it’s me, I am also visiting this site on a regular basis, this web site is
genuinely nice and the viewers are really sharing nice thoughts.
Paragraph writing is also a excitement, if you be
acquainted with then you can write or else it is complicated to
write.
You are my inhalation , I have few blogs and infrequently run out from to post .I conceive this site holds some really wonderful info for everyone. “Only the little people pay taxes.” by Leona Helmsly.
Hello there, You have done a great job. Iβll definitely digg it and personally recommend to my friends. I’m confident they’ll be benefited from this website.
Is not it superb once you uncover an excellent post? Is not it amazing after you come across a great post? Great beliefs you’ve got here.. Wonderful beliefs you’ve got here..
This internet web site is my aspiration, very exceptional style and design and Perfect subject matter.
I would like to thnkx for the efforts you have put in writing this blog. I’m hoping exactly the same high-grade web site post from you within the upcoming also. In fact your creative writing abilities has inspired me to get my own web site now. Actually the blogging is spreading its wings quickly. Your write up can be a excellent example of it.
hi!,I really like your writing so a lot! percentage we communicate extra approximately your post on AOL? I need a specialist in this space to resolve my problem. Maybe that is you! Having a look forward to look you.
I together with my buddies were found to be going through the excellent secrets on your site and all of the sudden I got an awful feeling I had not expressed respect to the website owner for those strategies. All the ladies were excited to learn them and already have clearly been taking pleasure in these things. Thanks for genuinely very kind and then for deciding on this form of remarkable issues millions of individuals are really wanting to learn about. My honest apologies for not expressing gratitude to you sooner.
My wife and i got quite fortunate when John could deal with his research because of the precious recommendations he obtained from your web pages. It is now and again perplexing just to always be giving out helpful tips that many many people might have been selling. Therefore we do understand we need the writer to appreciate because of that. All of the explanations you made, the easy website navigation, the relationships you will give support to foster – it’s got mostly awesome, and it is letting our son in addition to our family imagine that the idea is fun, and that is wonderfully mandatory. Many thanks for the whole lot!
Some genuinely fascinating data, well written and broadly user pleasant.
It‘¦s really a cool and useful piece of info. I‘¦m glad that you simply shared this useful info with us. Please stay us up to date like this. Thanks for sharing.
Extremely handy perception, thanks for giving.. Recognize the value of the posting you made available.. So content to have identified this publish.. Isn’t it awesome any time you acquire a good publish?
hello there and thank you for the information – I’ve undoubtedly picked up something new from right here. I did even so expertise some technical points applying this net website, since I experienced to reload the web site a great deal of times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that Iβm complaining, but slow loading instances times will pretty frequently affect your placement in google and can damage your excellent score if ads and marketing with Adwords. Effectively I am adding this RSS to my e-mail and could appear out to get a lot a lot more of your respective intriguing content material. Ensure that you update this again really soon..
I donΓ’β¬β’t normally look at these types of web sites (IΓ’β¬β’m a pretty modest person) – but even though I was a bit shocked as I was reading, I was surely a bit excited as properly. Thanks for generating my day
Fantastic post, I conceive internet site owners really should learn a good deal from this internet blog its rattling user genial .
As I internet site possessor I think the content material material here is really superb , appreciate it for your efforts.
I am no longer positive where you are getting your info, however good topic. I needs to spend some time finding out more or working out more. Thanks for fantastic information I used to be on the lookout for this info for my mission.
What i don’t understood is actually how you are now not really a lot more smartly-appreciated than you might be now. You are so intelligent. You recognize therefore significantly with regards to this matter, made me in my opinion imagine it from numerous numerous angles. Its like women and men don’t seem to be involved except it is one thing to do with Girl gaga! Your own stuffs nice. At all times deal with it up!
All of the major broadcast networks now provide a great selection of some of your favorite tv shows for you to watch online and most of them are available to be streamed onto your computer by the time you wake up the morning after its network broadcast. Want to know if Jack Bauer managed to save Los Angeles again last night? Now you can watch him in action at Fox’s website. Wondering if they’ve given us any more answers about the island’s mysterious secrets on Lost? Surf on over to ABC.com. Need to know if Gil Grissom has caught the miniature killer yet? The answers are waiting for you at CBS.com. Will the Heroes keep New York from blowing up? Catch the latest episode online at NBC!
Well I definitely enjoyed reading it. This post procured by you is very effective for good planning.
Useful information. Lucky me I found your site by chance, and I’m surprised why this twist of fate didn’t took place earlier! I bookmarked it.
I have been checking out some of your posts and it’s pretty good stuff. I will make sure to bookmark your blog.
Thank you for every other informative web site. Exactly where else could I get that type of info written in such a perfect indicates? IΓ’β¬β’ve a mission that IΓ’β¬β’m just now operating on, and IΓ’β¬β’ve been at the appear out for such information.
I like this web site extremely significantly, Its a really nice situation to read and get information .
hey was just seeing if you minded a comment. i like your web site and the theme you picked is super. I will probably be back.
Beneficial information. Fortunate me I discovered your internet site by chance, and IΓ’β¬β’m surprised why this twist of fate didnΓ’β¬β’t happened earlier! I bookmarked it.
As a Newbie, I am always exploring online for articles that can aid me. Thank you
Great write-up, I‘¦m normal visitor of one‘¦s website, maintain up the excellent operate, and It’s going to be a regular visitor for a lengthy time.
Imagine, we can all learn Spanish easily at home.
Good thoughts you have got here.. Very interesting mindset, thanks for blogging.. Isn’t it excellent any time you acquire an excellent submit? of course, analysis is having to pay off.
My brother recommended I might like this blog. He was once totally right. This post truly made my day. You cann’t believe just how a lot time I had spent for this info! Thank you!|
Seriously very helpful perception, many thanks for sharing.. Wonderful views you have got here.. So pleased to possess discovered this post.. Adoring the contribution.. thanks alot
All custom premade files, many of them dirt cheap or free for download at http://scarab13.com.
Thank you.
My video player in joomla doesn’t play videos in firefox if the latest flash player isn’t installed. I’d like to have it like a professional player to show a dialog saying: “Do you want to install flash player 10″ or how it says when you go to a professional website so users don’t have to search and download flash player manually…. . Does anyone know, how to do this?.
I understand how to use Banners in Joomla, but the banners are not displaying. How do I choose where the banners show up? I see no option for that. Its published..