954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP Login Help?

I have started a new website and I know basic HTML but I am clueless with PHP. I need to set up a login system where members can save their info on the site. I need to learn PHP, cookies, and a login system. Thanks.

Rockout101
Newbie Poster
1 post since Jul 2008
Reputation Points: 10
Solved Threads: 0
 
I have started a new website and I know basic HTML but I am clueless with PHP. I need to set up a login system where members can save their info on the site. I need to learn PHP, cookies, and a login system. Thanks.

Hi hope this helps :) http://php.about.com/od/finishedphp1/ss/php_login_code.htm

they have all step by step procedures for creating a login system , setting cookies etc.

Kavitha Butchi
Junior Poster in Training
69 posts since May 2008
Reputation Points: 10
Solved Threads: 4
 

The way is:

You have to design the login page with two text boxes and then retrieve them and compare them with select statement with your database..
Then if it is ok ,navigate to another page like welcome.php...
Its very simple ,try....

Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
 

I have just completed a login system for a php site and although it is not open source I will tell you how it works. So for beginners, you will need to know the following:

Making sessions
http://www.tizag.com/phpT/phpsessions.php
http://au2.php.net/session_start
Making HTML Forms
The isset($_POST['variable']) command
MySQL querys
PHP Variables

And a few other small things. So to begin with, make a html page with a html login form then when it all looks perfect, change the extension to php and use the echo ""; command to show the page. Be sure not to use any double quotation marks ( " ) in your html codes otherwise you will come across problems.

After you have a html form, you have a php code at the beginning that detects if the form has been submitted. If the if function detects the form has been submited, then the script will attempt to connect to the MySQL database to check if the form details are valid. Then if the details are valid, a session is created. When the session is created, other parts of the website can see if the user is logged in. You then set the pages so that if there is no session in place, then the parts of pages (or even whole pages) will not load up.

Also if you are new to php then you should read some books and online tutorials about php before using it otherwise you may find yourself very lost. This is a brief post but I can explain more if you have any trouble understanding.

cwarn23
Occupation: Genius
Team Colleague
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You