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.

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.

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.