radiations3 Posted August 6, 2011 Share Posted August 6, 2011 I want to know How to assign javascript's variable to php's variable??? <script> var x=3; </script> <?php $assign=x; ?> Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/ Share on other sites More sharing options...
MasterACE14 Posted August 6, 2011 Share Posted August 6, 2011 not sure why you'd want to do this? and don't know whether you're actually after AJAX? However as ugly as this is... <?php $assign = ?><script>var x=3; document.write(x);</script><?php ; ?> Why don't you explain why you need this? I'm positive there's a better solution, hell I don't even know if that would even work. Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/#findComment-1253147 Share on other sites More sharing options...
phpSensei Posted August 6, 2011 Share Posted August 6, 2011 You can't, its impossible. Languages like ASP.NET connect that bridge with client side and server side, however javascript to php is not possible Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/#findComment-1253148 Share on other sites More sharing options...
radiations3 Posted August 6, 2011 Author Share Posted August 6, 2011 THANX and phpSensei Congratulations for winning that cloning competition!!! May you win more competitions... But hey don't try to beat me if i'll appear in any competition Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/#findComment-1253150 Share on other sites More sharing options...
phpSensei Posted August 6, 2011 Share Posted August 6, 2011 haha thank you very much Radiation3 And i'll try not to. Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/#findComment-1253152 Share on other sites More sharing options...
radiations3 Posted August 6, 2011 Author Share Posted August 6, 2011 not sure why you'd want to do this? and don't know whether you're actually after AJAX? However as ugly as this is... <?php $assign = ?><script>var x=3; document.write(x);</script><?php ; ?> Why don't you explain why you need this? I'm positive there's a better solution, hell I don't even know if that would even work. JUST WANT TO KNOW ABOUT THIS THAT IS IT POSSIBLE OR NOT>>> THAT's ALL!!!! Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/#findComment-1253154 Share on other sites More sharing options...
radiations3 Posted August 6, 2011 Author Share Posted August 6, 2011 haha thank you very much Radiation3 And i'll try not to. YuppIiiiEEE Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/#findComment-1253156 Share on other sites More sharing options...
phpSensei Posted August 6, 2011 Share Posted August 6, 2011 :) Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/#findComment-1253163 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.