07.11.2014, 17:33
I dont know much about JS, but i know that it is client-sided, and PHP is server-sided. This limits the possible communication between them, probably you can only do this by calling the php URL on the server from JS and parse the output.