473,898 Members | 3,185 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

issue with Snoopy Class and Fedex

1 New Member
Hi,

I will like to use Snoopy class to check the rate and the price to ship a box with Fedex.

I have begun with this code but I cannot do domething usefull with it yet.

Can someone can assist me?

thanks

Reg


<?PHP
include("../config_inc/Snoopy.class.ph p");

$snoopy = new Snoopy;

session_start() ;

$submit_url = "http://www.fedex.com/ratefinder/home?cc=ca&lang uage=fr";

$temp_dir = "http://www.dealandship .com/public_html/";

if($snoopy->fetch($submit_ url))
{
echo "response code: ".$snoopy->response_code. "<br>\n";

while(list($key ,$val) = each($snoopy->headers))
{
echo $key.": ".$val."<br>\n" ;

if ($key == 4)
{
//echo $key.": ".$val."<br>\n" ;
$thestring = $key.$val;
//echo "thestring=<<". $thestring.">>< br>\n";
$start1 = strpos($thestri ng, "4Set-Cookie: WGRTSESSIONID=" );
$valueID = substr($thestri ng, $start1+strlen( "Set-Cookie: WGRTSESSIONID=" ));
//echo "valueID1=<<".$ valueID.">><br> \n";
$end1 = strpos($valueID ,'; path=/');
$valueID2 = substr($valueID , 0, $end1);
//echo "\nvalueID2=<<" .$valueID2.">>< br>\n";
}
}

echo "<p>\n";

echo "<PRE>".htmlspe cialchars($snoo py->results)."</PRE>\n";

$snoopy->cookies["WGRTSESSIO NID"] = $valueID2;
$_SESSION['orion'] = $snoopy->cookies["WGRTSESSIO NID"];

$submit_url = "http://www.fedex.com/ratefinder/standalone?meth od=getQuickQuot e";

$submit_vars["BuildTimeStamp "] = "01/29/2008 02:46 PM";
$submit_vars["transitTim e"] = "false";
$submit_vars["locId"] = "express";
$submit_vars["originSelected "] = "N";
$submit_vars["destSelect ed"] = "N";
$submit_vars["zipField"] = "";
$submit_vars["currentPag e"] = "rfsshipfromto" ;
$submit_vars["origCountr y"] = "CA";
$submit_vars["origZip"] = "j7x1b3";
$submit_vars["destCountr y"] = "CA";
$submit_vars["destZip"] = "g8b1b3";
$submit_vars["totalNumberOfP ackages"] = "1";
$submit_vars["isPackageIdent ical"] = "NO";
$submit_vars["totalPackageWe ight"] = "66";
$submit_vars["weightUnit "] = "lbs";
$submit_vars["receivedAtCode "] = "1";
$submit_vars["shipDate"] = "01/29/2008";
$submit_vars["shipCalendarDa te"] = "01/29/2008";

//$snoopy->cookies["WGRTSESSIO NID"] = $valueID2;

if($snoopy->fetch($submit_ url))
{
echo "response code: ".$snoopy->response_code. "<br>\n";

while(list($key ,$val) = each($snoopy->headers))
{
echo $key.": ".$val."<br>\n" ;
}

echo "<p>\n";

echo "<PRE>".htmlspe cialchars($snoo py->results)."</PRE>\n";
}
}
?>
Jan 22 '08 #1
0 1267

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4167
by: toby casey | last post by:
Dear all, I am brand new to php, but learning quickly. I need to be able to go to website, obtain the form elements, cycle through the form elements, fetch the links for each page that results from the submission of the form elements, and then fetch all the content of the pages refered in the links (its approx 115,000 links). If i understand it right, Snoopy is the way to go with this. But the problem is, is that we cannot get snoopy...
4
8046
by: futureofphp | last post by:
I need to access a website, Fetch the data, and then logout. Please tell me where I am wrong. I dont think its logging out properly. <? include "Snoopy.class.php"; $snoopy = new Snoopy; //Logging in $submit_url =
3
2420
by: elyob | last post by:
Hi guys, I'm playing with snoopy and am stuck on doing two calls in the same script. The second call revisits a website after getting an existing link based on the results of the first call ... If I hard code the URL, then everything is fine. It's this line that goes wrong "$newsnoopy->fetchtext($newurl);" ... If I put $newsnoopy->fetchtext(http://result/of/first/call/); It's fine. Any help appreciated.... error ... "BAD REQUESTYour...
1
5918
by: someone | last post by:
Does anyone have any experience integrating with FedEx via C# and ASP.NET? I am really frustrated with the lack of help from FedEx. Their example ASP.NET code consists of an empty form and a C# file that uses their objects. Thanks, Mike Schore
10
2030
by: brett | last post by:
I have a file named Snoopy.class.php on my hosted web server in a directory called d:\home\ABC.COM\blog\wp-content\plugins\ A file named dahnielson_mimetex.php references it. However, when dahnielson_mimetex.php tries to reference the Snoopy file, I get these types of errors: Warning: main() : Failed opening './Snoopy.class.php' for inclusion
1
1877
by: f3l | last post by:
need snoopy samples for file POST upload
3
5483
by: injanib via AccessMonster.com | last post by:
Does anyone know what kind of codes Fedex uses for its barcodes and how it is translated into the tracking number. I have a database to I use to log incoming packages. I am able to scan any other barcodes and see the tracking number that is on the package, but when I scan the fedex barcode I get a very long number that does not resemble the actual tracking number. I know that there are double density barcodes that has to be broken down to...
15
3356
by: judge82 | last post by:
I made sure I closed all the bracket, why do i still get the error. on line 360, 424, 425 and 607 Please help /* * ShopCartServletHW3.java *
3
8523
by: supperham | last post by:
hi: can sone one tell me how to use fedex web service in php to calculate shipping fee? i already have fedex account and 4 keys used to test application Test Password:8pVQ6p5cHyQVuJJvrfosaBKqG Developer Test Key: vfNOPSmeA69gJFdf Test Account: 510087682 Test Meter: 1239156
0
9995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10491
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9664
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7198
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5883
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6080
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3315
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.