Log in

View Full Version : can u check out this ones



zee000
02-09-2010, 07:49 AM
hi
can u check this coad and suggest me ones


<?php
include"conifig.php";
$password=$_POST['password'];
echo $_GET[username];

$pass=md5($_POST[password]);

mysql_query("UPDATE `table` SET `Password` = $pass WHERE `meconzee1_user` Loginname='".$_GET[username]."''");

echo "your password successfully changed";

mysql_close($con);

?>

this query is not working can u suggest any better code for me

Schmoopy
02-09-2010, 12:22 PM
Missing quotes in the $_POST variables, here you go:



<?php
include"conifig.php";
$password=$_POST['password'];
$user = $_GET['username'];

$pass=md5($_POST['password']);

if(mysql_query("UPDATE `table` SET `Password` = '$pass' WHERE `Loginname` = '$user' "))
echo "Your password successfully changed";
else
echo "Failed to change your password.";

mysql_close($con);

?>


Not quite sure about the "`meconzee1_user` Loginname" part.
You need to find out what field you want to compare.