out of bounds
unread,Oct 22, 2008, 6:26:27 PM10/22/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AdWords API Forum
Would appreciate any help you could provide with this issue.
i am basically trying to develop a simple application to take a user's
input of seed keyword from a php form and then passing that seed
keyword into the example get keyword variations php file that makes
the call to the google api.
however, whenever i try to pass the form variable for the seed keyword
directly from the POST into the actual xml, i get an error message. i
have researched xml and php on google and cant seem to come up with
anything useful. the error message isnt particularly helpful or
specific. it is "Warning: Invalid argument supplied for foreach() in /
home/outofbo1/public_html/GAW/My_write_keyword_variations.php on line
76".
the xml code that i am using is based on code examples provided by
google. i am using the code below as part of the php 'action' file for
processing a simple form that asks the user what keyword they want to
analyze. then i pass that value into the code as shown in example two
below.
example one below shows the (partial) code that works when i simply
'hard code' the keyword to test the functionality ('keyword manually
entered here')
example one:
$request_xml =
'<checkKeywordTraffic>' .
'<requests>' . keyword manually entered here. '</requests>' .
'</checkKeywordTraffic>';
$estimates = $estimator_service->call('checkKeywordTraffic',
$request_xml);
example two (code that doesnt work);
$MyKeyword = $_POST["MyKeyword"]
$request_xml =
'<checkKeywordTraffic>' .
'<requests>' . $MyKeyword . '</requests>' .
'</checkKeywordTraffic>';
$estimates = $estimator_service->call('checkKeywordTraffic',
$request_xml);
i am thinking the issue is that you cant simple pass a variable's
value into an xml statement but that i will have to take the form
input, generate the entire $request_xml statement and then include
that as a separate file.
any ideas or did i confuse you with my horrible explanations as
usual? :)
thanks in advance,
jay wilner