Jump to content

battling to get post requests in a dynamic handler...


Greywacke
 Share

Recommended Posts

hi again.okay...first off below is a function to flatten the array incase multilevel arrays were sent such as with zencart forms...secondly is a function that is supposed to calculate wether it is a page level variable to return or a post variable to request. the $ prefixing inside the string, is the key to a system variable.thirdly is the code. it gets the variables from the database after identifying the form by referer - but unfortunately the printed arrays do not return what is expected. the keys for the form values are numbers as can be seen in the arrays printed below the code.how is this? anybody feel up to the task lending a clearer eye? obviously the translation bit will not occur because this is not a zencart form. and these are the field values as output by the database, but it does not get them! :)obviously the second array printed is empty! ($userarr), but i cannot see why... these variables in the database are set in the admin environment... and do exist along with their types and $ signs...here is the relevant piece of code:

function array_flatten($array, $return=array()) {	foreach ($array as $key => $value) {		if (is_array($value)) {			$return = array_flatten($value,$return);		} else {			if ($value) {				$return[] = $value;			}		}	}	return $return;}function newpost($key) {	if (strstr($key,"$")!===false) {		return $GLOBALS[$key];	} else {		return $_POST[$key];	}}$referer = $_SERVER["HTTP_REFERER"];$tsql0 = "SELECT * FROM 32_webformconfigs WHERE text_FormWebLocation LIKE \"".$referer."%\";";$tresult0 = mysql_query_errors($tsql0, $conn, __FILE__ , __LINE__ , true );$trow0 = mysql_fetch_array($tresult0);$formid = $trow0["bigint_FormID"];$formname = $trow0["text_FormName"];$pmail = $trow0["text_FormMailerFromAddress"];$tsql1 = "SELECT * FROM 33_webformdetails WHERE bigint_FormID = ".$formid." AND text_DetailDescription = \"TRANS\";";$tresult1 = mysql_query_errors($tsql1, $conn, __FILE__ , __LINE__ , true );//$trow1 = mysql_fetch_array($tresult1);$trans = explode(";",$trow1["text_DetailValue"],7);$tsql2 = "SELECT * FROM 33_webformdetails WHERE bigint_FormID = ".$formid." AND text_DetailDescription = \"VTIGR\";";$tresult2 = mysql_query_errors($tsql2, $conn, __FILE__ , __LINE__ , true );$trow2 = mysql_fetch_array($tresult2);$incl_vtiger = $trow2["text_DetailValue"];$mailadds = array();$mailaddp = array();$mailaddl = array();$attribids = array();$suppliers = array();$supplierp = array();$attribsarr = array();$errmsg = array();$failure = 0;$success = 0;$ffail = 0;$fsucc = 0;$space = " ";$hash = "#";$obracket = "(";$cbracket = ")";$_POST = array_flatten($_POST,array());$dynarr = $_POST;$tsql6 = "SELECT * FROM 33_webformdetails WHERE bigint_FormID = ".$formid." AND text_DetailDescription = \"FIELD\" ORDER BY bigint_DetailID ASC;";$tresult6 = mysql_query_errors($tsql6, $conn, __FILE__ , __LINE__ , true );if ($tresult6) {	while ($trow6 = mysql_fetch_array($tresult6)) {		$val = explode(";",$trow6["text_DetailValue"]);		switch ($val[1]) {			case 1: // attributes				foreach ($_POST as $key => $value) {					if ($trans) {						$key = translate($key,1);						$value = translate($value,0);					}					if ($key == $val[0]) {						if (str_in_array($key,$attribsarr)) {							$attribsarr[$key] .= ", ".(($val[2]=="UPPER CASING")?strtoupper($value):($val[2]=="lower casing")?strtolower($value):($val[2]=="Sentence casing")?sentence_case($value):($val[2]=="Name Casing")?name_case($value):$value);						} else {							$attribsarr[$key] = (($val[2]=="UPPER CASING")?strtoupper($value):($val[2]=="lower casing")?strtolower($value):($val[2]=="Sentence casing")?sentence_case($value):($val[2]=="Name Casing")?name_case($value):$value);						}					}				}				break;			case 2: // users				foreach ($_POST as $key => $value) {					if ($trans) {						$key = translate($key,1);						$value = translate($value,0);					}					if ($key == $val[0]) {						if (str_in_array($val[3],$userarr)) {							$userarr[$val[3]] .= ", ".(($val[2]=="UPPER CASING")?strtoupper($value):($val[2]=="lower casing")?strtolower($value):($val[2]=="Sentence casing")?sentence_case($value):($val[2]=="Name Casing")?name_case($value):$value);						} else {							$userarr[$val[3]] = (($val[2]=="UPPER CASING")?strtoupper($value):($val[2]=="lower casing")?strtolower($value):($val[2]=="Sentence casing")?sentence_case($value):($val[2]=="Name Casing")?name_case($value):$value);						}					}				}				break;			case 3: // concat				for ($i = 2; $i < count($val); $i++) {					$dynarr[$val[0]] .= newpost($val[$i]);				}				break;			default:				$dynarr[$val[0]] = newpost($val[0]);		}		$dynarr[$val[0]] = newpost($val[0]);	}}print_r($attribsarr);echo "<br />\n<br />\n";print_r($userarr);echo "<br />\n<br />\n";print_r($dynarr);echo "<br />\n<br />\n";

