weixin_33737774 2014-07-13 15:43 采纳率: 0%
浏览 15

PHP和Javascript事件处理

I know that php is a server-side language. However I am confused on how to hook up a html button event to a page that uses php. I understand this will probably involve Javascript, some css and html and maybe Ajax. I've been looking at some examples but they don't explain the important pieces I am looking for. In summary I want to see the code for the click event and how php gets notified there was a click.

I apologize if this is a strange question. I'm used to old application programming and I'm trying to understand some of these newer practices.

  • 写回答

2条回答 默认 最新

  • weixin_33671935 2014-07-13 15:47
    关注

    The actual click event will never be sent to PHP. The outcome of the click is what the server (PHP) will see.

    For example, if your button redirects the user to a different page, your PHP will be "notified" as soon as the GET request reaches your sever.

    For a form element, the submit button will issue a POST request to a certain URL, that request is what you can "interpret" as the click event. The same goes for an AJAX request.

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器