do you mean a server that you go buy a store and why can i just install the mysql and phpmydamin on my computers hard drive or do they have online servers that you can signup for cause i cant afford a server and the sight and i followed these steps below from http://www.webdesign.org/web/web-programming/php/signup-and-login.4354.html
Learn how to have a user database where people can sign up and log in.
So you're ready to make your site a community and want to have a username and password entry for users? Well, this tutorial will show you how to easily make a script for users to create a username and password. The second part of the tutorial will show you how to have them log in the next time they come. You can see all these files for what I created and tested at: signup.txt, make.txt, login.txt, getin.txt. Let's get started.
Part I - Creating the registration
First and foremost, for this tutorial, you're going to need a *nix server running PHP, mySQL, and phpMyAdmin. First, we need to create a mySQL table which will store the user's name and password when they create it. So, log on to phpMyAdmin, and select your database. My database is called "spoono_db". Inside the database, we're going to have to create a table, so click the link of "spoono_db" on the left frame of phpMyAdmin and go to the bottom of the right frame where it displays "Create Table". We'll call it "users" and have 4 columns for it.
The three columns for the "users" table inside the "spoono_db" are:
id - which will be an int (auto increment, primary)
username - which will be text
password - which will be text
email - which will be text
Alright, so the table is created. Now, the next thing we have to do is create the HTML form where people can create their username and password. Create a blank file, copy the following code, and save it as "signup.html". Now here's the code for the form:
<form action="make.php" method="post">
Username Desired: <input type="text" name="username" size="10">
Password Desired: <input type="password" name="password" size="10">
E-mail: <input type="text" name="email" size="10">
<input type="submit" value="submit" name="submit">
</form>
Ok, that's a simple form which asks for the user to create a name and password. As you can see by the first line, the action of the form takes them to "make.php". So let's create a blank file called "make.php" and put this code:
<?
//replace username and password with your mysql name and password
$conn = mysql_connect("localhost","USERNAME","PASSWORD");
//select the database
$db = mysql_select_db("spoono_db");
$username = $POST["username"];
$password = $POST["password"];
$email = $_POST["email"];
//insert the values
$result= MYSQL_QUERY("INSERT INTO users (id, username, password, email)".
"VALUES ('NULL', '$username', '$password', '$email')");
echo "Your name and password have been submitted into our database 🙂";
?>
At first this code may look scary, but it's pretty simple. The first two lines connect to your mySQL database. For USERNAME and PASSWORD, put in your phpMyAdmin/mySQL username and password. The second line chooses the database where our table is stores, so I chose "spoono_db". The third line runs the mySQL query and inserts into the "users" table we made earlier the values of the name/password the person entered. Finally, the last line spits out a message saying their name was submitted.
Part II - Logging in with name and password
So now, your visitor has successfully created a name and password. Now, how does he log in? Well, first he has to go to a form and put his name and password. This will be almost identical to the signup.html. So create a file called "login.html" and place this code:
<form action="getin.php" method="post">
Username: <input type="text" name="username" size="10">
Password: <input type="password" name="password" size="10">
<input type="submit" value="submit" name="submit">
</form>
Again, it's identical to the signup.html except the action is now to "getin.php". So, the final step is to make the "getin.php". So create a new file and save it as "getin.php" and place this code:
<?
$conn = mysql_connect("localhost","USERNAME","PASSWORD");
$db = mysql_select_db("spoono_db");
$username = $POST["username"];
$password = $POST["password"];
$result = MYSQL_QUERY("SELECT * from users WHERE username='$username'and password='$password'")
or die ("Name and password not found or not matched");
$worked = mysql_fetch_array($result);
$username = $worked[username];
$password = $worked[password];
$email = $worked[email];
<?
if($worked)
echo "Welcome $user! Your e-mail address is $email";
?>
Check out that hunk of code 🙂 Alright, you should be familiar with the first two lines which just logs in and selects the database. The $result variable tries to select the name and password which match the ones they submitted. If it does, it goes on to the next line; if it doesn't, the code dies there and says the name wasn't found. Now, if it is found, the database returns the array with the name and password. You can see all these files for what I created and tested at: signup.txt, make.txt, login.txt, getin.txt. Pretty cool, eh? Hope this tutorial helps in making your community.
The only problem I found so far was when its says to copy the two php codes into two seperate blank files and save them as "make.php" and "getin.php" i would do that in notepad and it would save them as .php.txt then i posted a form about that and they said that i need to save it as all files but when i did that i dont know if it worked cause it still show it under text but also in all files too, but the php files i downloaded wernt text files they were ones that windows couldnt read so do i need to use a different program to to do this in and i what else do i need cuase the site i signup up for with mysql and phpmy admin in online and it is 2.2.0 and i have windows xp pro but if the php files are saved correct and i preview the signup page fill out the form and click submit wouldnt it work correctly for me on my computer if i have all the html pages and php files in the same folder and all the steps that it says to do above of if you go to the site is that all i have to do to get it to work correctly like i just said if i save all the files in the same folder or do i need to also install mysql and phpmyadmin in the folder to and how do i do that cause i downloaded a phpmyadmin version and it just had php files so do i just put those in the folder to and do i have to download a certain version of mysql and phpmyadmin.