Jump to content

[SOLVED] Form not updating the DB


stelthius

Recommended Posts

Alright guys im back again, sorry! for some reason my form isnt updating the DB but it is printing out done as it normally would do once updating the DB any suggestions or ideas guys ?

 

$newpass = $_POST['forcednewpass'];
}
if($_POST['form'] == "userid"){
$userid = $_POST['userid'];
$password = md5($newpass);
mysql_query("UPDATE users SET password='$password', flag='0' WHERE username='$userid'") 
or die(mysql_error()); 	

print"done";
}

Link to comment
https://forums.phpfreaks.com/topic/166091-solved-form-not-updating-the-db/
Share on other sites

Alright after some fiddling im still not getting it to work here is my code...

 

$query="SELECT username FROM vs_users WHERE password = '$new_pass'";

$newpass = $_POST['forcednewpass'];
$newpassconf = $_POST['forcednewpass1'];
	if(!$newpass == $newpassconf){
		printf("<script>location.href='login.php?op=nopwmatch'</script>");
	}

	if($_POST['form'] == "userid"){
		$userid = $_POST['userid'];
		$password = md5($newpass);
		mysql_query("UPDATE vs_users SET password='$password', flag='0' WHERE username='$userid'") 
		or die(mysql_error()); 	

		printf("<script>location.href='login.php'</script>");

	}
}

 

Any help is appretiated i think im just missing something simple!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.