Code:
[/CODE]
adduser.php
Apparently, on line 22, there's an error
I can't see it. As far as I can remember the only thing I changed in this page (as it was working before) was the addition of the username and password parts.
Here are the other pages. This one is the first one, you click the submit button which takes you to the above script.
Code:
users.php
Code:
[/CODE]
showusers.php
Code:
[CODE]
<?php
$con = mysql_connect("localhost","alpha_coll","college");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("alpha_coll", $con);
$sql="INSERT INTO Users (UserID, FirstName, LastName, Age, Username, Password)
VALUES
('$_POST[firstname]','$_POST[lastname]','$_POST[age]','$_POST[username]','$_POST[password]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added.";
mysql_close($con)
header("refresh: 5; index.php?page=showusers");
?>
adduser.php
Apparently, on line 22, there's an error

Here are the other pages. This one is the first one, you click the submit button which takes you to the above script.
Code:
Code:
[TABLE]
[TR][TD]Firstname:[/TD] [TD][/TD][/TR]
[TR][TD]Lastname:[/TD] [TD][/TD][/TR]
[TR][TD]Age: [/TD] [TD][/TD][/TR]
[TR][TD]Username: [/TD][TD][/TD][/TR]
[TR][TD]Password: [/TD][TD][/TD][/TR]
[TR][TD][/TD][/TR]
[/TABLE]
Code:
Code:
[CODE]
<?php
$con = mysql_connect("localhost","alpha_coll","college");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("alpha_coll", $con);
$result = mysql_query("SELECT * FROM Users");
echo "[TABLE]
[TR]
[TH]Firstname[/TH]
[TH]Lastname[/TH]
[TH]UserID[/TH]
[TH]Username[/TH]
[/TR]";
while($row = mysql_fetch_array($result))
{
echo "[TR]";
echo "[TD]" . $row['FirstName'] . "[/TD]";
echo "[TD]" . $row['LastName'] . "[/TD]";
echo "[TD]" . $row['UserID'] . "[/TD]";
echo "[TD]" . $row['Username'] . "[/TD]";
echo "[/TR]";
}
echo "[/TABLE]";
mysql_close($con);
?>
[URL=index.php?page=users]Add More Users[/URL]
showusers.php