Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9160841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:49:58+00:00 2026-06-17T13:49:58+00:00

I’ve made a settings page for users and the issue im having is that

  • 0

I’ve made a settings page for users and the issue im having is that after you send the form once and say you get an error like “Please fill in all fields” and then you go to submit it again it won’t echo out any more errors or success messages but it will update your password.

JS:

<script type="text/javascript">
    $(document).ready(function() {
        $("#changePassword").click(function(){
                var userIdSettings  = <?php echo $_SESSION['id']; ?>;
                var currPass        = $("#currentPass").val();
                var newPass         = $("#newPass").val();
                var newPassRe       = $("#newPassRe").val();
                $.post("inc/ajax.php", {userIdSettings: userIdSettings, currPass: currPass, newPass: newPass, newPassRe: newPassRe}, function(data){
                    $(".message").html(data).delay(2000).fadeOut('slow', function(){

                    });
                });
        });
    });
</script>

PHP:

  if ($_POST['userIdSettings']) {

    $userIdSettings     = $_POST['userIdSettings'];
    $currPass           = $_POST['currPass'];
    $newPass            = md5($_POST['newPass']);
    $newPassRe          = md5($_POST['newPassRe']);

    if (!empty($currPass) && !empty($newPass) && !empty($newPassRe)) {

        $data = new db();
        $data->dbConnect();
        $data->dbSelect();

        $currPass  = md5($currPass);
        $checkPass = mysql_query("SELECT * FROM users WHERE id = '$userIdSettings'") or die("Error: ".mysql_error());
        $checkPass = mysql_fetch_assoc($checkPass);

        if ($currPass == $checkPass['password']) {
            if ($newPass == $newPassRe) {
                mysql_query("UPDATE users SET password = '$newPassRe' WHERE id = '$userIdSettings'") or die("Error: ".mysql_error());
                echo '<div class="messages green large"><span></span>Your password has been updated!</div>';
                exit;
            } else {
                echo '<div class="messages red large"><span></span>Your new passwords dont match!</div>';
                exit;
            }
        } else {
            echo '<div class="messages red large"><span></span>Your current password is not correct!</div>';
            exit;
        }

    } else {
        echo '<div class="messages red large"><span></span>Please fill in all fields!</div>';
        exit;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:50:00+00:00Added an answer on June 17, 2026 at 1:50 pm
    $(".message").html(data).show().delay(2000).fadeOut('slow', function(){});
    

    Notice the .show()

    You are printing the data to the page, then using the fadeOut method, which at the end result sets display:none. Then you are trying to output more data, but the display is still none, resulting in nothing being displayed on the page, even though the DOM element is being updated. If you add the show() method, this will ensure the CSS value of display is set to block; show the new text for the DOM element; and then fadeOut… slowly… after 2 seconds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.