Not sure exactly why your code is not working as it seems pretty straightforward to me. Try debuggin with fiddler if you have not already done so. I've implemented once something similar, however using a WCF service to host the web service. I've summarized my code into a small demo here: SQL Writeback from QlikView extension object.
Hopefully this may help or point you into the right direction.
So good news i have a working extension.
So here my latest insight on this topic:
1. the code is fine
2. sending data to php (localhost) file is possible (I am now using the XMLHttpRequest method)
3. getting data directly back from php (localhost) seems not possible. ( Is it a security issue?, maybe because it's not the same domain?) So this the problem.
4. getting data with XMLHttpRequest from QV-extension folder is possible
-->so I build a workaround for getting data from php/localhost:
php creates a texttfile in QV-extension folder then getting data with XMLHttpRequest
To get a graps what I am talking about here is a picture of my scenario:
So the main-goal is to connect to MySQL via QV-extension.
Maybe someone have some ideas or insight on this topic.
I know there are extension writing to SQL Server. But there not working yet on my system.
I need to debug them with Visual Studio and I know I can connect with VS to MySQL to, so maybe I will try this sometime.
I am happy about any suggestion