Php header('Location") error
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8028957/headers-already-sent-by-php">Headers already sent by PHP</a>  </p>
</blockquote>



<p>I'm having some difficulty with my php coding.</p>

<p>I have 3 files, add.php, lib.php, and view.php</p>

<p>I created a simple form, and when the user clicks submit, it should direct them to the view.php where it will display the database. Now I'm having a couple issues I can't seem to resolve.</p>

<p>when the user clicks submit and the fields are blank or there is an error no entry should be made into the view page (or database)...however when I click submit a blank entry is made into the database. ALSO if i click "enter product" from the top menu bar anytime I click it, it causes a blank entry into the database. I can't figure out why that's happening.</p>

<p>My next issue is with the header('Location')
and my browser says:</p>

<p>"Warning: Cannot modify header information - headers already sent by (output started at lib.php:13) in add.php on line 16"</p>

<p>However if I click submit on my form it goes away.</p>

<p>Here is the code for the pages:</p>

<p>I truly apologize if the code is really messy.</p>

<p>Any help / advice / solution is greatly appreciated thank you.</p>

<p>And yes this <strong>was</strong> an assignment---it was due last week but since I couldn't finish it, it's not worth any marks anymore.</p>