Array()<br /><br /><br /><br />Array( [0] => 1 [1] => 99501 [2] => Pierre du Toit [3] => Anchorage, 99501 [4] => 072-915-4799 [5] => Anchorage [6] => pierre@canopyxchange.za.net [7] => Alaska [8] => Skype: greywacke_2k7 [9] => FORD [10] => NEW [11] => EXPLORER [12] => Lifestyle Deluxe [13] => 2007-2010 [14] => Aluminum [15] => CREWCAB [16] => COLORCODED [17] => SHORTBOX [18] => $1,750 plus [19] => testing dynamic handler [20] => Not within next 3 months [service_id] => [ZipCode] => [City] => [County] => [state] => [Name] => [Phone] => => [iM] => [Make] => [Model] => [Year] => [CabSize] => [bedSize] => [Comments] => [Condition] => [Function] => [Product] => => [budget] => [Fitment] => [$duplicates] => [$space] => [l360firstname] => [$leadid] => [$formname] => [l360makemodel] => [l360other] => [$hash] => [l360leadid] => [$obracket] => [$cbracket] => )<br /><br />
see it's creating the stored variables but not requesting them. why oh why would it flatten the $_POST array as indexes and no keys? :/ all variables are added to $dynarray - this output is the most informative (the last array)... it seems there is something wrong with the flatten_array function - but what and why? :)here is the admin interface i developed for adding fields/variables to be processed, and choosing a variable type and other values depending on field/variable types.Administrative Interface for Configuring Dynamic Form Handlerplease help meh with some clarity as to resolving this issue! Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

after repairing some minor errors, and updating the code in the above post - the main issue still persists. it is not parsing the array by key but by index instead! :/how can i be sure to parse an array by key and not by index?

Link to comment
Share on other sites

well i was referring to them with keys as associative (strings) and indexes as indexed (numbers). maybe my question would be clearer put as what do i need to do to ensure parsing the array as associative and not indexed.i'm taking a leap and guessing $_POST is both an associative and indexed array (eg can access the values posted either by key or index). i guess the real question would be why is the flatten_array function parsing just the indexed digits and not the associative keys...

Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

If you're asking why the array ends up with string keys, it's probably because they're being assigned here:

			case 3: // concat				for ($i = 2; $i < count($val); $i++) {					$dynarr[$val[0]] .= newpost($val[$i]);				}				break;			default:				$dynarr[$val[0]] = newpost($val[0]);		}		$dynarr[$val[0]] = newpost($val[0]);

You're only printing the array at the end, but assuming there is a problem with the array_flatten function. Have you printed the array right after calling array_flatten?

Link to comment
Share on other sites

true, as usual... will attempt that :)

Link to comment
Share on other sites

oh i should probably have shown the database selection:

