...

View Full Version : Resolved Unable to post the value of new added field



saraswat19
01-07-2012, 05:56 AM
Hi

When I click on Add more feature button then it adds a new input field but do not post the values of new added field.
(maximum 9 fields allowed)

I have used following code

$feature1=$_REQUEST['feature1'];
$feature2=$_REQUEST['feature2'];
$feature3=$_REQUEST['feature3'];
$feature4=$_REQUEST['feature4'];
$feature5=$_REQUEST['feature5'];
$feature6=$_REQUEST['feature6'];
$feature7=$_REQUEST['feature7'];
$feature8=$_REQUEST['feature8'];
$feature9=$_REQUEST['feature9'];

http://morphacademy.com/avow/Capture.PNG

saraswat19
01-07-2012, 09:19 AM
Hi
Please provide me solution..what should i do..??
Is there any other way to do this?

Alternative
01-07-2012, 09:37 AM
The code you posted is not very helpful in finding what's wrong...can you post the entire PHP script that you're using?

tangoforce
01-07-2012, 01:40 PM
First you need to be sure that the javascript is giving each new field a NAME with an array name such as feature[] to indicate it is an array.

Secondly in your php you need to var_dump($_POST) to see what is being sent.

saraswat19
01-07-2012, 09:18 PM
The code you posted is not very helpful in finding what's wrong...can you post the entire PHP script that you're using?
My code is like this


if($_REQUEST['Id']=='' && isset($_POST['submit_form']))
{
$street_name=$_REQUEST['street_name'];
$city=$_REQUEST['city'];
$latlong =$_REQUEST['lat1'];
$latlngm=explode(",",$latlong);
$lat=$latlngm[0];
$long=$latlngm[1];
$property_name=$_REQUEST['property_name'];
$property_type=$_REQUEST['property_type'];
$tenure=$_REQUEST['tenure'];
$whyselling=$_REQUEST['why_are_you_selling'];
$bedrooms=$_REQUEST['bedrooms'];
$bathrooms=$_REQUEST['bathrooms'];
$receptions=$_REQUEST['receptions'];
$floors=$_REQUEST['floors'];
$vurl=$_REQUEST['video_url'];
$postcode=$_REQUEST['postcode'];
$houseno=$_REQUEST['h_no'];
$price=$_REQUEST['price'];
$feature1=$_REQUEST['feature1'];
$feature2=$_REQUEST['feature2'];
$feature3=$_REQUEST['feature3'];
$feature4=$_REQUEST['feature4'];
$feature5=$_REQUEST['feature5'];
$feature6=$_REQUEST['feature6'];
$feature7=$_REQUEST['feature7'];
$feature8=$_REQUEST['feature8'];
$feature9=$_REQUEST['feature9'];
$summary=$_REQUEST['summary'];

$description=$_REQUEST['desc'];
$listing_status=$_REQUEST['list_status'];
$country=$_REQUEST['country'];
$rent=$_REQUEST['rent'];

$query="insert into avow_property_details (UserId,Property_Name,Property_Type,Tenure,whyselling,Bedrooms,Bathrooms,Receptions,floors,Videourl, Zip_Code,House_No,Street_Road_Name,City,Price,feature1,feature2,feature3,feature4,feature5,feature6, feature7,feature8,feature9,short_description,Description,Image,lat,lng,Created,Country,Is_property_r ent,listing_status) values('".$UserId."','".$property_name."','".$property_type."','".$tenure."','".$whyselling."','".$bedrooms."','".$bathrooms."','".$receptions."','".$floors."','".$vurl."','".$postcode."','".$houseno."','".$street_name."','".$city."','".$price."','".$feature1."','".$feature2."','".$feature3."','".$feature4."','".$feature5."','".$feature6."','".$feature7."','".$feature8."','".$feature9."','".$summary."','".$description."','".$imgName."','".$lat."','".$long."',curdate(),'".$country."','".$rent."','".$listing_status."');";
executeQuery($query);
}

saraswat19
01-07-2012, 09:36 PM
First you need to be sure that the javascript is giving each new field a NAME with an array name such as feature[] to indicate it is an array.

Secondly in your php you need to var_dump($_POST) to see what is being sent.
thanks a lot
I forgot to add the name to input fields.
Its a silly mistake of mine

Thanks again



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum