douliang7068 2011-09-22 19:30
浏览 58
已采纳

是否可以在PHP中使用JavaScript变量? [重复]

Possible Duplicate:
Access a JavaScript variable from PHP

theVariable = String.fromCharCode(theVariable).toLowerCase();

is it possible to use theVariable in PHP codes ? How?

  • 写回答

4条回答 默认 最新

  • douyun7718 2011-09-22 19:32
    关注

    To use a variable that is in JavaScript in PHP, you have to send an Ajax request to a PHP page passing that variable in. This probably isn't the effect you're looking for.

    JavaScript executes on the viewer's computer. PHP executes on the server. To send a JavaScript variable to PHP, you need to send some packet of information from the client to the server. This is done as a GET/POST request.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试