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
Share on other sites

could you do something like

 

	
if(isset($_POST['submit'])) {
   $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
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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.