rahuul Posted December 28, 2009 Share Posted December 28, 2009 can any one help me...... How to access javascript variable in php. Link to comment https://forums.phpfreaks.com/topic/186483-access-javascript-variable-in-php/ Share on other sites More sharing options...
trq Posted December 28, 2009 Share Posted December 28, 2009 You would need to use ajax to send the data within the variable back to the server where php executes. Link to comment https://forums.phpfreaks.com/topic/186483-access-javascript-variable-in-php/#findComment-984747 Share on other sites More sharing options...
oni-kun Posted December 28, 2009 Share Posted December 28, 2009 can any one help me...... How to access javascript variable in php. Or you can set the JS variable as a cookie, and read it in PHP. Link to comment https://forums.phpfreaks.com/topic/186483-access-javascript-variable-in-php/#findComment-984759 Share on other sites More sharing options...
scvinodkumar Posted December 28, 2009 Share Posted December 28, 2009 I think u can try like this, $str = '<script language="javascript">document.write(a);</script>'; echo $str; Link to comment https://forums.phpfreaks.com/topic/186483-access-javascript-variable-in-php/#findComment-984825 Share on other sites More sharing options...
Buddski Posted December 28, 2009 Share Posted December 28, 2009 scvinodkumar: that wont work.. that will just echo <script language="javascript">document.write(a);</script> to the screen.. It wont be passing anything to PHP Link to comment https://forums.phpfreaks.com/topic/186483-access-javascript-variable-in-php/#findComment-984865 Share on other sites More sharing options...
canadabeeau Posted December 28, 2009 Share Posted December 28, 2009 Hey these guys are probably like deja vu, as I asked like a million questions about this, PM me if you want the solution so I can email it to you. Link to comment https://forums.phpfreaks.com/topic/186483-access-javascript-variable-in-php/#findComment-984867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.