WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this Article to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES SUBMIT AN ARTICLE PRINT
Title : PHP for Beginners by a Beginner: Simple Login, Logout, and Session Handling
Categories : PHP, Sessions, Authentication
devarticles
devarticles
Date : 2004-02-20
Grade : 0 of 5 (graded 0 times)
Viewed : 8195
Search : More Articles by devarticles
Action : Grade This Article
Tools : My Favotite Articles


  Submit your own code examples 
 


In this article, James presents a very simple way to add login/logout security in PHP using session handling.First off, let me say that, yes, I am still a beginner with PHP. Throughout the course of learning PHP though, whenever I’m stuck I like to go online to some of the chat rooms and ask for help.

I have found, though, that the reputation of ‘computer geeks’, as parodied on Saturday Night Live, is well deserved by a lot of people. Asking for help from them was like asking them to let you borrow that authentic Klingon uniform they have in the display case down there with them in their parents’ basement (can you feel the love?). While I did find some help (after a lot of persistence), one thing I noticed with myself and with other novices was that the help came in a form as if we were on their level of programming, or we were met with a mass of arrogance and condescension, so, myself, I would still have to spend a couple of hours finding tutorials and articles here at DevArticles.com. But, I still had to have some things explained to me, which was a whole new task in itself.

As I’ve grown a little more with my skills in PHP though, I’ve also begun offering help to other beginners with what knowledge I have and can share. One of the biggest problems I always get asked about is how to protect an area with a login and with sessions. I do not claim that this method is the strongest or the most secure, but that it is a simple solution to a beginner’s problem.

One of my own preferences as a beginner when writing code is to use an editor, and one that is able to check the syntax as I have written it and return any errors. My own personal preference is one I have found to be a very good and inexpensive one. Ankord’s PHP Expert Editor , is, for me, a decent editor, and it only costs $35 to buy. You can also download a 30 day trial version from their site to try first. (No, I’m not affiliated with the company, I just like the product.) For it to check for syntax errors, you need to download and install the latest version of PHP.

This editor is just my own personal preference; you may have your own or prefer not to use one, and I make no claims regarding your own experience with this editor.

After trying a few different methods for simple form-based user authentication, I have found this method the least troublesome, especially when I wanted to add more to the authentication, such as simple access logging, but we will not be able to go into that here. This article does assume that you have some basic knowledge of PHP and HTML, but I hope that I have explained it in a way that any beginner can follow. I just wanted to share my knowledge of PHP that I have gained so far with other beginners, and would like to keep sharing it as I continue to progress.

Read More...









PHP 101 Part 10 of 15 : A Session In The Cookie Jar
Categories : PHP, Beginner Guides, Cookies, Sessions
Protecting PHP Scripts with HTTP Authorization
Categories : PHP, HTTP, Security, Authentication
PHP, MySQL and Authentication 101
Categories : PHP, Databases, MySQL, Authentication
Building a PHP Style Switcher
Categories : PHP, Sessions, Personalization and Membership
User Authentication With Apache and PHP
Categories : PHP, Web Servers, Apache, Authentication
Developing Custom PHP Sessions
Categories : PHP, Sessions
Exploring Session Security In PHP Web Applications
Categories : PHP, Security, Sessions, Web Applications
User Authentication With patUser (part 2)
Categories : PHP, Authentication, Security
Generating One-Time URLs with PHP
Categories : PHP, URLs
Data, its presentation and user interface forms
Categories : PHP, XML, User Interface
PHP CLI and Cron
Categories : PHP, CLI, Cron
PHP 101 Part 8 of 15 : Databases and Other Animals
Categories : PHP, Beginner Guides, Databases
Saving Images in MySQL
Categories : MySQL, PHP, Graphics, Databases
Introduction to WAP using WML, ASP and PHP
Categories : PHP, WAP, WML
Web Development With PHP FastTemplate
Categories : PHP, Templates, FDF