I have the following function in a .js file in index.html
function getValues(){
$.ajax({
type: \'POST\',
url: \"http://localhost/getData/getdata.php\
The web server is exactly what is handling all of the details for you.
You cannot POST without a web server to post to. HTTP = web protocol, so you cannot have a HTTP URL without a web server to target.
The web server is also the process that takes your request for a PHP page and runs the PHP interpreter, managing the inputs and outputs.
Why do you want to run it locally?