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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题