[b]bigint_DetailID 	bigint_FormID 	text_DetailDescription 	text_DetailValue[/b]1			1		FIELD				service_id;2;Default Casing;bigint_ServiceID2			1		FIELD				ZipCode;2;Default Casing;bigint_ConsumerRegion3			1		FIELD				City;2;Default Casing;text_ConsumerCity4			1		FIELD				County;2;Default Casing;text_ConsumerCounty5			1		FIELD				State;2;Default Casing;text_ConsumerState6			1		FIELD				Name;2;Name Casing;text_ConsumerName7			1		FIELD				Phone;2;Default Casing;text_ConsumerPhone8			1		FIELD				Email;2;lower casing;text_ConsumerE-Mail9			1		FIELD				IM;2;Default Casing;text_ConsumerIM10			1		FIELD				Make;1;Default Casing11			1		FIELD				Model;1;Default Casing12			1		FIELD				Year;1;Default Casing13			1		FIELD				CabSize;1;Default Casing14			1		FIELD				BedSize;1;Default Casing15			1		FIELD				Comments;2;Sentence casing;text_LeadMessage16			1		FIELD				Condition;1;Default Casing17			1		FIELD				Function;1;Default Casing18			1		FIELD				Product;1;Default Casing19			1		FIELD				Color;1;Default Casing20			1		FIELD				Budget;1;Default Casing21			1		FIELD				Fitment;1;Default Casing34			1		FIELD				$duplicates;035			1		FIELD				$space;036			1		FIELD				l360firstname;3;Name;$space;$obracket;$duplicates;$cbracket37			1		FIELD				$leadid;041			1		FIELD				$formname;051			1		FIELD				l360makemodel;3;Make;$space;Model55			1		FIELD				l360other;3;CabSize;$space;BedSize;$space;Function;$space;Condition60			1		FIELD				$hash;061			1		FIELD				l360leadid;3;$hash;$leadid62			1		FIELD				$obracket;063			1		FIELD				$cbracket;0

in all the cases, val[0] would be a string and not a digit (even if in a string). the print out of the flattened array (which $_POST is set to, directly after setting it) is as follows:

Array( [0] => 1 [1] => 99501 [2] => Pierre du Toit [3] => Anchorage, 99501 [4] => 072-915-4799 [5] => Anchorage [6] => pierre@canopyxchange.za.net [7] => Alaska [8] => Skype: greywacke_2k7 [9] => FORD [10] => NEW [11] => EXPLORER [12] => Lifestyle Deluxe [13] => 2007-2010 [14] => Aluminum [15] => CREWCAB [16] => COLORCODED [17] => SHORTBOX [18] => $1,750 plus [19] => testing dynamic form handler - BLACK TRUCK CAP [20] => Not within next 3 months)
now i know - better than assuming but still wonder why... Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

and i had a thought to inspect the array before it is passed through that function flatten_array, and here it is:

here is the array_flatten function that is messing me around... 0o
function array_flatten($array, $return=array()) {	foreach ($array as $key => $value) {		if (is_array($value)) {			$return = array_flatten($value,$return);		} else {			if ($value) {				[b]$return[] = $value;[/b]			}		}	}	return $return;}

had a look at the function with better clarity this morning, and the line in bold is what needs to change to the following in order to maintain keys.

$return[$key] = $value;

Link to comment
Share on other sites

there is however, still the issue of the $attribsarr and $userarr arrays not being populated despite successfully parsing the $_POST array... here is the code sofar, followed by the arrays printed:

