Jump to content

Sending user-agent with xml query


jaxdevil

Recommended Posts

I cannot connect to the yahoo shopping API because you have to send user agent data. I tried with the below but thats not working. It keeps telling me invalid user-agent (and this one is specifically on the list of valid agents so its not that). Anyone have any idea?

 

<?php  
$Zombie ="User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) (for IE)";
$Zombie_Striper = addslashes($Zombie);
header("$Zombie_Striper");
  require("pulldata.php");
      
  $filename = "http://shopping.yahooapis.com/shoppingservice/v3/productsearch?appid=q_h1FXbV34EyS_7Dqt8W5dU.vFvpLm4dGuo_iUFiNANhMmBgBlV1atezl4zTW3tEgOc1nGU-&query=GDM";
  
  function Juggler($pulls)
  {
    print "".$pulls["ERROR"]." at ".$pulls["MESSAGE"]."  <br>";
  }
  
  PullData_parse($filename,"Juggler","xml|ERROR/");
print PullData_getErrorMessage();
echo $Zombie_Striper;
?>

Link to comment
https://forums.phpfreaks.com/topic/109579-sending-user-agent-with-xml-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.