Child pages
  • Chapter 4 - Retrieve Data - Retrieving a Client

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
$opt[ 'resource' ] = 'customers';
$opt[ 'id' ] = $_GET[ 'id' ];
$xml = $webService->get( $opt );
Tip

Use " isset" () before setting an ID allows you to easily carry out everything in this chapter.

Accessing resources is performed as above for displaying the list because the tags that interest us are children of the "customers" tag.

Tipcode

$resources = $xml->customers->children();

This path is done in another way (here in an HTML table):

Tipcode

foreach ( $resources as $key => $resource )

...


  echo 'Name of field: ' . $key . ' - Value: ' . $resource . '<br />';

You now have everything needed to create a script to both list and display information for a particular client.

...