function array_flatten($array, $return=array()) {	foreach ($array as $key => $value) {		if (is_array($value)) {			$return = array_flatten($value,$return);		} else {			if ($value) {				$return[$key] = $value;			}		}	}	return $return;}function newpost($key) {	if (strstr($key,"$")!==false) {		$syskey = str_replace("$","",$key);		return $GLOBALS[$syskey];	} else {		return $_POST[$key];	}}/*END FUNCTION DECLERATIONBEGIN VARIABLE DECLERATION*/// identify form$referer = $_SERVER["HTTP_REFERER"];$tsql0 = "SELECT * FROM 32_webformconfigs WHERE text_FormWebLocation LIKE \"".$referer."%\";";$tresult0 = mysql_query_errors($tsql0, $conn, __FILE__ , __LINE__ , true );$trow0 = mysql_fetch_array($tresult0);$formid = $trow0["bigint_FormID"];$formname = $trow0["text_FormName"];$pmail = $trow0["text_FormMailerFromAddress"];$tsql1 = "SELECT * FROM 33_webformdetails WHERE bigint_FormID = ".$formid." AND text_DetailDescription = \"TRANS\";";$tresult1 = mysql_query_errors($tsql1, $conn, __FILE__ , __LINE__ , true );//$trow1 = mysql_fetch_array($tresult1);$trans = explode(";",$trow1["text_DetailValue"],7);$tsql2 = "SELECT * FROM 33_webformdetails WHERE bigint_FormID = ".$formid." AND text_DetailDescription = \"VTIGR\";";$tresult2 = mysql_query_errors($tsql2, $conn, __FILE__ , __LINE__ , true );$trow2 = mysql_fetch_array($tresult2);$incl_vtiger = $trow2["text_DetailValue"];$mailadds = array();$mailaddp = array();$mailaddl = array();$attribids = array();$suppliers = array();$supplierp = array();$attribsarr = array();$userarr = array();$errmsg = array();$failure = 0;$success = 0;$ffail = 0;$fsucc = 0;$space = " ";$hash = "#";$obracket = "(";$cbracket = ")";//print_r($_POST);//echo "<br />\n<br />\n";$_POST = array_flatten($_POST,array());//print_r($_POST);//echo "<br />\n<br />\n";$dynarr = $_POST;$tsql6 = "SELECT * FROM 33_webformdetails WHERE bigint_FormID = ".$formid." AND text_DetailDescription = \"FIELD\" ORDER BY bigint_DetailID ASC;";$tresult6 = mysql_query_errors($tsql6, $conn, __FILE__ , __LINE__ , true );if ($tresult6) {	while ($trow6 = mysql_fetch_array($tresult6)) {		$val = explode(";",$trow6["text_DetailValue"]);		switch ($val[1]) {			case 1: // attributes				foreach ($_POST as $key => $value) {					if ($trans!="") {						$key = translate($key,1);						$value = translate($value,0);					}					if ($key == $val[0]) {						if (str_in_array($key,$attribsarr,0)) {							$attribsarr[$key] .= ", ".casing($value,$val[2]);						} else {							$attribsarr[$key] = casing($value,$val[2]);						}					}				}				break;			case 2: // users				foreach ($_POST as $key => $value) {					if ($trans!="") {						$key = translate($key,1);						$value = translate($value,0);					}					if ($key == $val[0]) {						if (str_in_array($val[3],$userarr,0)) {							$userarr[$val[3]] .= ", ".casing($value,$val[2]);						} else {							$userarr[$val[3]] = casing($value,$val[2]);						}					}				}				break;			case 3: // concat				for ($i = 2; $i < count($val); $i++) {					$dynarr[$val[0]] .= newpost($val[$i]);				}				break;			default:				$dynarr[$val[0]] = newpost($val[0]);		}		$dynarr[$val[0]] = newpost($val[0]);	}}print_r($attribsarr);echo "<br />\n<br />\n";print_r($userarr);echo "<br />\n<br />\n";print_r($dynarr);echo "<br />\n<br />\n";

the arrays are supposed to be set in cases 1 and 2 of val[1] for these fields... maybe reset the pointer before looping through $_POST? Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

