0
Can anyone help me understand why the code below is wrong? Some parameterization is missing so that it does not appear on the main page?
<?php } if (isset($_POST['submitBtn'])){
?>
<div class="caption">Resultado do Login:</div>
<div id="icon2"> </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;
?>
<br />
<br />
<br />
</td>
</tr>
</tbody>
</table>
</div>
<?php }
?> </div>
</div>
Can you explain the problem better? What would be "this does not appear on the main page"? Is the PHP code itself being displayed? If yes, you are running the file on a PHP-supported server?
– Woss
I added a photo op, which demonstrates what appears on the page. Supposedly this field should be hidden, so when we do a wrong login it goes back to the home page.
– Ricardo
Provide more details about the problem, so it’s hard to help. Ask a larger part of the code.
– Amanda Lima
It is already possible to help in this way?
– Ricardo
Impossible to say for sure. Still the question makes no sense. But I’ve noticed that you’re using double quotes inside the string in PHP; this breaks the string and generates the unexpected result. Try changing to simple quotes:
echo "<a href='...'>...</a>"
(note the simple quotes inhref
of the link).– Woss
Try this:
if ($error == "") { echo "Benvindo <br/> <a href='index.php'>Click aqui para entrar.</a>";
 }
– Leandro Lima
It’s not working yet.. I’ll put a sharper image, it might help.. the code is too long to put it here
– Ricardo
The problem that arises next is that after logging in, the page does not go to the intended one, but if you click where it says "Click here to log in.! that’s where it comes in..
– Ricardo
what a start this is
<?php }
– user60252