Jump to content

the apprentice webmaster

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

the apprentice webmaster's Achievements

Member

Member (2/5)

0

Reputation

  1. hi i would really appreciate if someone can translate this soap request into a rest request <?php include ("nusoap.php"); $soapclient("http://soap.amazon.com/shemas2/AmazonWebservices.wsdl",true); $proxy = $soapclient->getProxy(); $params = array ( 'browse_node' =>19, 'page' =>1, 'mode' =>'books', 'tag' =>'xxxx', 'type' =>'lite', 'devtag' =>'xxxx' ); $Result = $proxy->BrowseNodeSearchRequest($params); if ($result['faultstring']) { ?> <h2> error</h2> <? echo $result['faultstring'];?> <? } else{ $total =$result['Totalresults']; $item= $result['details']; ?> can anyone help me on that , jst want to see if it was a REST request how would it look like thx
  2. thx pocobueno1388, when i run the script i got this in my browser : Array ( [itemSearchResponse] => Array ( [xmlns] => http://webservices.amazon.com/AWSECommerceService/2005-02-23 [OperationRequest] => Array ( [HTTPHeaders] => Array ( [Header] => Array ( [0] => Array ( [Name] => UserAgent [Header] => ) ) ) [RequestId] => 1NXHRWCNRZTYMDFAPH6M [Arguments] => Array ( [Argument] => Array ( [0] => Array ( [Name] => AssociateTag [Value] => ASSOCITES_ID [Argument] => ) [1] => Array ( [Name] => Artist [Value] => Lou Donaldson [Argument] => ) [2] => Array ( [Name] => ItemPage [Value] => 1 [Argument] => ) [3] => Array ( [Name] => Service [Value] => AWSECommerceService [Argument] => ) [4] => Array ( [Name] => SubscriptionId [Value] => 1A7XKHR5BYD0WPJVQEG2 [Argument] => ) [5] => Array ( [Name] => ResponseGroup [Value] => Small,Images [Argument] => ) [6] => Array ( [Name] => Operation [Value] => ItemSearch [Argument] => ) [7] => Array ( [Name] => Index [Value] => Music [Argument] => ) [8] => Array ( [Name] => Version [Value] => 2005-02-23 [Argument] => ) ) ) [RequestProcessingTime] => 0.0269980430603027 ) [items] => Array ( [0] => Array ( [Request] => Array ( [isValid] => False [itemSearchRequest] => Array ( [Artist] => Array ( [0] => Lou Donaldson ) [itemPage] => 1 [ResponseGroup] => Array ( [0] => Small [1] => Images ) ) [Errors] => Array ( [Error] => Array ( [0] => Array ( => AWS.MissingParameters [Message] => Your request is missing required parameters. Required parameters include SearchIndex. ) ) ) ) ) ) ) ) [/b]
  3. ok here's the whole php script <?php require_once('tools.inc.php'); define('SEARCH','Lou Donaldson'); define ('SUBID', '1A7XKHR5BYD0WPJVQEG2'); define('ASSOCIATE_ID','ws'); define('VERSION','2005-02-23'); define('NOIMAGE','http://g-images.amazon.com/images/G/01/x-site/icons/no-img-lg.gif'); define('DEFAULT_PAGE','1'); $page=(isset($_GET['page']))?$_GET['page']:DEFAULT_PAGE; $request='http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AssociateTag='.ASSOCITES_ID.'&SubscriptionId='. SUBID.'&Operation=ItemSearch&Index=Music&Artist=Lou%20Donaldson&ItemPage='. $page.'&ResponseGroup=Small,Images&Version='.VERSION; $xml = file_get_contents($request); $Result = xmlparser($xml); function theContent(){ global $Result; echo '<table cellspacing="2" cellpadding="2"><tr>'; $rowcount=0; =>print_r($Result); =>foreach($Result['ItemSearchResponse']['Items'][0]['Item'] as $items) { if (isset($item['MediumImage']['URL'])){ $image='<img src="'.$item["MediumImage"]["URL"].'" />'; } else{ $image='<img src="'.NOIMAGE.'" />';} $title= '<a href="'.$item["DetailPageURL"].'" target="_blank">'. $item["ItemAttributes"]["Title"].'</a>'; if (is_int($rowcount/5)) echo '</tr><tr>'; echo '<td><div style="text-align: center;>'.$title.'</div><div style="text-align: center;>'.$image.'<div></td>'; $rowcount++; } echo '</tr></table>'; return; } function thePagination(){ global $Result; global $page; echo '<div style="text-align: left;"><b>More result.....</div><div>'; for ($i=1; $i<= $Result['ItemSearchResponse']['Items'][0]['TotalPages']; $i++) { $p =($i == $page) ? $page : '<a href="lou.php?page='.$i.'">'.$i.'</a>'; echo $p.' '; } echo '</b></div>'; return; } ?> <html> <head> <title> Lou Donaldson CDs </title> </head> <body> <table width="100%" border="1" cellpadding="2" cellspacing="2"> <tr> <td width="100%" height="250"<?php theContent();?></td> </tr> <tr> <td colspan="2"> <table width="100%"> <?php thePagination();?> </td> </tr> </table> <td> </td> </table> </body> </html> the output should be a page with a set of cds ,
  4. thx for all your reply , when i put this :" print_r($Result);" i get this on top of the error :" Your request is missing required parameters. Required parameters include SearchIndex " so where do i need include that ? thx once again
  5. can anyone tell me why am i getting this error Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\rest\hope2.php on line 19 here the code : $xml = file_get_contents($request); $Result = xmlparser($xml); function theContent(){ global $Result; echo '<table cellspacing="2" cellpadding="2"><tr>'; $rowcount=0; here line 19=> foreach($Result['ItemSearchResponse']['Items'][0]['Item'] as $item) { if (isset($item['MediumImage']['URL'])){ $image='<img src="'.$item["MediumImage"]["URL"].'" />'; } else{ $image='<img src="'.NOIMAGE.'" />';} $title= '<a href="'.$item["DetailPageURL"].'" target="_blank">'. $item["ItemAttributes"]["Title"].'</a>'; if (is_int($rowcount/5)) echo '</tr><tr>'; echo '<td><div style="text-align: center;>'.$title.'</div><div style="text-align: center;>'.$image.'<div></td>'; $rowcount++; } echo '</tr></table>'; return; } i will be waiting for all your reply thx once again .
  6. hi to all , i am having a problem , i am trying to use php and nusoap but i keep getting error . like : " Fatal error: Cannot redeclare class soapclient " than i found out that i need to change the name of soapclient in nusoap.php now i am getting this error : "Parse error: syntax error, unexpected T_EXTENDS in C:\xampp\htdocs\soap\nusoap.php on line 6407" can anyone help me with this problem ?
  7. hi , i am trying to built this site where i can have a full control of the user site , is there anyone here who can help in this case . the user front will have item on it , but through the admin panel i will be able to add or remove those item , i will be waiting for your replies thx
  8. thx guys , but can you be more precise i am new at this ... anyone please help
  9. i have this : [b]INSERT INTO user VALUES ( 'localhost', 'toto', Password( 'password' ) , 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n' );[/b] looks fine to me but when i ran it i got this error : [b]Error SQL query: INSERT INTO user VALUES ( 'localhost', 'toto', Password( 'password' ) , 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n' ); MySQL said:  #1136 - Column count doesn't match value count at row 1 [/b]
  10. thx alot  btherl when i placed the code you give me and ran the script it give me this :     Couldn't select database osCommerce! Access denied for user 'user'@'localhost' to database 'oscommerce' but you this isn't the database i put on the define data connection . dtabase connection look like // define our database connection   define('DB_SERVER', 'localhost');   define('DB_SERVER_USERNAME', 'user');   define('DB_SERVER_PASSWORD', 'user'); ==>>  define('DB_DATABASE', 'commerce_db');   define('USE_PCONNECT', 'false');   define('STORE_SESSIONS', ''); ?> so i went and change it ,  and now i am getting this Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 so help me again please .....
  11. thx alot  btherl when i placed the code you give me and ran the script it give me this : [b]    Couldn't select database osCommerce! Access denied for user 'user'@'localhost' to database 'oscommerce' [/b] but you this isn't the database i put on the define data connection . dtabase connection look like // define our database connection   define('DB_SERVER', 'localhost');   define('DB_SERVER_USERNAME', 'user');   define('DB_SERVER_PASSWORD', 'user'); ==>>  define('DB_DATABASE', 'commerce_db');   define('USE_PCONNECT', 'false');   define('STORE_SESSIONS', ''); ?> so i went and change it ,  and now i am getting this [b]Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404[/b] so help me again please .....
  12. thx for your remar, i have this code in my database script : function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {     global $$link;     if (USE_PCONNECT == 'true') {       $$link = mysql_pconnect($server, $username, $password);     } else {       $$link = mysql_connect($server, $username, $password);     }     if ($$link) mysql_select_db($database);     return $$link;   } hope that helps
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.