AJAX not requesting page properly

My problem is that when i click on “Change Passoword” it displays the contents of settings.php and then fades out immediately. I want that when somebody clicks on “Change Password”, they will on the same page see the form for changing password, with the URL as www.site.com/settings/index.php?tab=password. But when i click, it shows the form but, vanishes.


  header("Location: ../login.php");

require_once '../includes/connect.php';
require_once '../functions/siteFunctions.php';
require_once '../includes/activeheader.php';
require_once '../functions/confooter.php';


  if(empty($_POST['oldpass']) || empty($_POST['newpass']) || empty($_POST['rNewPass']) )
   $msg="All fields are required";



 <link rel="stylesheet" type="text/css" href="../style.css">
   var rqst;

   rqst = new XMLHttpRequest();
   function changePass() {
    rqst.onreadystatechange = function() {
       if(rqst.readyState==4 && rqst.status==200) 

<title>Accounts Settings</title>
	<style type="text/css">
      #old_pass_lb {
      	font-size: 15px;
       input.chg_yXcq03 {
       background-color: orangered;
       padding: 7px;
       font-size: 14px;
       font-family: calibri, sans-serif;

    input.chg_yXcq03:hover {
    background-color: rgb(237, 135, 98);
    cursor: pointer;

    p.cXyuPpwD_01 {
        color: red;

      li#cXyoig05_15 {
  list-style-type: none;

table.frgt_pass_frm_cXygIo15 {
  /* margin-top: 20px; */
  margin-left: 32px;
  /* margin-bottom: 10px; */
  padding: 20px 47px 7px 52px;
  border: 1px solid;

div#updt_info {
  padding-left: 20px;
  padding-right: 157px;
  margin-left: 960px;
  margin-right: 57px;

li#pdliu_2277 {
  list-style-type: none;


<div id='setting_cXygi01_sidebar_left' align="left">
  <table class="cXyhio02_setting_option_left">
     <a href="index.php?tab=password" onclick="changePass()">Change Passoword</a>
<div id="container_flt_cXygio_01">

that’s because the browser follows the link and loads the given resource.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.