sighs, i am at wits end here... resetting the $_POST arrays before parsing them does not seem to help. let me try printing it in those two places in bold below... (printing showed the expected values, but the behaviour is not as expected)

			case 1: // attributes				[b]//reset($_POST);				//echo $val[0]."\n";				//print_r($_POST);				//echo "\n";[/b]				foreach ($_POST as $key => $value) {					if ($trans!="") {						$key = translate($key,1);						$value = translate($value,0);					}					if ($key == $val[0]) {						if (str_in_array($val[0],$attribsarr,0)) {							$attribsarr[$val[0]] .= ", ".casing($value,$val[2]);						} else {							$attribsarr[$val[0]] = casing($value,$val[2]);						}					}				}				break;			case 2: // users				[b]//reset($_POST);				//echo $val[0]."\n";				//print_r($_POST);				//echo "\n";[/b]				foreach ($_POST as $key => $value) {					if ($trans!="") {						$key = translate($key,1);						$value = translate($value,0);					}					if ($key == $val[0]) {						if (str_in_array($val[3],$userarr,0)) {							$userarr[$val[3]] .= ", ".casing($value,$val[2]);						} else {							$userarr[$val[3]] = casing($value,$val[2]);						}					}				}				break;

Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

ok, it printed each expected key from the database and the post array as expected, with each case within the database resultset loop. but it does not seem to enter the if statements or populate $attribsarr and $userarr :) what have i overlooked?it might be prudent to share the function which seeks for a value in an array, either as key/index or value. have edited it as follows. it will only allow multiple form elements with the same name to be collected into the same array element though.

function str_in_array($needle, $haystack, $sw = 1) {	foreach ($haystack as $value[0] => $value[1]) {		if ($value[$sw]==$needle) {			return true;		}	}	return false;}

$value is supposed to be an array, with index 0 as the key and index 1 as the value of each element of the array.also, it still does not show $attribsarr and $userarr being populated, as per the array printout after the variable grabbing section in the previous posts...

Array()<br /><br />Array()<br /><br />Array(	[service_id] => 1	[ZipCode] => 99501	[Name] => Pierre du Toit	[City] => Anchorage, 99501	[Phone] => 072-915-4799	[County] => Anchorage	[Email] => pierre@canopyxchange.za.net	[State] => Alaska	[IM] => Skype: greywacke_2k7	[Make] => FORD	[Condition] => NEW	[Model] => EXPLORER	[Function] => Lifestyle Deluxe	[Year] => 2007-2010	[Product] => Aluminum	[CabSize] => CREWCAB	[Color] => COLORCODED	[BedSize] => SHORTBOX	[Budget] => $1,750 plus	[Comments] => testing dynamic handler	[Fitment] => Not within next 3 months	[$duplicates] => 	[$space] =>  	[l360firstname] => 	[$leadid] => 	[$formname] => TruckCapXchange	[l360makemodel] => 	[l360other] => 	[$hash] => #	[l360leadid] => 	[$obracket] => (	[$cbracket] => ))

Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

i am not sure what you are trying to do or the purpose of the code (i did not get it)..but in this case it seems to me you are trying to get the array key dynamicaly..by a $key var

$return[$key] = $value;

so it should be something like this in this case..

$return["$key"] = $value;

Edited by birbal
Link to comment
Share on other sites

i am attempting to create a dynamic form handler which is configurable in the database as to which fields it should request and what it should do with them (where to put them). "$key" is the same as $key though, it is in string compilation. i believe this $ could be the key as to why another part would not be working - perhaps i should escape the $ when checking if there is a $ in the field name from the database! :( thankyou birbal though, for focusing my attention to another bug :)eg - the following updated newpost function should resolve this minor problem :)

function newpost($key) {	if (strstr($key,"\$")!==false) {		$syskey = str_replace("\$","",$key);		return $GLOBALS[$syskey];	} else {		return $_POST[$key];	}}

previously it was looking for "$" not " \$" in the string... therefore replacing $ with "" because there is no variable named $ in that functions scope :)unfortunately this does not relieve anything major though and make it work as expected...

Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

believe i have found the solution! am trying to test, but unfortunately getting dns errors to http://www.truckcapxchange.com/index2.html :) so it's currently not available on my connection. it is just doing the default case because it is checking $val[1] against cases 1, 2 and 3 i should be checking intval($val[1]) instead!!! :)

Link to comment
Share on other sites

