Fehm
04-04-2009, 01:12 PM
Ok, So i have this form and a PHP processing file, their extremely simple (Ive added no security as of yet!)
Everytime I press submit the form does what its supposed to do but 'password' doesnt insert into the database: can anyone help me??
Thanks in advance!
<html>
<form id="register" method="post" action="newuser.php">
Username:<br />
<input type="text" name="username" /><br /><br />
Password:<br />
<input type="password" name="password" /><br /><br />
Rank:<br />
<input type = "radio" name = "rank" value = "1" /> Admin <br/>
<input type = "radio" name = "rank" value = "2" /> Forum <br/>
<input type = "radio" name = "rank" value = "3" /> News <br/>
<input type = "radio" name = "rank" value = "4" /> Events <br/>
<input type = "radio" name = "rank" value = "5" /> Radio <br/>
<input type="submit" name="submit" value="Create" />
</form>
</html>
Thats the form
This is the PHP:
<?php
include ("config.php");
$user = ($_POST['username']);
$password = ($_POST['password']);
$rank = ($_POST['rank']);
mysql_query("INSERT INTO users (username, password, rank)
VALUES ('$user', '$password', '$rank')");
?>
Excuse the basic-ness!
+rep for any help, and my upper most gratitude! :)
Everytime I press submit the form does what its supposed to do but 'password' doesnt insert into the database: can anyone help me??
Thanks in advance!
<html>
<form id="register" method="post" action="newuser.php">
Username:<br />
<input type="text" name="username" /><br /><br />
Password:<br />
<input type="password" name="password" /><br /><br />
Rank:<br />
<input type = "radio" name = "rank" value = "1" /> Admin <br/>
<input type = "radio" name = "rank" value = "2" /> Forum <br/>
<input type = "radio" name = "rank" value = "3" /> News <br/>
<input type = "radio" name = "rank" value = "4" /> Events <br/>
<input type = "radio" name = "rank" value = "5" /> Radio <br/>
<input type="submit" name="submit" value="Create" />
</form>
</html>
Thats the form
This is the PHP:
<?php
include ("config.php");
$user = ($_POST['username']);
$password = ($_POST['password']);
$rank = ($_POST['rank']);
mysql_query("INSERT INTO users (username, password, rank)
VALUES ('$user', '$password', '$rank')");
?>
Excuse the basic-ness!
+rep for any help, and my upper most gratitude! :)