Grabbing Values From an Array for Posting
Posted on
16th Feb 2014 07:03 pm by
admin
I have a grid array that I am using with a form that when it hits the currently named test.php it logs in and grabs 3 coordinates (i.e. B1, D3, etc). which come back as XML fields "challenge1", "challenge2", and "challenge3" and then has to match up the value in the grid array and pass the correct value down to my post fields as "response1", "response2", "response3". However, nothing I'm trying will get the values out to then post. I'm sure my coding is wrong, but I cannot figure out the right syntax to make it work.
Here is part of my grid array:
$grid_array = array("A1" => "V", "A2" => "2", "A3" => "1", "A4" => "N", "A5" => "7", "B1" => "H", "B2" => "9", "B3" => "3", "B4" => "T", "B5" => "J", "C1" => "9", "C2" => "2", "C3" => "2", "C4" => "6", "C5" => "Y", "D1" => "N", "D2" => "1", "D3" => "R", "D4" => "8", "D5" => "K");
I tried coding this, which is completely wrong, but maybe I'm on to something at least?:
foreach ($grid_array as $key => $value) {
$grid_array['$xdoc1->challenge1'] = '$response1';
$grid_array['$xdoc1->challenge2'] = '$response2';
$grid_array['$xdoc1->challenge3'] = '$response3';
}
($xdoc1 is the XML return as a SimpleXMLElement, by the way)
But this returns an error of
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting T_PAAMAYIM_NEKUDOTAYIM
Am I at least on the right track? If not, any ideas on how I can code this to pull out the values that are returned from the first hit and have it pass the appropriate values to the second hit?
No comments posted yet
Your Answer:
Login to answer
55
48
Other forums
Consuming third party Payment Gateway API from Procedure.
Hi All,
First of all i would like to thank all the people of the oracle forum for providi
ScriptManager History and Opera Issue
I am having an issue in opera with the ScriptManager. I have a ScriptManager on a page with history
PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 200
Finding digits in variable containing text, and IDing them
$romanstock = "http://www.remoteprice.com/data.asp?storeid=123&itemcode=456&typ
JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w
Loop Through Date Range
Hi guys,
I have date range as parameter like 01/JAN/2009 TO 16/JAN/2009 now i want to loop thro
echo $rows help
Hi all,
Hopefully something simple that I don't know!
I have this:
Code: [Selec
How to add functionality to a simple php calender?
Hello everyone,
I have just finished creating a simple php calander. Can someone point
Curl & sessions PLS HELP
Hello,
I have a problem with curl and sessions and i will try to explain the best i could.
Web Application Recipe
Hi Guys!
I am working with the Web Application recipes. I am currently working on the sen