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; ?> Quote 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. Quote 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 Quote 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 Quote 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. Quote 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!!!! Quote 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 Quote 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 :) Quote Link to comment https://forums.phpfreaks.com/topic/244022-a-very-easy-question/#findComment-1253163 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.