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
ok i need to join all this pages to make 1 neat code
i have 5 pages that make up my tv guide it works 100% but i want to make it 1 page if i can or 2, i
Error: SQL Syntax; Line 1
Code:
<?php require "global_settings.php"; ?>
<title&g
Problem in String replace program's output
Hi all,
I was trying to make a program which accepts a string and replaces it with another stri
File upload issues
Hi Guys,
Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat
Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values
Form always sends to error page...
Hello,
Any help will be greatly appreciated. I am having trouble getting multiple fields to be re
parse error
On my local machine I keep getting parse error for my footer. When I put it online, it doesn't show
Login script (probably a simple error)
dbConfig.php
Code: <?
// Replace the variable values below
// with your specific dat
Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.
I need to create a drop
mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts???
this is the code i got