Jump to content

Search the Community

Showing results for tags 'php5 mysqli ajax'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi guys, You have all really helped me. I am stuck on a php5, mysqli, ajax password reset from my mysqli table called table_sers for field name usernamesand set to varchar 255. I am having problems with this script and will appreciate any elp please. I want the script t be able to validate users email address from database before allowing user to change password. I have no idea if i should put MYSQLI_ASSOC //my ph mysqli script <?php //pchange.php include_once("db_gupta.php"); // this is my database path if(isset($_POST["table_users"]) && isset($_POST["User_pass1"]) && isset($_POST["User_pass2"])){ $id = $_SESSION['userid']; $password = md5($hash_pass); $sql = "SELECT from table_users WHERE email='$email' AND password='$hash_pass' id='$id'"; $sql = "UPDATE table_users SET password ='$hash_pass' WHERE id ='$id'"; $query = mysqli_query($db_gupta, $sql); if(mysqli_affected_rows()>0) echo "Password Changed Successfully"; else echo "Invalid "; } else echo "Invalid"; ?> //Main password ajax and html script <script language="javascript"> function submitform() { var User_Id=document.getElementById("table_users").value.match("^\\S[0-9a-zA-Z.-]*$"); var User_pass1=document.getElementById("User_pass1").value.match("^\\S[0-9a-zA-Z.-]*$"); var User_pass2=document.getElementById("User_pass2").value.match("^\\S[0-9a-zA-Z.-]*$"); document.getElementById("User_pass1").value=""; document.getElementById("User_pass2").value=""; if(User_Id==null || User_pass1==null) { alert("invalid user id/password"); document.getElementById("err").innerHTML="invalid user id/password"; return; } else if(User_pass2==null) { alert("invalid new password"); document.getElementById("err").innerHTML="invalid new password"; return; } else { var str="table_users=" + User_Id + "&User_pass1=" + User_pass1 + "&User_pass2=" + User_pass2; $.ajax({ type: "POST", url: "pchange.php", data: str, success: function(output){ alert( output ); document.getElementById("err").innerHTML=msg; } }); return; } } </script> <h2>Change Password</h2> Email: <input id="table_users" name="User_Id" type="text" /><br /> Old Password: <input id="User_pass1" name="User_pass1" type="password" /><br /> New Password: <td><input id="User_pass2" name="User_pass2" type="password" /><br /> <input name="text" onclick="submitform();" type="button" value="Submit" /> <input name="text" type="reset" value="Reset" /><br /> <span id="err"></span> Thanks once again.
×
×
  • 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.