Pageview error with PHP code

0

Cananyonehelpmefigureoutwhythecodebelowiswrong?Isthereanyparameterizationsothatitdoesnotappearonthemainpage?

<?php}if(isset($_POST['submitBtn'])){?><divclass="caption">Resultado do Login:</div>
            <div id="icon2">&nbsp;</div>
            <div id="result">
            <table width="100%">
              <tbody>
                <tr>
                  <td><br />
                  <br />
            if ($error == "") {
            echo "Benvindo";
            echo "<a href="index.php">Click aqui para entrar.</a>";
            }
            else echo $error;
            ?&gt;
                  <br />
                  <br />
                  <br />
                  </td>
                </tr>
              </tbody>
            </table>
            </div>
            <?php }
            ?> </div>
            </div>
    
asked by anonymous 18.09.2017 / 16:31

2 answers

0

Add the php tags, <?php and ?> to this code snippet:

if ($error == "") {
 echo "Benvindo";
 echo "<a href="index.php">Click aqui para entrar.</a>";
}
 else echo $error;
    
18.09.2017 / 17:04
0

Code structure has a small error, the correct error:

<?php } if (isset($_POST['submitBtn'])){ ?>
        <div class="caption">Resultado do Login:</div>
        <div id="icon2">&nbsp;</div>
        <div id="result">
        <table width="100%">
          <tbody>
            <tr>
              <td><br />
              <br />
       <?php
          if ($error == ""){
            echo "Benvindo";
            echo "<a href="index.php">Click aqui para entrar.</a>";
          }else
            echo $error;
        ?>
              <br />
              <br />
              <br />
              </td>
            </tr>
          </tbody>
        </table>
        </div>
        <?php } ?>
        </div>
        </div>
    
18.09.2017 / 20:24