开发者

Help with reading javascript output in php

i'm trying to read automatically a javascript output with php, this is the form and the output:

&l开发者_开发问答t;b>SeteZoom:</b> 
<script>document.writeln(resp)</script> 

<form name=form1 method=GET onSubmit="this.rnd.value=rand()"> 
<input type=hidden name=rnd value=""> 
<b>Você:</b> <input type=text name=msg size=30> 
</form>

this is the form and the output is ondocument.writeln(resp), can I read that output with PHP ?


Javascript runs on the client (browser), PHP runs on the server. PHP cannot know what Javascript is doing unless Javascript somehow calls the server (HTTP POST, AJAX request, etc).


You're going to need to use some javascript AJAX to send the data in resp to the server. Since PHP is only on the server, and anything javascript does is only on the client, the server has no knowledge of client-side changes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