Hello, I'm really new to website making and I am making one for an assignment.
I have made one myself here http://fcsit-trackandtrace.webatu.com/

Now the part where I'm really confused is to make a user login system, any help on that?

Did you search this forum?

Yes I have, I've already made a database within myPHP in my hosting website. And now I'm having trouble connecting to the database from my website.

This is my registration.php


$user_name = "xxx";
$password = "";
$database = "website";
$server = "xxx";

mysql_connect($server, $user_name, $password);

mysql_select_db($database, $db_handle);

("INSERT INTO `website` ( `fname`, `lname`, `email`, `username`,`password`) 
echo "success";

And this is the signup.html:

<html><head><title>Sign Up</title></head>
<body bgcolor="yellow">
<p>Registration Form </p>
<form method="post" action="registration.php">
<input type="text" name="username">
<input type="password" name="pw">
<p>First name:</p>
<input type="text" name="fname">
<p>Last name:</p>
<input type= "text" name="lname">
<input type="text" name="email">
<input type="submit">

It just doesn't seem to work.

Am guessing you figured out mysql_query was missing?

No not really, I kinda put the codes in the wrong way in Dreamweaver but I solved that.

Now weird thing is I'm getting problems trying to connect to the mysql server.
It keeps saying this in error: "Host 'xx.xx.xx.xx' is not allowed to connect to this MySQL server in /xx/xxx/xxx/registration.php on line 2"

My current registration.php:
(Note: yes my username and database name is the same, I kinda accidentally named it the same)
(Note2: my webhost told me to use mysql2.000webhost.com as the host name)

mysql_connect('xxx.000webhost.com','xxx','xxx') or die("Cannot connect.");
mysql_select_db('xxx') or die("Cannot connect.");
("INSERT INTO `website` ( `fname`, `lname', `email`, `username`,`password`) 
echo "Registration success!";

Don't you have to allow your IP address in a remote SQL setting on your host for this to work?

Oh I kinda fixed it again, I made a new database with different username & database name and it works now.