【问题标题】:Why this submit action dont work with php isset?为什么此提交操作不适用于 php isset?
【发布时间】:2015-06-04 15:05:01
【问题描述】:

我有这个代码,当你按下提交按钮时,它是一个带有 php 动作的 HTML 寄存器

<html>
<head>
    <title>Pruebas de registro </title>
</head>
<body>
    <h1 align="center"> FORMULARIO DE REGISTRO </h1>
<form align="center" method="POST">
<p>User: <input type="name" name="user"></input> </p>
<p>Pass: <input type="password" name="password"> </p>
<p>RPass: <input type="password" name="password2"> </p>

<input type="submit" name="submit" value="Ok"> </input>
<input type="reset" value="Reset"></input>

</form>
<?php
    If (isset($_POST['submit'])) {
        echo "Has presionado submit"
}
?>
</body>

</html>

为什么当我按下“确定”提交按钮时,php 没有用 isset 说我“有 presionado 提交”?

【问题讨论】:

    标签: php html forms action isset


    【解决方案1】:

    你在 If 条件下有语法错误,你忘了写一个 ; echo 语句后

    【讨论】:

      【解决方案2】:
      <?php
          if (isset($_POST['submit'])) {
              echo "Has presionado submit"; // ; is missing
      }
      

      【讨论】:

        【解决方案3】:

        写 if like this "if" not like this "If",并在 echo 后添加分号。

        【讨论】:

          猜你喜欢
          • 2011-06-24
          • 2013-05-28
          • 2022-01-18
          • 2017-10-26
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2022-12-15
          • 1970-01-01
          相关资源
          最近更新 更多