I'm attempting the same thing. I have WAMPSERVER/localhost setup with a PHP file on it. I want to be able to access that file with AJAX in preview mode.
I added "header('Access-Control-Allow-Origin: *');" to the index.php file on my localhost and I'm still unable to make it work. If I export the project and put it on my local server it works, but I don't want to have to do that every time I want to test the game.
Any ideas on why this might not be working for me? Are there any browser settings I have to change, etc?
Edit: This is the browser error I'm getting:
XMLHttpRequest cannot load localhost/dialog_test/dialog.php. Origin localhost is not allowed by Access-Control-Allow-Origin.
Edit 2: Figured it out. I had to add "header('Access-Control-Allow-Origin: *');" to the PHP file I wanted to access. It's working now.