ok, i used what u guys taught me to make the aministrator control panel(im makin a message board).
now, i made the user signup page:
Code: Select all
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Signup to the MessageBoards</title>
</head>
<body>
<h1>Message Boards</h1>
<h2>User Signup</h2>
<form method="post" action="signup2.php">
<h3>Type in your desired username:<br /></h3>
<input type="text" name="username">
<h3>Type in your desired password:<br /></h3>
<input type="password" name="password">
<br />
<input type="submit" value="Submit" name="submit" /><input type="reset" value="Reset" />
</form>
</body>
</html>
then the signup2.php page:
Code: Select all
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP page</title>
</head>
<body>
<?php
$newusername = $HTTP_POST_VARSї"username"];
$newpassword = $HTTP_POST_VARSї"password"];
$conn = mysql_connect("localhost", "", "");
mysql_select_db("guestbook", $conn);
$query = "INSERT INTO users(username, password) VALUES ($newusername, $newpassword)";
$result = mysql_query($query,$conn)or die("query failed");
if ($result != FALSE)
{
echo"Query Was Made.";
}
else
{
echo"Query was not made";
}
?>
</body>
</html>
again, it dosent work. im thinking because of the INSERT INTO thing where im using variables. plz help.