dongyaofu0599 2014-09-06 15:30
浏览 41
已采纳

PHP同时运行2个脚本[关闭]

I hope you can help. I'm a new to PHP and it is driving me crazy!

I have a html document with separate login and registration forms. Each one of these has it's own php script to either register or to login. When testing the input error messages for either the login or registration forms it seems to run both scripts and I get the error messages for both.

I have spent most of today trying to find a solution to this but to no avail. Is there a way that I can define a name to each script so I can add an action to each form tags referring to the particular php script?

Or This there a way of using a php if else statement based on which html button is pressed?

Thank you in advance

Hopeless coder

  • 写回答

3条回答 默认 最新

  • doumi9661 2014-09-06 15:40
    关注

    Or This there a way of using a php if else statement based on which html button is pressed?

    Yes, assuming you have

    <input type='submit' name='subbtn' value='Register'>
    ...
    <input type='submit' name='subbtn' value='Log In'>
    

    Then in php:

    if ($_REQUEST['subbtn'] == 'Register') {
      // they pressed register
    } else {
      // they pressed log in (or some other submit button)
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题