how to pass java script variable in php or how to call java script variable in php code plz help me............
you can not pass client side scripting data to server side scriptig javascript is client side scripting php is server side scripting you can pass data from PHP to javascript but never from Javascript to PHP
You are trying to mix up client side language into server side programming. Like Cerahil said, you can do the reverse however.
Actually you can use AJAX technique to pass the value of a variable through URL parameters [GET method]. For example, if we use say, jQuery framework and would like to change the content of a div element having id = result, then the following technique would work: $('#result').load('my_ajax.php?my_var='+js_var_name); of course, the my_ajax.php file needs to handle the $_GET['my_var'] to generate the result.
to use javascript in PHP you have to use a seperate serverside script to accept the javascript clientside data. many people acheve this through IFRAMES. in the IFRAME, have it accept POST or GET data via PHP. then as it has processed the data, it can then use javascript to manipulate the original user window via javascript : window.top - DOM element.