ok yay! the dns is up again - but the form is still not working... i printed just before the if statement as follows:

			case 1: // attributes				//reset($_POST);				//echo $val[0]."\n";				//print_r($_POST);				//echo "\n";				foreach ($_POST as $key => $value) {					if ($trans!="") {						$key = translate($key,1);						$value = translate($value,0);					}					[b]echo $key." = ".$val[0]."\n";[/b]					if ($key == $val[0]) {						if (str_in_array($val[0],$attribsarr,0)) {							$attribsarr[$val[0]] .= ", ".casing($value,$val[2]);						} else {							$attribsarr[$val[0]] = casing($value,$val[2]);						}					}				}				break;			case 2: // users				//reset($_POST);				//echo $val[0]."\n";				//print_r($_POST);				//echo "\n";				foreach ($_POST as $key => $value) {					if ($trans!="") {						$key = translate($key,1);						$value = translate($value,0);					}					[b]echo $key." = ".$val[0]."\n";[/b]					if ($key == $val[0]) {						if (str_in_array($val[3],$userarr,0)) {							$userarr[$val[3]] .= ", ".casing($value,$val[2]);						} else {							$userarr[$val[3]] = casing($value,$val[2]);						}					}				}				break;

and the result was:

 = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = service_id = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = ZipCode = City = City = City = City = City = City = City = City = City = City = City = City = City = City = City = City = City = City = City = City = City = County = County = County = County = County = County = County = County = County = County = County = County = County = County = County = County = County = County = County = County = County = State = State = State = State = State = State = State = State = State = State = State = State = State = State = State = State = State = State = State = State = State = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Name = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Phone = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = Email = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = IM = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Make = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Model = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = Year = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = CabSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = BedSize = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Comments = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Condition = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Function = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Product = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Color = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Budget = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment = Fitment

thus for some reason, $key is blank. i am going to test the value of $test if !== to "".

Link to comment
Share on other sites

i was correct (not at first though) - the issue was with the translation if statement.if there is no translation

Array(    [Make] => FORD    [Model] => EXPLORER    [Year] => 2007-2010    [CabSize] => CREWCAB    [bedSize] => SHORTBOX    [Condition] => NEW    [Function] => LIFESTYLE DELUXE    [Product] => ALUMINUM    [Color] => COLORCODED    [budget] => $1,750 PLUS    [Fitment] => NOT WITHIN NEXT 3 MONTHS)<br /><br />Array(    [bigint_ServiceID] => 1    [bigint_ConsumerRegion] => 99501    [text_ConsumerCity] => ANCHORAGE, 99501    [text_ConsumerCounty] => ANCHORAGE    [text_ConsumerState] => ALASKA    [text_ConsumerName] => PIERRE DU TOIT    [text_ConsumerPhone] => 072-915-4799    [text_ConsumerE-Mail] => PIERRE@CANOPYXCHANGE.ZA.NET    [text_ConsumerIM] => SKYPE: GREYWACKE_2K7    [text_LeadMessage] => TESTING DYNAMIC HANDLER)<br /><br />Array(    [service_id] => 1    [ZipCode] => 99501    [Name] => Pierre du Toit    [City] => Anchorage, 99501    [Phone] => 072-915-4799    [County] => Anchorage    [Email] => pierre@canopyxchange.za.net    [state] => Alaska    [iM] => Skype: greywacke_2k7    [Make] => FORD    [Condition] => NEW    [Model] => EXPLORER    [Function] => Lifestyle Deluxe    [Year] => 2007-2010    [Product] => Aluminum    [CabSize] => CREWCAB    [Color] => COLORCODED    [bedSize] => SHORTBOX    [budget] => $1,750 plus    [Comments] => testing dynamic handler    [Fitment] => Not within next 3 months    [$duplicates] =>     [$space] =>      [l360firstname] =>     [$leadid] =>     [$formname] => TruckCapXchange    [l360makemodel] =>     [l360other] =>     [$hash] => #    [l360leadid] =>     [$obracket] => (    [$cbracket] => ))

i would suffice it to say ISSUE RESOLVED!!! this was the issue from the start :) but thanks to everyone for assisting me in finding other lesser bugs and resolving them too! :)thank you all again :)

Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...