Jquery Ajax method POST does not work on hosting : I've been working on a website for quite some time, but it was all done on localhost. After making login form work properly I decided to upload it to hosting.  
Issue is that callback functions of ajax don't seem to work if I use method: "POST".  
If I change POST to GET it will work...  
  
Ajax code:
  

    $.ajax({
          method: 'POST',
          url: "php/login.php",
          data: { username: val_username, password: val_password },
          success: function(response) {
            if (response == 0) {
              location.reload();
            } else {
              alert("Wrong username or password. Error #"+response);
            }
          }
        });

login.php

    <?php

    session_start();

    require "../php_includes/mysql.php";

    // Create connection
	$conn = new mysqli($db_server, $db_user, $db_pass, $db_name);
	// Check connection
	if ($conn->connect_error) {
	  die("Connection failed: " . $conn->connect_error);
	}

	// escape your parameters to prevent sql injection
	$username = mysqli_real_escape_string($conn, $_POST['username']);
	$password = mysqli_real_escape_string($conn, $_POST['password']);

	$sql = "SELECT * FROM korisnici WHERE username='$username'";
	$sql_result = $conn->query($sql);

	if ($sql_result->num_rows > 0) {
		$row = $sql_result->fetch_assoc();
		if (password_verify($password, $row["password"])) {
			$_SESSION["loggedin"] = true;
			$_SESSION["userid"] = $row["id"];
			echo 0;
		} else echo 2;
	} else echo 1;

	?>


I have checked all the file locations, no issue there, since everything works if I change method to GET. I tried changing datatypes in ajax, tried adding some headers to php file that I've found searching around stackoverflow, but nothing helps...