[ic] Consignment Tracking - A Gift & A Problem

Adrian P Wilkinson junk at puffin.org
Wed Dec 15 04:36:05 EST 2004

Dear All,

For those of you that have noticed that consignment tracking disappeared 
from check_orders.html with the 'standard' demo, you might want to consider 
the following simple modifcation around line 326:

          [display table=transactions type=display col=status 
          <br>[&nbsp;<a href="/go/parceltrack.cgi?[sql-param 

I'm yet to put any kind of check to see if there is a tracking_number 
present in the transactions table as that's something to do a little later.

The problem is with the parcel tracking script I've written.  The tracking 
number entered is in the form of AA-11111111 where 'AA' is a code to 
represent a service offered by a particular courier company.  "BP" is 
Business Post Next Day and "SD" is Royal Mail Special Delivery, for example.

What is happening is that when it tries to work out who the parcel has been 
sent with, it doesn't always pick the correct one:

if ( $CARRIERCODE eq "BP" )
        $CARRIERNAME = "Business Post";
        $CARRIERSERV = "Next Day";
        $CARRIERURL = "http://www.businesspost.com/";
        $TRACKURL = 
        goto pagebody;

if ( $CARRIERCODE eq "SD" )
        $CARRIERNAME = "Royal Mail";
        $CARRIERSERV = "Special Delivery";
        $CARRIERURL = "www.royalmail.com";
        goto pagebody;

if ( $CARRIERCODE eq "CL" )
        $CARRIERNAME = "Initial CityLink";
        $CARRIERSERV = "Next Day";
        $CARRIERURL = "www.city-link.co.uk";
        $TRACKURL = 
        goto pagebody;

I've tried matching using "eq" and "==" but it seems to just decide to pick 
one at random.  Any suggestions how I can get it to match $CARRIERCODE 
(created by taking the first two characters of the string passed) against 
the above criteria correctly every time?

Regards, Ade. 

More information about the interchange-users mailing list