Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A header is just that, something which appears at the beginning of the data transfer. You are sending data (most of the web page) before trying to send the header.</p> <p>Move your php code to the top of the file, and then just echo the "wrong user/pass" in another php block in the correct location</p> <pre><code>&lt;?php mysql_connect("localhost", "root","******") or die(mysql_error()); mysql_select_db("login") or die(mysql_error()); if(isset($_POST['username']) &amp;&amp; isset($_POST['password'])){ $db_user = mysql_query("SELECT username FROM login_tb"); $db_pass = mysql_query("SELECT password FROM login_tb"); $ctrl_user = mysql_result($db_user,0); $ctrl_pass = mysql_result($db_pass,0); $username = $_POST['username']; $password = $_POST['password']; if(($username || $password) != NULL &amp;&amp; $username == $ctrl_user &amp;&amp; $password == $ctrl_pass){ header("location: ./nextpage.php"); } } ?&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Uploader&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="index.php" method="POST" enctype="application/x-www-form-urlencoded"&gt; &lt;input id="login" class="username" type="text" name="username" autofocus placeholder="Username" maxlength="30"/&gt; &lt;input id="login" class="password" type="password" name="password" placeholder="Password" maxlength="15"/&gt; &lt;input id="login" class="submit" type="submit" value="Login" /&gt; &lt;p&gt;Last update &lt;span id="lastupdate"&gt;&lt;?php echo date('d-m-Y');?&gt;&lt;/span&gt;&lt;/p&gt; &lt;?php echo $username . $password; if(($username || $password) == NULL){ echo "you have entered wrong username or password! &lt;br/&gt; please contact site admin."; } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload