Parse error: parse error, expecting `'&'' or `T_VARIABLE' in C:\wamp\www\SimpleDB\Samples\CreateDomainSample.php on line 69 in **** plz help me to solve this error****
Posted by: niccc (---.aut.ac.nz)
Date: August 14, 2009 06:08AM

<?php
/**
* PHP Version 5
*
* @category Amazon
* @package Amazon_SimpleDB
* @copyright Copyright 2008 Amazon Technologies, Inc.
* @link [aws.amazon.com]
* @license [aws.amazon.com] Apache License, Version 2.0
* @version 2009-04-15
*/
/*******************************************************************************
* __ _ _ ___
* ( )( \/\/ )/ __)
* /__\ \ / \__ \
* (_)(_) \/\/ (___/
*
* Amazon Simple DB PHP5 Library
* Generated: Mon May 11 15:25:08 PDT 2009
*
*/

/**
* Create Domain Sample
*/

include_once ('.config.inc.php');

/************************************************************************
* Instantiate Implementation of Amazon SimpleDB
*
* AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY constants
* are defined in the .config.inc.php located in the same
* directory as this sample
***********************************************************************/
$service = new Amazon_SimpleDB_Client('AKIAIS3IXMY3SVHXZEBQ',
'xy6TFhVENknHEv4ZF/HoaVnkElyAjpGV/NwAkpR8');

/************************************************************************
* Uncomment to try out Mock Service that simulates Amazon_SimpleDB
* responses without calling Amazon_SimpleDB service.
*
* Responses are loaded from local XML files. You can tweak XML files to
* experiment with various outputs during development
*
* XML files available under Amazon/SimpleDB/Mock tree
*
***********************************************************************/
// $service = new Amazon_SimpleDB_Mock();

/************************************************************************
* Setup request parameters and uncomment invoke to try out
* sample for Create Domain Action
***********************************************************************/
// @TODO: set request. Action can be passed as Amazon_SimpleDB_Model_CreateDomainRequest
// object or array of parameters
// invokeCreateDomain($service, $request);


/**
* Create Domain Action Sample
* The CreateDomain operation creates a new domain. The domain name must be unique
* among the domains associated with the Access Key ID provided in the request. The CreateDomain
* operation may take 10 or more seconds to complete.
*
* @param Amazon_SimpleDB_Interface $service instance of Amazon_SimpleDB_Interface
* @param mixed $request Amazon_SimpleDB_Model_CreateDomain or array of parameters
*/
function invokeCreateDomain(Amazon_SimpleDB_Interface $service, array('DomainName' => 'ksnshop'))
{
try {
$response = $service->createDomain($request);

echo ("Service Response\n"winking smiley;
echo ("=============================================================================\n"winking smiley;

echo(" CreateDomainResponse\n"winking smiley;
if ($response->isSetResponseMetadata()) {
echo(" ResponseMetadata\n"winking smiley;
$responseMetadata = $response->getResponseMetadata();
if ($responseMetadata->isSetRequestId())
{
echo(" RequestId\n"winking smiley;
echo(" " . $responseMetadata->getRequestId() . "\n"winking smiley;
}
if ($responseMetadata->isSetBoxUsage())
{
echo(" BoxUsage\n"winking smiley;
echo(" " . $responseMetadata->getBoxUsage() . "\n"winking smiley;
}
}

} catch (Amazon_SimpleDB_Exception $ex) {
echo("Caught Exception: " . $ex->getMessage() . "\n"winking smiley;
echo("Response Status Code: " . $ex->getStatusCode() . "\n"winking smiley;
echo("Error Code: " . $ex->getErrorCode() . "\n"winking smiley;
echo("Error Type: " . $ex->getErrorType() . "\n"winking smiley;
echo("Request ID: " . $ex->getRequestId() . "\n"winking smiley;
echo("XML: " . $ex->getXML() . "\n"winking smiley;
}
}

?>




I am also including (.config.inc.php) file



<?php

/************************************************************************
* REQUIRED
*
* Access Key ID and Secret Acess Key ID, obtained from:
* [aws.amazon.com]
***********************************************************************/
define('AWS_ACCESS_KEY_ID', 'AKIAIS3IXMY3SVHXZEBQ');
define('AWS_SECRET_ACCESS_KEY', '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');


/************************************************************************
* OPTIONAL ON SOME INSTALLATIONS
*
* Set include path to root of library, relative to Samples directory.
* Only needed when running library from local directory.
* If library is installed in PHP include path, this is not needed
***********************************************************************/
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../.');

/************************************************************************
* OPTIONAL ON SOME INSTALLATIONS
*
* Autoload function is reponsible for loading classes of the library on demand
*
* NOTE: Only one __autoload function is allowed by PHP per each PHP installation,
* and this function may need to be replaced with individual require_once statements
* in case where other framework that define an __autoload already loaded.
*
* However, since this library follow common naming convention for PHP classes it
* may be possible to simply re-use an autoload mechanism defined by other frameworks
* (provided library is installed in the PHP include path), and so classes may just
* be loaded even when this function is removed
***********************************************************************/
function __autoload($className){
$filePath = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
$includePaths = explode(PATH_SEPARATOR, get_include_path());
foreach($includePaths as $includePath){
if(file_exists($includePath . DIRECTORY_SEPARATOR . $filePath)){
require_once $filePath;
return;
}
}
}

?>

Options: ReplyQuote
Re: Parse error: parse error, expecting `'&'' or `T_VARIABLE' in C:\wamp\www\SimpleDB\Samples\CreateDomainSample.php on line 69 in **** plz help me to solve this error****
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: August 14, 2009 02:09PM

This is not a forum to help correct code but
Line 69 should read
function invokeCreateDomain(Amazon_SimpleDB_Interface $service, $request = array('DomainName' => 'ksnshop'))

Options: ReplyQuote
Re: Parse error: parse error, expecting `'&'' or `T_VARIABLE' in C:\wamp\www\SimpleDB\Samples\CreateDomainSample.php on line 69 in **** plz help me to solve this error****
Posted by: niccc (---.jetstream.xtra.co.nz)
Date: August 16, 2009 12:15AM

Hey thanks 4 u r suggestion, i will check the coding

Options: ReplyQuote


Sorry, only registered users may post in this forum.