Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Location
    India
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unable to post the value of new added field

    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
    PHP 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']; 
    Last edited by saraswat19; 01-07-2012 at 10:44 PM. Reason: forgot to attach file

  • #2
    New to the CF scene
    Join Date
    Dec 2011
    Location
    India
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi
    Please provide me solution..what should i do..??
    Is there any other way to do this?

  • #3
    New Coder
    Join Date
    Jan 2012
    Location
    RI, USA
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts
    The code you posted is not very helpful in finding what's wrong...can you post the entire PHP script that you're using?

  • #4
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,475
    Thanks
    63
    Thanked 537 Times in 524 Posts
    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.
    I can't really think of anything to write here now...

  • Users who have thanked tangoforce for this post:

    saraswat19 (01-07-2012)

  • #5
    New to the CF scene
    Join Date
    Dec 2011
    Location
    India
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Alternative View Post
    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

    PHP Code:
    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_rent,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);


  • #6
    New to the CF scene
    Join Date
    Dec 2011
    Location
    India
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tangoforce View Post
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •