Create("churchil_demo"); # If the user has submitted some data, check to make sure # they've filled in all of the required fields. If not, # print out some errors and prompt them to fill in the # correct values. if ($NewLoc == "Yes") { $error = 0; $error += RequiredVar("Location Name",$Name); $error += RequiredVar("Address",$Addr1); $error += RequiredVar("City",$City); $error += RequiredVar("State",$State); $error += RequiredVar("Phone",$Phone); if ($error == 0) { # Ok, we've got valid information. Cool. Insert # the new location into the database. $insert = "insert into ACME_Locations values(0, '". AddSlashes($Name) . "', '". AddSlashes($Addr1) ."', '". AddSlashes($Addr2) . "', '". AddSlashes($Addr3) ."', '". AddSlashes($City) . "', '$State', '". AddSlashes($Phone) . "', '" . AddSlashes($Directions)."')"; $sql->Insert($insert); echo("

Added $Name

\n"); # Clear the variable values so that they won't repeat # in the form again. $Name = ""; $Addr1 = ""; $Addr2 = ""; $Addr3 = ""; $City = ""; $State = ""; $Phone = ""; $Directions = ""; } } ?>
Add a New Location
Location Name
Address

City
State
Phone
Directions