Ignore Netbeans files
Move CSS and JS files into their own folders.
Indent PHP files.
Add missing closing tag. (The indentation scheme made it obvious that this tag was missing, something that I had missed until I indented it.)
Convert short-tags into full PHP tags. The short-hand method is frequently not enabled on web hosts and keeps the code from being portable. i.e. It may work on your system, but break when deployed or shared to a team member's system.
Let the text breathe.
Missed converting some PHP tags.
Commentary on quotefix and a modification to get it to handle the other type of single quote.
Try not to ini_set. It can make it hard to debug PHP configuration changes. Imagine somebody changing php.ini, which is where this stuff properly lives, only to not see the changes reflected in the app.
Move script tag inside of body. The `html` element should ultimately enclose everything except the doc-type declaration. The only legal children that it can have are `head` and `body`. So, elements like `script ` need to be descendants of either `head` or `body`. The end of `body` is the best place for script tags to live, since script download and execution is blocking.
Defer execution of this code until after the document is ready and we're assured that the referenced elements exist in the DOM.
header.php was only used in one place and had code specific to that page, so in-line it.
Move script tag to valid location.
Missed converting another PHP tag.
Convert redirect code to be entirely PHP. Server-side applicaiton logic should all be done before a single line of HTML gets sent. This is the first and most import separation of concerns to maintain: view code (rendering HTML) should focus entirely on output to stay clear and understandable.
Asking if there are no parts is clearer than testing the value of $i, which is only known to be some index of some iteration. Pro-tip: Only use iteration variables like $i inside of their respective loops. They lose most of their meaning afterwards.
With the removal of $i from later in the script, it has become entirely unnecessary.
Bump remaining script tags into place just before `body` closes. Again, this is because the download and execution of JavaScript blocks the browser from processing anything else until the JS is done executing. So, it's best to position it in the last place possible.
Move in-page JS to the external file for this page. Keeping all but extremely small snippets separated out into a JS file is good for caching purposes. The contents of the HTML file, particularly since it comes as the result of a POST, are not cacheable. An external file is.
Whoops, missed converting an instance of $i.