Search the web
Sign In
New User? Sign Up
ydn-php · Yahoo! PHP Developer Group (CLOSED)
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
noob help   Message List  
Reply | Forward Message #242 of 335 |
Hi all,

im trying to write a site that uses a yahoo api to access product
data...and as a first pass im just trying to create a test page that
pulls data based on a upc I have on a box on my desk...anyways, the
code i use is simply:

$yahooID="WQEKr67V34FYAoAdbaLr10PRTxYcHtWoOgv7yqPvJeTp5DEIh0A.cKuI3O_bi5fRnA4GSB\
nrd0g-";
$upc="606449028423";
$url="http://shopping.yahooapis.com/ShoppingService/v2/CatalogListing?idtype=upc\
&idvalue=$upc&output=php&appid=$yahooID
";
echo "$url<BR>";
$rawdata = file_get_contents($url);
$data = unserialize($rawdata);
print_r($data);

The problem is it doesnt work! All it returns is this:
http://shopping.yahooapis.com/ShoppingService/v2/CatalogListing?idtype=upc&idval\
ue=606449028423&output=php&appid=WQEKr67V34FYAoAdbaLr10PRTxYcHtWoOgv7yqPvJeTp5DE\
Ih0A.cKuI3O_bi5fRnA4GSBnrd0g-

Array ( [__notags] => The following errors were detected: [Message] =>
Array ( [0] => User-agent not valid ) )

Yet if I just copy that url into my browser window and go to it, it
returns the results correctly and just fine...what am I doing wrong
here??? (Ive copied and pasted the appid many times from the my yahoo
page, and had new ones created, and disabled them and reenabled them,
nothing works).




Tue Mar 18, 2008 11:30 pm

brentan.alex...
Offline Offline
Send Email Send Email

Forward
Message #242 of 335 |
Expand Messages Author Sort by Date

Hi all, im trying to write a site that uses a yahoo api to access product data...and as a first pass im just trying to create a test page that pulls data based...
brentan.alexander
brentan.alex...
Offline Send Email
Mar 20, 2008
5:28 pm

First off, I'd REALLY REALLY urge you not to use functions like open or file_get_contents in PHP. They're security risks. Instead, you should use things like...
JR Conlin
jrconlin
Offline Send Email
Mar 20, 2008
6:14 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help