Retrieve Data

You must enter a first name!

‘;
$error = true;
}
if($_POST[‘surname’] == ”) {
echo ‘

You must enter a surname!

‘;
$error = true;
}
if($_POST[‘deeds’] == ”) {
echo ‘

You must state if you are the only name on the deeds!

‘;
$error = true;
}

if($_POST[‘tel’] == ”) {
echo ‘

You must enter a telephone number!

‘;
$error = true;
}

if($_POST[‘address’] == ”) {
echo ‘

You must enter an address!

‘;
$error = true;
}
if($_POST[‘postcode’] == ”) {
echo ‘

You must enter a postcode!

‘;
$error = true;
}
if($_POST[‘property_type’] == ”) {
echo ‘

You must enter a property type!

‘;
$error = true;
}
if($_POST[‘beds’] == ”) {
echo ‘

You must enter the number of bedrooms!

‘;
$error = true;
}
if(!is_numeric($_POST[‘beds’])) {
echo ‘

Number of bedrooms must be a number!

‘;
$error = true;
}
if($_POST[‘estimate’] == ”) {
echo ‘

You must enter an estimated value for the property!

‘;
$error = true;
}
if(!is_numeric($_POST[‘estimate’])) {
echo ‘

Estimate of property value must be a number!

‘;
$error = true;
}
if($_POST[‘out_morg’] == ”) {
echo ‘

You must state if there is an outstanding mortgage!

‘;
$error = true;
}
if($_POST[‘charges’] == ”) {
echo ‘

You must state if you have a second mortgage or other charges!

‘;
$error = true;
}
if($_POST[‘comp_dead’] == ”) {
echo ‘

You must state if you have a deadline for completion!

‘;
$error = true;
}

if ($error != true) {

$query = “UPDATE gpcontact SET firstname=’$_POST[firstname]’,surname=’$_POST[surname]’,deeds=’$_POST[deeds]’, tel=’$_POST[tel]’, email=’$_POST[email]’, address=’$_POST[address]’, postcode=’$_POST[postcode]’, property_type=’$_POST[property_type]’, other_type=’$_POST[other_type]’, beds=$_POST[beds], estimate=$_POST[estimate], out_morg=’$_POST[out_morg]’, charges=’$_POST[charges]’, comp_dead=’$_POST[comp_dead]’, comp_date=’$_POST[comp_date]’, reason=’$_POST[reason]’, referral=’$_POST[referral]’ WHERE id = ‘$_POST[id]'”;
$result = mysqli_query($dbc, $query);

if($result) {
echo ‘Update Successful’;
} else{
echo ‘

An error occured

‘;
echo mysqli_error($dbc);
echo ‘

‘.$query.’

‘;
}
}
}

?>










Leave a Reply