0

index.php

<div style="margin: 123px 0 0 310px; position: absolute; z-index: 3;">
<form action="login_portal.php" method="POST">
<input type="text" class="form" name="username"><br>
<input type="password" class="form2" name="password">
<div style="margin: 15px 0 0 330px; position: absolute;">
<input type="hidden" name="submit" />
<input type="image" src="images/login.jpg" alt="submit" width="200px"></div>
</div>

login_portal.php

echo "test";

if (@$_POST['submit']) { 

echo "enter";

I wonder why I only see the word "test", and not "enter"? I thought I suppose to see the word "enter" also.

3
Contributors
2
Replies
21
Views
2 Years
Discussion Span
Last Post by pritaeas
0

login_portal, is currently html, <?php ?> missing, { I thought I was funny
then;
close the brace if (@$_POST['submit']) { echo "enter";}
@ switches off error reporting for the current command, not a good thing till production ready

<?php 
echo "test";
if ($_POST['submit']) { echo "enter"; } 
?>

a code highlighting editor, notepad replacement, like [not ad] notepad++ notepad2 [/not ad] will show incomplete braces, missing closures, while you type and make debugging a bit easier

  1. not affilited in any way with a notepad replacement
  2. no } after "funny"
  3. strange what makes some people laugh

Edited by almostbob

1

Your hidden submit does not have a value, so by default that is an empty string, which evaluates to false.

Edited by pritaeas

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.