Jump to content

get value from array textbox


build5264

Recommended Posts

    $fields = array();
    
    $fields[] = array("type"=>"hidden", "name"=>"MemberID", "value"=>$this->common_vars["MemberID"]["value"]);
    $fields[] = array("type"=>"hidden", "name"=>"Name", "value"=>$this->common_vars["Name"]["value"]);
    $fields[] = array("type"=>"hidden", "name"=>"Region", "value"=>$this->common_vars["Region"]["value"]);
    $fields[] = array("type"=>"hidden", "name"=>"Division", "value"=>$this->common_vars["Division"]["value"]);
    $fields[] = array("type"=>"hidden", "name"=>"memURL", "value"=>$notify_url);
    
    $fields[] = array("type"=>"hidden", "name"=>"oa", "value"=>PROCESS_Complaint);
    
    $exp_years = array();
    for($i=date("Y"); $i<=date("Y")+10; $i++){
    $exp_years[] = array("value"=>$i, "caption"=>$i);
    }

    $exp_months = array();
    for($i=1; $i<=12; $i++){
    $exp_months[] = array("value"=>($i<10?"0":"").$i, "caption"=>$i);
    }

    $fields[] = array("type"=>"text", "name"=>"Name", "value"=>$this->common_vars["name"]["value"], "caption"=>$msg["Complaint"]["Name"]);
    $fields[] = array("type"=>"text", "name"=>"Productid", "value"=>"", "caption"=>$msg["Complaint"]["Productid"]);
    $fields[] = array("type"=>"text", "name"=>"Location", "value"=>"", "caption"=>$msg["Complaint"]["Location"]);
    $fields[] = array("type"=>"select", "name"=>"ExpYear", "value"=>date("Y"), "options"=>$exp_years, "caption"=>$msg["Complaint"]["expiration_year"]);
    $fields[] = array("type"=>"select", "name"=>"ExpMonth", "value"=>date("n"), "options"=>$exp_months, "caption"=>$msg["Complaint"]["expiration_month"]);
    $fields[] = array("type"=>"text", "name"=>"News", "value"=>"", "caption"=>$msg["Complaint"]["News"]);
    
    return $fields; 

            $post_data = "".
            "MemberID=".urlencode($this->settings_vars[$this->common_vars["MemberID"]["value"]).
            "&Name=".urlencode($this->settings_vars[$this->common_vars["Name"]["value"]).
            "&Region=".urlencode($this->common_vars["Region"]["value"]).
            "&Division=".urlencode($this->common_vars["Division="]["value"]).
            "&Name=".urlencode($this->common_vars["name"]["value"]).
            "&Productid= ????
            "&Location= ????
            "&ExpYear= ????
            "&ExpMonth= ????
            "&News= ???? ); 

 

this script will used to post from serverA into serverB

how to get the value that post from from serverA into serverB that created from array textbox

 

i was try :

"&Productid=".urlencode($_POST["Productid"]).
"&Productid=".urlencode($_GET["Productid"]).
"&Productid=".urlencode($_REQUEST["Productid"]).
"&Productid=".urlencode($_COOKIE["Productid"]).
"&Productid=".urlencode($fields["Productid"]). 

but no luck at all

any help is definitely appreciated.

Please can anyone help?

 

Link to comment
https://forums.phpfreaks.com/topic/201604-get-value-from-array-textbox/
Share on other sites

don't know if this will help you or not here is a function i wrote to get an array value

 

<?php

function get_arrayv($array,$str){
$arrayv='';
$arrayv = $array[$str];
return $arrayv;
}

$animalslist=array();
$animalslist=array('dog' => 'poodle','cat' => 'siamese','bird' => 'parrot');

$getcat= get_arrayv($animalslist,'cat');

print $getcat;
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.