PHP and javascript



can anyone show a sample code on how PHP interact with javascript??

i need to do a calendar javascript that would be able to pass the message
or data to PHP using javascript...

any sites that give me some examples would be good too.
PHP does not interact with JavaScript. Ever. JavaScript is a client-side technology (it runs in the user's browser) and PHP is a server-side technology (it runs on the web server). They do not ever communicate directly.

What you can do is make PHP output JavaScript code in the page it is sending to the browser. This code will only be executed once the page is sent to the browser, after which time the browser and PHP no longer communicate.

Or you can use JavaScript to retrieve a URL in which variables are passed (the usual GET method), or submit a form (POST method), in which case values are sent to PHP and PHP returns a page. Once again, once the page is sent, the browser no longer communicates with PHP.