Just cannot get 'area' to submit to db using same php code as already used
Posted on
16th Feb 2014 07:03 pm by
admin
Basically all i have done is just modified some code and added an area section.
The form is allready submitting other things like location price etc.
And i have simply added a field in db called area and changes to the page, everything else submits appart from the area.
Add properties.php (this has form which gets processed on addimages2.php
addProperties.php
Code:
<?php
include('../lib/scripts/php/functions.php');
$page_title='Add Properties';
$page_id_top = 'properties';
$page_id = 'add';
if(isset($_GET['error_code']))
{
$error_id = 'Highlighted fields are required';
$highlight = true;
}
include('../lib/includes/header.php');
$ownerSQL = 'SELECT * FROM owners';
$ownerResults = $db->query($ownerSQL);
$property_id ='';
$costal ='';
$garden ='';
$openFire ='';
$pets ='';
$disabled ='';
$groundFloor ='';
$shortBreaks ='';
$baby ='';
$data ='';
if (empty($_GET['get_owner']))
{
$_GET['get_owner'] = '';
}
if (empty($_GET['get_grading']))
{
$_GET['get_grading'] = '';
}
if (empty($_GET['get_maxGuests']))
{
$_GET['get_maxGuests'] = '';
}
if (empty($_GET['get_bedrooms']))
{
$_GET['get_bedrooms'] = '';
}
if (empty($_GET['get_parking']))
{
$_GET['get_parking'] = '';
}
if (empty($_GET['get_petsAmount']))
{
$_GET['get_petsAmount'] = '';
}
if (empty($_GET['get_status']))
{
$_GET['get_status'] = '';
}
if (empty($_GET['get_changeOver']))
{
$_GET['get_changeOver'] = '';
}
if (empty($_GET['get_linen']))
{
$_GET['get_linen'] = '';
}
if (empty($_GET['get_special1']))
{
$_GET['get_special1'] = '';
}
if (empty($_GET['get_special2']))
{
$_GET['get_special2'] = '';
}
if (empty($_GET['get_access']))
{
$_GET['get_access'] = '';
}
if (empty($_GET['get_area']))
{
$_GET['get_area'] = '';
}
if(isset($_GET['id']))
{
$property_id = $_GET['id'];
$propertiesSQL = "SELECT * FROM properties WHERE id = '$property_id'";
$data = $db->query($propertiesSQL);
$_GET['get_owner'] = $data[0]['owner'];
$_GET['get_grading'] = $data[0]['grading'];
$_GET['get_maxGuests'] = $data[0]['maxGuests'];
$_GET['get_bedrooms'] = $data[0]['bedrooms'];
$_GET['get_parking'] = $data[0]['parking'];
$_GET['get_petsAmount'] = $data[0]['petsAmount'];
$_GET['get_status'] = $data[0]['status'];
$_GET['get_changeOver'] = $data[0]['changeOver'];
$_GET['get_linen'] = $data[0]['linen'];
$_GET['get_special1'] = $data[0]['special1'];
$_GET['get_special2'] = $data[0]['special2'];
$_GET['get_access'] = $data[0]['access'];
/*New area*/
$_GET['get_area'] = $data[0]['area'];
}
if (empty($data))
{
if (!empty($_GET['get_owner']))
{
$data[0]['owner'] = $_GET['get_owner'];
}
else
{
$data[0]['owner'] = '';
}
if (!empty($_GET['get_propertyName']))
{
$data[0]['propertyName'] = $_GET['get_propertyName'];
}
else
{
$data[0]['propertyName'] = '';
}
if (!empty($_GET['get_changeOver']))
{
$data[0]['changeOver'] = $_GET['get_changeOver'];
}
else
{
$data[0]['changeOver'] = '';
}
if (!empty($_GET['get_linen']))
{
$data[0]['linen'] = $_GET['get_linen'];
}
else
{
$data[0]['linen'] = '';
}
if (!empty($_GET['get_special1']))
{
$data[0]['special1'] = $_GET['get_special1'];
}
else
{
$data[0]['special1'] = '';
}
if (!empty($_GET['get_special2']))
{
$data[0]['special2'] = $_GET['get_special2'];
}
else
{
$data[0]['special2'] = '';
}
if (!empty($_GET['get_access']))
{
$data[0]['access'] = $_GET['get_access'];
}
else
{
$data[0]['access'] = '';
}
if (!empty($_GET['get_location']))
{
$data[0]['location'] = $_GET['get_location'];
}
else
{
$data[0]['location'] = '';
}
/**********************New**************************/
/*Building in functionality for area search*/
/***************************************************/
if (!empty($_GET['area']))
{
$data[0]['area'] = $_GET['get_area'];
}
else
{
$data[0]['area'] = '';
}
/***********************************************/
if (!empty($_GET['get_grading']))
{
$data[0]['grading'] = $_GET['get_grading'];
}
else
{
$data[0]['grading'] = '';
}
if (!empty($_GET['get_description']))
{
$data[0]['description'] = $_GET['get_description'];
}
else
{
$data[0]['description'] = '';
}
if (!empty($_GET['get_list_description']))
{
$data[0]['list_description'] = $_GET['get_list_description'];
}
else
{
$data[0]['list_description'] = '';
}
if (!empty($_GET['get_maxGuests']))
{
$data[0]['maxGuests'] = $_GET['get_maxGuests'];
}
else
{
$data[0]['maxGuests'] = '';
}
if (!empty($_GET['get_bedrooms']))
{
$data[0]['bedrooms'] = $_GET['get_bedrooms'];
}
else
{
$data[0]['bedrooms'] = '';
}
if (!empty($_GET['get_parking']))
{
$data[0]['parking'] = $_GET['get_parking'];
}
else
{
$data[0]['parking'
Your Answer:
Login to answer
144 9
Other forums
Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter
PHP Display Telephone Number On Referrer
I have used the php below to show a different telephone number in the header of the site depending u
Accept only alpha characters
I've got this bit of code ready for accepting a phrase:
Code: if (!eregi ("", $_POS
form submit at godaddy?
Trying to test form submission at GoDaddy and it does not seem to work. Here's the page...
h
xApp Analytics in BI 7.0
Dear all,
I am trying to implement xApp Analytics in BI 7.0. After I installed the analyt
Error in write byte array into document in SM58
Hi Gurus,
Getting the following error status in Transactional RFC (SM58) ..... *Error i
problem with refreshing
in my site, i have an index page, it has a main div. this main div's content is changing according t
remove trailing slash from array
I have the following array which contains trailing slashes I need to remove. What is the best way to
JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w
Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to re