WordPress.org

Ready to get started?Download WordPress

Forums

After User resets passwords wp_logout_url() not login out (1 post)

  1. thiesenmurray
    Member
    Posted 1 year ago #

    Hi guys,

    I've searched for this one a long time. I made an custom profile page for my users. They can update al their fields. There's also an option to reset and update the password. If they do, the password changes in de database. Everything works fine but if they want to logout, there appears a screen with the message if they are sure they want to logout. For the logout link I use:

    <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout" id="logout">Log uit</a>

    The logout links works great when a user doesn't update his password. I also deactivated all of the plugins and switched to the TwentyEleven theme but that didn't work out.

    This is the code to update the password:

    if($_POST["wachtwoord"] && $_POST["wachtwoord_herhaal"]) {
    		$wachtwoord = $_POST["wachtwoord"];
    		$wachtwoord_herhaal = $_POST["wachtwoord_herhaal"];
    
    		if($wachtwoord == $wachtwoord_herhaal){
    			$sql = "UPDATE wp_users SET user_pass = MD5('" . $wachtwoord . "') WHERE ID = '" .$current_user->ID. "'";
    		    $result = mysql_query($sql);
    		    if ($result) {
    		    	echo "<p>Het is gelukt, je wachtwoord is nu aangepast</p>";
    				$error = false;
    			}
    		} else {
    			echo "Je twee ingevulde wachtwoorden komen niet overeen, probeer het opnieuw";
    		}
    	} else {
    		echo "<p> Je moet beiden wachtwoord velden invullen";
    	}

    I hope somebody can help me with this one.

    Thanks in advance,
    Thijs

Topic Closed

This topic has been closed to new replies.

About this Topic