开发者

How do I assign javascript variable to php variable? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years 开发者_运维技巧ago.

i have a javascript variable which have some value that variable value assign to php variable how i do this thing

<script type="text/javascript">
var view = true;
var bcount=10;
var wcount=10;
var tcount=10;
</javascript>
<?php
$whitelistcount=????
?>

in this code i have no use ajax and jquery only simple javascript and core php


You could put your value into a hidden input field of a HTML form an submit it to the server, where your PHP can deal with it.


JavaScript can`t comunicate with PHP directly. There are two ways - AJAX or submitting a form populated with JavaScript.

The other way is PHP comunicating with JavaScript - PHP can generate the JavaScript code inside your HTML page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