Some suggestions:
1) Don't use IIS. Why bother using PHP with IIS in the first place? You have the ability to write applications in ASP/ASP.NET and get a far richer framework to work on specific to IIS.
2) If you have to develop on Windows box, why not try the Apache server instead. I have a BackOffice 4.x/NT 4 system setup where I run Apache on top of it with IIS turned off. I eliminated ALOT of problems when I switched over to Apache.
3) $submit has a bogus value in it. You need to do the following:
if (array_key_exists("Submit", $POST))
{
if (array_key_exists("first")
$firstName = $POST["first"];
if (array_key_exists("last")
$lastName = $_POST["last"];
// etc.
// validate the fields (length, values, range values)
// persist to a database
}
else
{
// render the form
}
Check the post variable to see if indeed the button named "Submit" is in the array. This way, you can detect which button was pressed (in the case of multiple buttons)
4) Write these as classes as it will look more cleaner
Personnel.php
class Personnel
{
var $firstname;
var $lastname; // personnel attributes
function Save() {} // persist data w/mySQL
}
PersonnelForm.php
class PersonnelForm
{
function Validate() {} // validates all personnel attributes
function Show() {} // shows the html form with tags
}
Kerry Kobashi
Kobashi Computing