The form action tells the form where the information should be going once the submit button is clicked. Next, the method tells it how the information should be transmitted. In PHP there are two methods for tranmitting information,

Post

Get

Remember visiting Youtube and seeing youtube.com/watch?v=mEj-88iLjmM&feature=popular? This was submitted using a get, because you can see everything that is going on.

In cases where security is important this is not system, we do not want people to be able to hi-jack our login credentials.

We have basic input boxes. The “name” value is what is transmitted to the subsequent PHP pages.

Connecting to a database

Make a new document and name it: “connection.php”. This document will store the database connection information.

We have the variables stored with our database information, now we need to do something with them. Take the server location (most cases its localhost), database user, and database password and connecting. or die(mysql_error()) says, if connection does not complete, give us an error message.
Next, we select the database, and if something went wrong there, we display another error message.

We want to include this on every page that needs database access.

The Money Maker

Once the user inputs their username and password they should be in. One last thing is missing from the equation. Our user is logged and has a session, how do we log them out?