doulan8054
2012-12-12 13:03客户端和服务器端编程有什么区别?
I have this code:
<script type="text/javascript">
var foo = 'bar';
<?php
file_put_contents('foo.txt', ' + foo + ');
?>
var baz = <?php echo 42; ?>;
alert(baz);
</script>
Why does this not write "bar" into my text file, but alerts "42"?
NB: Earlier revisions of this question were explicitly about PHP on the server and JavaScript on the client. The essential nature of the problem and solutions is the same for any pair of languages when one is running on the client and the other on the server (even if they are the same language). Please take this in to account when you see answers talking about specific languages.
- 点赞
- 回答
- 收藏
- 复制链接分享
5条回答
为你推荐
- 客户端和服务器端编程有什么区别?
- javascript
- client-side
- php
- server-side
- 5个回答
- 有关客户端与服务器端通信的问题
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- java的具体应用都有什么?
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- 客户端和服务器端编程之间有什么区别?
- javascript
- client-side
- php
- server-side
- 0个回答
- 使用qt 在http协议post请求数据时,服务器端接收到的数据为空
- 服务器
- web服务器
- qt
- http协议
- 数据
- 3个回答
换一换