i have project named myapp in C drive and i am using php built in server so my doc root of project is set to be myapp/public/ containing js,css etc now these js files have some ajax code and calls php scripts in myapp/src folder outside public folder so obivously i get error localhost:8000/php/script.php is not found on this server as php folder is above document root and in src folder so in such what can i do how can i fire ajax calls?

Member Avatar

You can fire ajax calls to a handler php file which will accept ajax data and call functions from other php files above the docroot and return (echo) the response.