Home › Forums › Back End › can't get form on webpage to post to table/database on remote server › Reply To: can't get form on webpage to post to table/database on remote server
Here’s the CustomerForm.php
<?php
if (array_key_exists(‘GroomingID’,$_POST))
{
$action = ‘Edit’;
$formFlag = ‘Updating’;
}
else
{
$action = ‘Add’;
$formFlag = ‘Submitted’;
}
?>
<form method=”post” action=”groomingservices2.php”>
<input type=”hidden” name=”<?php echo $formFlag ?>” value=”true”>
<?php
if (array_key_exists(‘GroomingID’,$_POST))
{
echo “<input type=’hidden’ name=’GroomingID’ value=’$groomingID’>”;
}
?>
<table align=”center” border=”1″ width=”500″>
<?php
echo textEntry(‘First name’,’FirstName’,$dbEntries,$errors,15);
echo textEntry(‘Last name’,’LastName’,$dbEntries,$errors,15);
echo textEntry(‘Address’,’Address’,$dbEntries,$errors,50);
echo textEntry(‘City’,’City’,$dbEntries,$errors,30);
echo textEntry(‘State’,’State’,$dbEntries,$errors,5);
echo textEntry(‘Zip’,’Zip’,$dbEntries,$errors,10);
echo textEntry(‘Phone Number’,’PhoneNumber’,$dbEntries,$errors,15);
echo textEntry(‘Email’,’Email’,$dbEntries,$errors,25);
echo selectEntry(‘Pet Type’,’PetType’,$petTypeEntries,$errors,$dbEntries[‘PetType’]);
echo textEntry(‘Pet Name’,’PetName’,$dbEntries,$errors,30);
echo checkboxEntry('Neutered or Spayed','NeuteredOrSpayed',
$dbEntries,$errors,
array('Neutered','Spayed'));
echo textEntry('Pet Age','PetAge',$dbEntries,$errors,10);
?>
<tr>
<td colspan="2"><input type="submit" value="<?php echo $action ?> Customer"></td>
</tr>
</table>
</form>