Implode Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff

    Implode Help

    Hello.

    Quick background as I dont wish to hog anyones time. I am a customer of a
    PHP/SQL programmer. A website that I had the programmer build for me is
    working great, with one exception.

    I have limited programming experience, most of it Pascal/C++ and I haven't
    programmed for many years now even then it was mediocre programming of small
    this and thats.

    Here is the code:

    -----------------------------------------------------------------------

    function check_deliver_p rice($product_i d, $product_quanti ty, $price_level,
    $delivery_city_ address, $delivery_state _address, $delivery_zip,
    $values_price_i nc)

    {

    global $db_prefix, $ups_dropOffCho ice, $ups_container, $ups_billToUPS,
    $ups_currency, $ups_document, $ups_22_destCou ntry, $ups_origCity,
    $ups_15_origPos tal, $ups_14_origCou ntry, $ups_13_product , $ups_10_action;

    $result = 0;

    @$result = mysql_query("se lect * from ".$db_prefix."_ products WHERE
    id='$product_id '");

    @$myrow = mysql_fetch_arr ay($result);

    $value = $myrow['price_'.$price _level.'_level'] + $values_price_i nc;

    if ($value < 100) {$value = 100;}

    $html = implode ('', file
    ('http://wwwapps.ups.com/ctc/htmlTool?accept _UPS_license_ag reement=yes&des tR
    esident=01&49_r esidential=1&10 _action='.$ups_ 10_action.'&13_ product='.$ups_ 1
    3_product.'&14_ origCountry='.$ ups_14_origCoun try.'&origCity= '.$ups_origCity .
    '&15_origPostal ='.$ups_15_orig Postal.'&22_des tCountry='.$ups _22_destCountry .
    '&shipDate='.da te("Y-m-d").'&document= '.$ups_document .'&currency='.$ ups_curr
    ency.'&containe r='.$ups_contai ner.'&billToUPS ='.$ups_billToU PS.'&dropOffCho i
    ce='.$ups_dropO ffChoice.'&20_d estCity='.$deli very_city_addre ss.'&19_destPos t
    al='.$delivery_ zip.'&23_weight ='.$myrow['weight'].'&24_value='.$ value.'&25_l
    ength='.$myrow['size_x'].'&26_width='.$ myrow['size_y'].'&27_height='. $myrow[
    'size_z']));

    if (strstr($html, 'UPS United States'))

    {

    if (strstr($html, 'Provide Package Information'))

    {

    $result = 0;

    }

    elseif (strstr($html, 'Provide Shipment Information'))

    {

    $result = -1;

    }

    elseif (strstr($html, 'Detailed Results'))

    {

    eregi('Shipment Total:</span><img alt="" height="1" src="/img/1.gif"
    width="12">(.+) <img alt="" height="1" src="/img/1.gif" width="6"><span
    class="bold">US D</span></div></td>', $html, $temp);

    $result = $temp[1];

    }

    else

    {

    order_step_1('' , '', '', 'delivery_addre ss_incorrect');

    break;

    }

    }

    if ($result < 0) {order_step_1(' ', '', '', 'delivery_addre ss_incorrect'); }

    if ($myrow['price_'.$price _level.'_shippi ng'] == 1) {$result = 0;}

    $result = $result * $product_quanti ty;

    return $result;

    }


    -----------------------------------------------------------------------

    Basically, from what I can gather, its looking within the webpage result
    from UPS to see if something exists, in essence to give the
    "check_deliver_ price" function a result.

    The use of "implode" in the above code (as in any PHP coding I would
    imagine) is a concatenation function from what I can tell by my research.

    However, it seems that the implode function call as used above is stripping
    the space in between a customers City address (ie. Santa Fe, Los Angelos,
    etc.) creating a situation where "Santa Fe" would be just "Santa" by the
    time it is concatenated. Therefore, only "Santa" gets passed onto UPS by
    use of the URL, which of course UPS returns an error.

    Only customers with a space in the city name have this issue. Now, my
    programmer while capable of resolving this issue, is absent and since she is
    not even in the US, I cannot contact her.

    I am asking the NG for any help in modifying the above code or any
    suggestions as to what I can do. I dont mind keeping backups of her coding,
    then modifying the original.. besides, I dont imagine I could make matters
    much worse, since the "check_deliver_ price" function is called both for
    address verfication upon customer sign up, but, to find out the delivery
    charges of the products that they purchase.

    The key portion of the code (I think) would be:

    $html = implode ('', file
    ('http://wwwapps.ups.com/ctc/htmlTool?accept _UPS_license_ag reement=yes&des tR
    esident=01&49_r esidential=1&10 _action='.$ups_ 10_action.'&13_ product='.$ups_ 1
    3_product.'&14_ origCountry='.$ ups_14_origCoun try.'&origCity= '.$ups_origCity .
    '&15_origPostal ='.$ups_15_orig Postal.'&22_des tCountry='.$ups _22_destCountry .
    '&shipDate='.da te("Y-m-d").'&document= '.$ups_document .'&currency='.$ ups_curr
    ency.'&containe r='.$ups_contai ner.'&billToUPS ='.$ups_billToU PS.'&dropOffCho i
    ce='.$ups_dropO ffChoice.'&20_d estCity='.$deli very_city_addre ss.'&19_destPos t
    al='.$delivery_ zip.'&23_weight ='.$myrow['weight'].'&24_value='.$ value.'&25_l
    ength='.$myrow['size_x'].'&26_width='.$ myrow['size_y'].'&27_height='. $myrow[
    'size_z']));


    What I seek is an overall resolution to the code sniplet, though, I think if
    I can find out from anyone here on how to fill in any spaces that may exist
    in the $delivery_city_ address variable with a %20, that would pretty much
    resolve my issue?

    Any guideance would be greatly appreciated, albeit, a modified code
    resolving my issue would make it much easier and would be the most
    appreciated assistance for this wannabe PHP programmer. :)

    Jeff


  • Geoff Berrow

    #2
    Re: Implode Help

    I noticed that Message-ID: <4r2jc.13825$2e 6.5228@lakeread 01> from Jeff
    contained the following:
    [color=blue]
    >What I seek is an overall resolution to the code sniplet, though, I think if
    >I can find out from anyone here on how to fill in any spaces that may exist
    >in the $delivery_city_ address variable with a %20, that would pretty much
    >resolve my issue?[/color]

    The implode isn't doing it.


    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • Jeff

      #3
      Re: Implode Help

      "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
      news:u6ep80tvde 7l00ksrt284bopd 5lsjf31ko@4ax.c om...[color=blue]
      > I noticed that Message-ID: <4r2jc.13825$2e 6.5228@lakeread 01> from Jeff
      > contained the following:
      >[color=green]
      > >What I seek is an overall resolution to the code sniplet, though, I think[/color][/color]
      if[color=blue][color=green]
      > >I can find out from anyone here on how to fill in any spaces that may[/color][/color]
      exist[color=blue][color=green]
      > >in the $delivery_city_ address variable with a %20, that would pretty much
      > >resolve my issue?[/color]
      >
      > The implode isn't doing it.
      >
      > http://uk.php.net/manual/en/function.urlencode.php
      > --
      > Geoff Berrow (put thecat out to email)
      > It's only Usenet, no one dies.
      > My opinions, not the committee's, mine.
      > Simple RFDs http://www.ckdog.co.uk/rfdmaker/[/color]

      Geoff,

      Thank you very much for your assistance. I am reading and trying to gather
      what I can using the link provided. While I am interested in learning PHP,
      Im affraid that I might not figure things out until some time has passed.

      If you or anyone else wouldn't mind rearranging/modifying the supplied code
      so that it will work in the case where the city (or any other variable for
      that matter I suppose) has a space in it, I would be very much in your debt.

      I'll be watching intently to see if someone who doesnt mind doing this for
      me, makes the changes.

      I try to contribute where I can, unfortunately this is just one of those
      NG's I cannot really contribute anything, but rather this is one that Im
      visiting strictly as the collector vice contributor. :(

      Jeff


      Comment

      • Geoff Berrow

        #4
        Re: Implode Help

        I noticed that Message-ID: <s07jc.13972$2e 6.2485@lakeread 01> from Jeff
        contained the following:
        [color=blue]
        >Geoff,
        >
        >Thank you very much for your assistance. I am reading and trying to gather
        >what I can using the link provided. While I am interested in learning PHP,
        >Im affraid that I might not figure things out until some time has passed.[/color]

        Sorry, from your response I guessed you were more savvy.

        Try this: (you will probably have to get rid of the line wraps to make
        it work)

        $url='http://wwwapps.ups.com/ctc/htmlTool?accept _UPS_license_ag reement=yes&des tR
        esident=01&49_r esidential=1&10 _action='.$ups_ 10_action.'&13_ product='.$ups_ 1
        3_product.'&14_ origCountry='.$ ups_14_origCoun try.'&origCity= '.$ups_origCity .
        '&15_origPostal ='.$ups_15_orig Postal.'&22_des tCountry='.$ups _22_destCountry .
        '&shipDate='.da te("Y-m-d").'&document= '.$ups_document .'&currency='.$ ups_curr
        ency.'&containe r='.$ups_contai ner.'&billToUPS ='.$ups_billToU PS.'&dropOffCho i
        ce='.$ups_dropO ffChoice.'&20_d estCity='.$deli very_city_addre ss.'&19_destPos t
        al='.$delivery_ zip.'&23_weight ='.$myrow['weight'].'&24_value='.$ value.'&25_l
        ength='.$myrow['size_x'].'&26_width='.$ myrow['size_y'].'&27_height='. $myrow[
        'size_z'];

        $html = implode ('', file(urlencode( $url)));

        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        • Virgil Green

          #5
          Re: Implode Help

          "Jeff" <jeffh@ariven.c om> wrote in message
          news:s07jc.1397 2$2e6.2485@lake read01...[color=blue]
          > "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
          > news:u6ep80tvde 7l00ksrt284bopd 5lsjf31ko@4ax.c om...[color=green]
          > > I noticed that Message-ID: <4r2jc.13825$2e 6.5228@lakeread 01> from Jeff
          > > contained the following:
          > >[color=darkred]
          > > >What I seek is an overall resolution to the code sniplet, though, I[/color][/color][/color]
          think[color=blue]
          > if[color=green][color=darkred]
          > > >I can find out from anyone here on how to fill in any spaces that may[/color][/color]
          > exist[color=green][color=darkred]
          > > >in the $delivery_city_ address variable with a %20, that would pretty[/color][/color][/color]
          much[color=blue][color=green][color=darkred]
          > > >resolve my issue?[/color]
          > >
          > > The implode isn't doing it.
          > >
          > > http://uk.php.net/manual/en/function.urlencode.php
          > > --
          > > Geoff Berrow (put thecat out to email)
          > > It's only Usenet, no one dies.
          > > My opinions, not the committee's, mine.
          > > Simple RFDs http://www.ckdog.co.uk/rfdmaker/[/color]
          >
          > Geoff,
          >
          > Thank you very much for your assistance. I am reading and trying to[/color]
          gather[color=blue]
          > what I can using the link provided. While I am interested in learning[/color]
          PHP,[color=blue]
          > Im affraid that I might not figure things out until some time has passed.
          >
          > If you or anyone else wouldn't mind rearranging/modifying the supplied[/color]
          code[color=blue]
          > so that it will work in the case where the city (or any other variable for
          > that matter I suppose) has a space in it, I would be very much in your[/color]
          debt.[color=blue]
          >
          > I'll be watching intently to see if someone who doesnt mind doing this for
          > me, makes the changes.
          >
          > I try to contribute where I can, unfortunately this is just one of those
          > NG's I cannot really contribute anything, but rather this is one that Im
          > visiting strictly as the collector vice contributor. :([/color]

          Untested:

          $html = implode ('', file
          ('http://wwwapps.ups.com/ctc/htmlTool?accept _UPS_license_ag reement=yes&des tR
          esident=01&49_r esidential=1&10 _action='.$ups_ 10_action.'&13_ product='.$ups_ 1
          3_product.'&14_ origCountry='.u rlencode($ups_1 4_origCountry). '&origCity='.ur l
          encode($ups_ori gCity).
          '&15_origPostal ='.$ups_15_orig Postal.'&22_des tCountry='.urle ncode($ups_22_d e
          stCountry).
          '&shipDate='.da te("Y-m-d").'&document= '.$ups_document .'&currency='.$ ups_curr
          ency.'&containe r='.$ups_contai ner.'&billToUPS ='.$ups_billToU PS.'&dropOffCho i
          ce='.$ups_dropO ffChoice.'&20_d estCity='.url_e ncode($delivery _city_address). '
          &19_destPost
          al='.$delivery_ zip.'&23_weight ='.$myrow['weight'].'&24_value='.$ value.'&25_l
          ength='.$myrow['size_x'].'&26_width='.$ myrow['size_y'].'&27_height='. $myrow[
          'size_z']));

          - Virgil


          Comment

          • Jeff

            #6
            Re: Implode Help


            "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
            news:9r9q80h683 6upeaa5pvjhcrfp 6j5dk0thv@4ax.c om...[color=blue]
            > I noticed that Message-ID: <s07jc.13972$2e 6.2485@lakeread 01> from Jeff
            > contained the following:
            >[color=green]
            > >Geoff,
            > >
            > >Thank you very much for your assistance. I am reading and trying to[/color][/color]
            gather[color=blue][color=green]
            > >what I can using the link provided. While I am interested in learning[/color][/color]
            PHP,[color=blue][color=green]
            > >Im affraid that I might not figure things out until some time has passed.[/color]
            >
            > Sorry, from your response I guessed you were more savvy.
            >
            > Try this: (you will probably have to get rid of the line wraps to make
            > it work)
            >
            >[/color]
            $url='http://wwwapps.ups.com/ctc/htmlTool?accept _UPS_license_ag reement=yes&d
            estR[color=blue]
            >[/color]
            esident=01&49_r esidential=1&10 _action='.$ups_ 10_action.'&13_ product='.$ups_ 1[color=blue]
            >[/color]
            3_product.'&14_ origCountry='.$ ups_14_origCoun try.'&origCity= '.$ups_origCity .[color=blue]
            >[/color]
            '&15_origPostal ='.$ups_15_orig Postal.'&22_des tCountry='.$ups _22_destCountry .[color=blue]
            >[/color]
            '&shipDate='.da te("Y-m-d").'&document= '.$ups_document .'&currency='.$ ups_curr[color=blue]
            >[/color]
            ency.'&containe r='.$ups_contai ner.'&billToUPS ='.$ups_billToU PS.'&dropOffCho i[color=blue]
            >[/color]
            ce='.$ups_dropO ffChoice.'&20_d estCity='.$deli very_city_addre ss.'&19_destPos t[color=blue]
            >[/color]
            al='.$delivery_ zip.'&23_weight ='.$myrow['weight'].'&24_value='.$ value.'&25_l[color=blue]
            >[/color]
            ength='.$myrow['size_x'].'&26_width='.$ myrow['size_y'].'&27_height='. $myrow[[color=blue]
            > 'size_z'];
            >
            > $html = implode ('', file(urlencode( $url)));
            >
            > --
            > Geoff Berrow (put thecat out to email)
            > It's only Usenet, no one dies.
            > My opinions, not the committee's, mine.
            > Simple RFDs http://www.ckdog.co.uk/rfdmaker/[/color]

            Geoff,

            On a good day perhaps, just not today. ;) I am the customer in this
            situation, waiting patiently (or trying) for the webmaster to make her
            presence known again. What I do know of PHP, I learned in just two days
            time, or roughly 48 continous hours, so sleep deprevation is winning the
            battle right now.

            I'll give that a shot and will be sure to let you know the outcome, but
            either way, my appreciation is present. I thank you for taking out time of
            your (based upon my assumption of what career field you are in) busy
            schedule.

            Jeff


            Comment

            • Jeff

              #7
              Re: Implode Help


              "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
              news:9r9q80h683 6upeaa5pvjhcrfp 6j5dk0thv@4ax.c om...[color=blue]
              > I noticed that Message-ID: <s07jc.13972$2e 6.2485@lakeread 01> from Jeff
              > contained the following:
              >[color=green]
              > >Geoff,
              > >
              > >Thank you very much for your assistance. I am reading and trying to[/color][/color]
              gather[color=blue][color=green]
              > >what I can using the link provided. While I am interested in learning[/color][/color]
              PHP,[color=blue][color=green]
              > >Im affraid that I might not figure things out until some time has passed.[/color]
              >
              > Sorry, from your response I guessed you were more savvy.
              >
              > Try this: (you will probably have to get rid of the line wraps to make
              > it work)
              >
              >[/color]
              $url='http://wwwapps.ups.com/ctc/htmlTool?accept _UPS_license_ag reement=yes&d
              estR[color=blue]
              >[/color]
              esident=01&49_r esidential=1&10 _action='.$ups_ 10_action.'&13_ product='.$ups_ 1[color=blue]
              >[/color]
              3_product.'&14_ origCountry='.$ ups_14_origCoun try.'&origCity= '.$ups_origCity .[color=blue]
              >[/color]
              '&15_origPostal ='.$ups_15_orig Postal.'&22_des tCountry='.$ups _22_destCountry .[color=blue]
              >[/color]
              '&shipDate='.da te("Y-m-d").'&document= '.$ups_document .'&currency='.$ ups_curr[color=blue]
              >[/color]
              ency.'&containe r='.$ups_contai ner.'&billToUPS ='.$ups_billToU PS.'&dropOffCho i[color=blue]
              >[/color]
              ce='.$ups_dropO ffChoice.'&20_d estCity='.$deli very_city_addre ss.'&19_destPos t[color=blue]
              >[/color]
              al='.$delivery_ zip.'&23_weight ='.$myrow['weight'].'&24_value='.$ value.'&25_l[color=blue]
              >[/color]
              ength='.$myrow['size_x'].'&26_width='.$ myrow['size_y'].'&27_height='. $myrow[[color=blue]
              > 'size_z'];
              >
              > $html = implode ('', file(urlencode( $url)));
              >
              > --
              > Geoff Berrow (put thecat out to email)
              > It's only Usenet, no one dies.
              > My opinions, not the committee's, mine.
              > Simple RFDs http://www.ckdog.co.uk/rfdmaker/[/color]


              Geoff,

              Your code didn't do the trick unfortunately. :( Not sure of why it didnt,
              but, it instead made every address return an error (more less). Does the
              fact that the original code has a @ before the $html have anything to do
              with it? Or, do I have to declare $url somewhere?

              Thank you for the attempt, Im sure it would have worked in the hands of a
              real programmer vice a wannabe :)

              Jeff


              Comment

              • Jeff

                #8
                Re: Implode Help


                "Virgil Green" <vjg@obsydian.c om> wrote in message
                news:%9ajc.2141 $Wl5.1333@newss vr23.news.prodi gy.com...[color=blue]
                > "Jeff" <jeffh@ariven.c om> wrote in message
                > news:s07jc.1397 2$2e6.2485@lake read01...[color=green]
                > > "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
                > > news:u6ep80tvde 7l00ksrt284bopd 5lsjf31ko@4ax.c om...[color=darkred]
                > > > I noticed that Message-ID: <4r2jc.13825$2e 6.5228@lakeread 01> from Jeff
                > > > contained the following:
                > > >
                > > > >What I seek is an overall resolution to the code sniplet, though, I[/color][/color]
                > think[color=green]
                > > if[color=darkred]
                > > > >I can find out from anyone here on how to fill in any spaces that may[/color]
                > > exist[color=darkred]
                > > > >in the $delivery_city_ address variable with a %20, that would pretty[/color][/color]
                > much[color=green][color=darkred]
                > > > >resolve my issue?
                > > >
                > > > The implode isn't doing it.
                > > >
                > > > http://uk.php.net/manual/en/function.urlencode.php
                > > > --
                > > > Geoff Berrow (put thecat out to email)
                > > > It's only Usenet, no one dies.
                > > > My opinions, not the committee's, mine.
                > > > Simple RFDs http://www.ckdog.co.uk/rfdmaker/[/color]
                > >
                > > Geoff,
                > >
                > > Thank you very much for your assistance. I am reading and trying to[/color]
                > gather[color=green]
                > > what I can using the link provided. While I am interested in learning[/color]
                > PHP,[color=green]
                > > Im affraid that I might not figure things out until some time has[/color][/color]
                passed.[color=blue][color=green]
                > >
                > > If you or anyone else wouldn't mind rearranging/modifying the supplied[/color]
                > code[color=green]
                > > so that it will work in the case where the city (or any other variable[/color][/color]
                for[color=blue][color=green]
                > > that matter I suppose) has a space in it, I would be very much in your[/color]
                > debt.[color=green]
                > >
                > > I'll be watching intently to see if someone who doesnt mind doing this[/color][/color]
                for[color=blue][color=green]
                > > me, makes the changes.
                > >
                > > I try to contribute where I can, unfortunately this is just one of those
                > > NG's I cannot really contribute anything, but rather this is one that Im
                > > visiting strictly as the collector vice contributor. :([/color]
                >
                > Untested:
                >
                > $html = implode ('', file
                >[/color]
                ('http://wwwapps.ups.com/ctc/htmlTool?accept _UPS_license_ag reement=yes&des tR[color=blue]
                >[/color]
                esident=01&49_r esidential=1&10 _action='.$ups_ 10_action.'&13_ product='.$ups_ 1[color=blue]
                >[/color]
                3_product.'&14_ origCountry='.u rlencode($ups_1 4_origCountry). '&origCity='.ur l[color=blue]
                > encode($ups_ori gCity).
                >[/color]
                '&15_origPostal ='.$ups_15_orig Postal.'&22_des tCountry='.urle ncode($ups_22_d e[color=blue]
                > stCountry).
                >[/color]
                '&shipDate='.da te("Y-m-d").'&document= '.$ups_document .'&currency='.$ ups_curr[color=blue]
                >[/color]
                ency.'&containe r='.$ups_contai ner.'&billToUPS ='.$ups_billToU PS.'&dropOffCho i[color=blue]
                >[/color]
                ce='.$ups_dropO ffChoice.'&20_d estCity='.url_e ncode($delivery _city_address). '[color=blue]
                > &19_destPost
                >[/color]
                al='.$delivery_ zip.'&23_weight ='.$myrow['weight'].'&24_value='.$ value.'&25_l[color=blue]
                >[/color]
                ength='.$myrow['size_x'].'&26_width='.$ myrow['size_y'].'&27_height='. $myrow[[color=blue]
                > 'size_z']));
                >
                > - Virgil
                >
                >[/color]

                Virgil,

                This did the trick, thank you very much. A slight error where you have:

                &20_destCity='. url_encode.....
                vice
                &20_destCity='. urlencode...

                but, that was easy enough to pin point... it returned a completely blank
                page with it as url_encode, which now Im intrigued as to why it does that
                <shrug>

                Thank you very much everyone. I know I wasn't the easiest to work with (as
                ignorant of PHP as I am) so I appreciate the patience.

                Jeff

                PS - Nope, Im not gone forever. I plan to stick around to learn this PHP
                jazz they call programming. ;)


                Comment

                • Virgil Green

                  #9
                  Re: Implode Help

                  "Jeff" <jeffh@ariven.c om> wrote in message news:4ybjc.2$f_ 5.0@lakeread01. ..[color=blue]
                  >
                  > "Virgil Green" <vjg@obsydian.c om> wrote in message
                  > news:%9ajc.2141 $Wl5.1333@newss vr23.news.prodi gy.com...[color=green]
                  > > "Jeff" <jeffh@ariven.c om> wrote in message
                  > > news:s07jc.1397 2$2e6.2485@lake read01...
                  > >
                  > > Untested:
                  > >
                  > > $html = implode ('', file
                  > >[/color]
                  >[/color]
                  ('http://wwwapps.ups.com/ctc/htmlTool?accept _UPS_license_ag reement=yes&des tR[color=blue][color=green]
                  > >[/color]
                  >[/color]
                  esident=01&49_r esidential=1&10 _action='.$ups_ 10_action.'&13_ product='.$ups_ 1[color=blue][color=green]
                  > >[/color]
                  >[/color]
                  3_product.'&14_ origCountry='.u rlencode($ups_1 4_origCountry). '&origCity='.ur l[color=blue][color=green]
                  > > encode($ups_ori gCity).
                  > >[/color]
                  >[/color]
                  '&15_origPostal ='.$ups_15_orig Postal.'&22_des tCountry='.urle ncode($ups_22_d e[color=blue][color=green]
                  > > stCountry).
                  > >[/color]
                  >[/color]
                  '&shipDate='.da te("Y-m-d").'&document= '.$ups_document .'&currency='.$ ups_curr[color=blue][color=green]
                  > >[/color]
                  >[/color]
                  ency.'&containe r='.$ups_contai ner.'&billToUPS ='.$ups_billToU PS.'&dropOffCho i[color=blue][color=green]
                  > >[/color]
                  >[/color]
                  ce='.$ups_dropO ffChoice.'&20_d estCity='.url_e ncode($delivery _city_address). '[color=blue][color=green]
                  > > &19_destPost
                  > >[/color]
                  >[/color]
                  al='.$delivery_ zip.'&23_weight ='.$myrow['weight'].'&24_value='.$ value.'&25_l[color=blue][color=green]
                  > >[/color]
                  >[/color]
                  ength='.$myrow['size_x'].'&26_width='.$ myrow['size_y'].'&27_height='. $myrow[[color=blue][color=green]
                  > > 'size_z']));
                  > >
                  > > - Virgil
                  > >
                  > >[/color]
                  >
                  > Virgil,
                  >
                  > This did the trick, thank you very much. A slight error where you have:
                  >
                  > &20_destCity='. url_encode.....
                  > vice
                  > &20_destCity='. urlencode...
                  >
                  > but, that was easy enough to pin point... it returned a completely blank
                  > page with it as url_encode, which now Im intrigued as to why it does that
                  > <shrug>
                  >
                  > Thank you very much everyone. I know I wasn't the easiest to work with[/color]
                  (as[color=blue]
                  > ignorant of PHP as I am) so I appreciate the patience.[/color]

                  You're welcome... and if you think you were "troublesome".. . you haven't
                  seen troublesome. Your question was researched, you showed your code, you
                  expained what you thought was wrong, and you told us what you expected. That
                  was refreshing.

                  Glad to have helped.

                  - Virgil


                  Comment

                  • Geoff Berrow

                    #10
                    Re: Implode Help

                    I noticed that Message-ID:
                    <AWbjc.2164$y46 .1669@newssvr23 .news.prodigy.c om> from Virgil Green
                    contained the following:
                    [color=blue]
                    >You're welcome... and if you think you were "troublesome".. . you haven't
                    >seen troublesome. Your question was researched, you showed your code, you
                    >expained what you thought was wrong, and you told us what you expected. That
                    >was refreshing.[/color]

                    I'd agree with that and though I'm pleased I was on the right lines I'm
                    sorry my effort did not work.

                    Was I wrong to suggest doing it the way I did?
                    --
                    Geoff Berrow (put thecat out to email)
                    It's only Usenet, no one dies.
                    My opinions, not the committee's, mine.
                    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                    Comment

                    • Virgil Green

                      #11
                      Re: Implode Help

                      "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
                      news:mfjq805t1p 0163844uo7ajl5g o32osqbbp@4ax.c om...[color=blue]
                      > I noticed that Message-ID:
                      > <AWbjc.2164$y46 .1669@newssvr23 .news.prodigy.c om> from Virgil Green
                      > contained the following:
                      >[color=green]
                      > >You're welcome... and if you think you were "troublesome".. . you haven't
                      > >seen troublesome. Your question was researched, you showed your code, you
                      > >expained what you thought was wrong, and you told us what you expected.[/color][/color]
                      That[color=blue][color=green]
                      > >was refreshing.[/color]
                      >
                      > I'd agree with that and though I'm pleased I was on the right lines I'm
                      > sorry my effort did not work.
                      >
                      > Was I wrong to suggest doing it the way I did?[/color]

                      Only because you were doing the entire URL rather than just the query
                      string. Your method caused the : and the // of the http:// string to be
                      replaced as well along with the /s (if there were any) separating host from
                      directory name information.. and the ? separating the query string from the
                      rest of the URL. Only the query string (and even then, only parts of it)
                      needed to be encoded.

                      However, I picked up the need for the urlencode() function from your post.
                      Before I saw that, I had decided to skip over the post because I didn't have
                      time at the moment to decipher it.

                      - Virgil.


                      Comment

                      • Geoff Berrow

                        #12
                        Re: Implode Help

                        I noticed that Message-ID:
                        <dggjc.2238$3u. 480@newssvr23.n ews.prodigy.com > from Virgil Green
                        contained the following:
                        [color=blue][color=green]
                        >>
                        >> Was I wrong to suggest doing it the way I did?[/color]
                        >
                        >Only because you were doing the entire URL rather than just the query
                        >string. Your method caused the : and the // of the http:// string to be
                        >replaced as well along with the /s (if there were any) separating host from
                        >directory name information.. and the ? separating the query string from the
                        >rest of the URL. Only the query string (and even then, only parts of it)
                        >needed to be encoded.[/color]

                        Hmmm, I thought it would still work. Ah well, you learn something every
                        day.[color=blue]
                        >
                        >However, I picked up the need for the urlencode() function from your post.
                        >Before I saw that, I had decided to skip over the post because I didn't have
                        >time at the moment to decipher it.[/color]

                        Teamwork <g>
                        --
                        Geoff Berrow (put thecat out to email)
                        It's only Usenet, no one dies.
                        My opinions, not the committee's, mine.
                        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                        Comment

                        Working...