Jump to content

saz


Guest OskMedia

Recommended Posts

Guest OskMedia

<?

$url = 'http://testing.shippingapis.com/ShippingAPITest.dll;

$params = "RateV2Request&USERID=965ACE005007&PASSWORD=700ZA01NZ722&Package ID=0&Service=priority&ZipOrganization=43230&ZipDestination=90008&Pounds=3&Ounces=9&Size=Regular";

$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

$ch = curl_init();

curl_setopt($ch, CURLOPT_POST,1);

curl_setopt($ch, CURLOPT_POSTFIELDS,$params);

curl_setopt($ch, CURLOPT_URL,$url);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);

curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // this line makes it work under https

$result=curl_exec ($ch);

curl_close ($ch);

echo("Results: <br>".$result);

?>

where is the parse error

Link to comment
Share on other sites

<?

$url = "http://testing.shippingapis.com/ShippingAPITest.dll";

$params = "RateV2Request&USERID=965ACE005007&PASSWORD=700ZA01NZ722&Package ID=0&Service=priority&ZipOrganization=43230&ZipDestination=90008&Pounds=3&Ounces=9&Size=Regular";

$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

$ch = curl_init();

curl_setopt($ch, CURLOPT_POST,1);

curl_setopt($ch, CURLOPT_POSTFIELDS,$params);

curl_setopt($ch, CURLOPT_URL,$url);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);

curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // this line makes it work under https

$result=curl_exec ($ch);

curl_close ($ch);

echo"Results: <br>.$result";

?>

Maybe.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...