timbaker1991
01-23-2010, 11:40 PM
Hi, ive been stugling with this update form for updating password in a databse
There's two paes, the form and the 'proccessor' can anyone help my as too why its not working? thanks
Form
[CODE]
<form enctype="multipart/form-data" action="edit.php" method="POST">
Id to edit: <input type="text" name="user">
New src: <input type="text" name="password">
<input type="submit" name="edit" value="edit"></form> <br>
Proccessor page:
[CODE]
<?
$location = '*';
$database = '*';
$username = '*';
$password = '*';
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
if(isset($_POST['edit']))
{
$use=($_POST['user']);
$pass=($_POST['password']);
mysql_query("UPDATE user SET password=$pass WHERE username=$use") or die (mysql_error());
}
?>
Or alternatively does anyone have any good resources for php update - google'ing has proved very un successful for this!
Cheers Tim
There's two paes, the form and the 'proccessor' can anyone help my as too why its not working? thanks
Form
[CODE]
<form enctype="multipart/form-data" action="edit.php" method="POST">
Id to edit: <input type="text" name="user">
New src: <input type="text" name="password">
<input type="submit" name="edit" value="edit"></form> <br>
Proccessor page:
[CODE]
<?
$location = '*';
$database = '*';
$username = '*';
$password = '*';
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
if(isset($_POST['edit']))
{
$use=($_POST['user']);
$pass=($_POST['password']);
mysql_query("UPDATE user SET password=$pass WHERE username=$use") or die (mysql_error());
}
?>
Or alternatively does anyone have any good resources for php update - google'ing has proved very un successful for this!
Cheers Tim