title: Why isn't the response from Ajax showing?
body: <p>I'm passing values using ajax from a web page to a php file. The purpose is to pass database credentials to be able to test the database connection and get the result in return. I'm passing server name, username and password to the php file. The problem is that I'm not able to see the database connection response from the php file. </p>
  
  <p>This is how I call the function within document ready:</p>
  
  <pre><code>$('#dbconn').click(db_connect)
  </code></pre>
  
  <p>Here is my ajax code:</p>
  
  <pre><code>function db_connect(dbserver, dbuser, dbpassword) {
              var dbserver;
              var dbuser;
              var dbpassword;
              dbserver = $('input:dbserver').val();
              dbuser = $('input:dbuser').val();
              dbpassword = $('input:dbpassword').val();
              $.ajax({
              url   : "script/create_db.php", 
              type  : "POST",
              cache : false,
              data  : {
              dbserver : dbserver,
              dbuser : dbuser,
              dbpassword: dbpassword,
              success: function(result){alert ("response")}
              }
              });
          };
  </code></pre>
  
  <p>And this is my php code:</p>
  
  <pre><code>$servername  = $_GET["dbserver"];
  $username = $_GET["dbuser"];
  $password = $_GET["dbpassword"];
  $conn = new mysqli($servername, $username, $password);
  // Check connection
  if ($conn-&gt;connect_error) {
  die("Connection failed: " . $conn-&gt;connect_error);
  } 
  else{
   echo "Connection succsess";
   }
  </code></pre>
  
  <p>Any help is highly appreciated</p>