because php is on the server side and javascrpt is on the client side you would need to post it to the server with a form or through the url.