PHP Mail

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

    PHP Mail

    Hi,

    I have below code:

    <html>
    <head>
    <title>Contacti ng Worldpay, Please wait.......</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body text="#CCCCCC">
    <?php

    $basketvalues = array_values($H TTP_POST_VARS);
    $basketkeys = array_keys($HTT P_POST_VARS);
    $totalitems=((c ount($basketkey s))-17)/11;
    $instId = $basketvalues[array_search("i nstId", $basketkeys, true)];
    $cartId = $basketvalues[array_search("c artId", $basketkeys, true)];
    $cost = $basketvalues[array_search("c ost", $basketkeys, true)];
    $currency = $basketvalues[array_search("c urrency", $basketkeys, true)];
    $desc = $basketvalues[array_search("d esc", $basketkeys, true)];
    $country = $basketvalues[array_search("c ountry", $basketkeys, true)];
    $name = $basketvalues[array_search("n ame", $basketkeys, true)];
    $address = $basketvalues[array_search("a ddress", $basketkeys, true)];
    $postcode = $basketvalues[array_search("p ostcode", $basketkeys, true)];
    $tel = $basketvalues[array_search("t el", $basketkeys, true)];
    $email = $basketvalues[array_search("e mail", $basketkeys, true)];
    ?>
    <form name='worldform 1' method='post'
    action='https://select.worldpay .com/wcc/transaction'>
    <input type="hidden" name="instId" value="<?php echo $instId ?>">
    <input type="hidden" name="cartId" value="1234">
    <input type="hidden" name="cost" value="<?php echo $cost ?>">
    <input type="hidden" name="currency" value="<?php echo $currency ?>">
    <input type="hidden" name="desc" value="<?php echo $desc ?>">
    <input type="hidden" name="country" value="<?php echo $country ?>">
    <input type="hidden" name="name" value="<?php echo $name ?>">
    <input type="hidden" name="address" value="<?php echo $address ?>">
    <input type="hidden" name="postcode" value="<?php echo $postcode ?>">
    <input type="hidden" name="county" value="<?php echo $county ?>">
    <input type="hidden" name="tel" value="<?php echo $phone ?>">
    <input type="hidden" name="email" value="<?php echo $email ?>">
    <input type="hidden" name="testMode" value="101">
    </form>

    <font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <script language="Javas cript">
    document.worldf orm1.submit();
    </script>
    <br><br>Contact ing WorlPay Secure Payment Server<br>
    Please Wait ....</font>


    <?php
    echo "Total Items: $totalitems <br>";
    $toadd="mail@ma il.com";
    $subject="Subje ct";
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: mail@mail.com\nReply-To: mail@mail.com\n";
    $message ="<html>

    <head>
    <title>Carpet Runners</title>
    </head>
    <body>

    Cart ID $cartId<br>
    Cost $cost<br>
    Currency $currency<br>
    <br>
    Invoice Name $name<br>
    Invoice Address $address<br>
    Invoice Postcode $postcode<br>
    Invoice Email $email<br>
    <br>
    Delivery Name $delvName<br>
    Delivery Address $delvAddress<br >
    Delivery Postcode $delvPostcode<b r>
    Delivery E-Mail $delvEmail<br>
    Delivery Telephone $delvPhone<br>
    <br><br>
    <table>";

    $message .= "<tr><td>To tal</td></tr>\n";
    $message .= "<tr>";
    for ($n=0;$n<$total items;$n++){
    $ss = $n+1;
    $sss = "total$ss";
    $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
    true)]."</td>";
    $message .= "</tr>";
    $message .= "\n";
    }
    $message .= "</table></body></html>";
    echo $message;
    ?>

    <?php
    if (mail($toadd, $subject, $message, $headers)){
    echo "Thankyou ".$dealname."<b r>";
    echo "Mail has been sent to Stairrods USA with your order<br>";
    }
    else
    {
    echo "Mail send failure.<br>";
    }
    ?>
    </body>
    </html>

    I get the e-mails, but the total isn't being shown. I believe:

    $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
    true)]."</td>";

    is the code that displays the total, but it doesn't show up in the e-mail.
    The top part works i.e. everything up to the one line of code above, then
    nothing is displayed.

    Please help, and many thanks ina dvance.

    pee2pee

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



  • s a n j a y

    #2
    Re: PHP Mail

    I honestly think you should just post the relevent part of your code. Sorry
    I couldn't be of much help.

    sanjay


    "pee2pee" <not_telling@yo u.com> wrote in message
    news:3f99355c$0 $247$cc9e4d1f@n ews.dial.pipex. com...
    | Hi,
    |
    | I have below code:
    |
    | <html>
    | <head>
    | <title>Contacti ng Worldpay, Please wait.......</title>
    | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    | </head>
    | <body text="#CCCCCC">
    | <?php
    |
    | $basketvalues = array_values($H TTP_POST_VARS);
    | $basketkeys = array_keys($HTT P_POST_VARS);
    | $totalitems=((c ount($basketkey s))-17)/11;
    | $instId = $basketvalues[array_search("i nstId", $basketkeys, true)];
    | $cartId = $basketvalues[array_search("c artId", $basketkeys, true)];
    | $cost = $basketvalues[array_search("c ost", $basketkeys, true)];
    | $currency = $basketvalues[array_search("c urrency", $basketkeys, true)];
    | $desc = $basketvalues[array_search("d esc", $basketkeys, true)];
    | $country = $basketvalues[array_search("c ountry", $basketkeys, true)];
    | $name = $basketvalues[array_search("n ame", $basketkeys, true)];
    | $address = $basketvalues[array_search("a ddress", $basketkeys, true)];
    | $postcode = $basketvalues[array_search("p ostcode", $basketkeys, true)];
    | $tel = $basketvalues[array_search("t el", $basketkeys, true)];
    | $email = $basketvalues[array_search("e mail", $basketkeys, true)];
    | ?>
    | <form name='worldform 1' method='post'
    | action='https://select.worldpay .com/wcc/transaction'>
    | <input type="hidden" name="instId" value="<?php echo $instId ?>">
    | <input type="hidden" name="cartId" value="1234">
    | <input type="hidden" name="cost" value="<?php echo $cost ?>">
    | <input type="hidden" name="currency" value="<?php echo $currency ?>">
    | <input type="hidden" name="desc" value="<?php echo $desc ?>">
    | <input type="hidden" name="country" value="<?php echo $country ?>">
    | <input type="hidden" name="name" value="<?php echo $name ?>">
    | <input type="hidden" name="address" value="<?php echo $address ?>">
    | <input type="hidden" name="postcode" value="<?php echo $postcode ?>">
    | <input type="hidden" name="county" value="<?php echo $county ?>">
    | <input type="hidden" name="tel" value="<?php echo $phone ?>">
    | <input type="hidden" name="email" value="<?php echo $email ?>">
    | <input type="hidden" name="testMode" value="101">
    | </form>
    |
    | <font color="#000000" size="2" face="Verdana, Arial, Helvetica,
    sans-serif">
    | <script language="Javas cript">
    | document.worldf orm1.submit();
    | </script>
    | <br><br>Contact ing WorlPay Secure Payment Server<br>
    | Please Wait ....</font>
    |
    |
    | <?php
    | echo "Total Items: $totalitems <br>";
    | $toadd="mail@ma il.com";
    | $subject="Subje ct";
    | $headers = "MIME-Version: 1.0\r\n";
    | $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    | $headers .= "From: mail@mail.com\nReply-To: mail@mail.com\n";
    | $message ="<html>
    |
    | <head>
    | <title>Carpet Runners</title>
    | </head>
    | <body>
    |
    | Cart ID $cartId<br>
    | Cost $cost<br>
    | Currency $currency<br>
    | <br>
    | Invoice Name $name<br>
    | Invoice Address $address<br>
    | Invoice Postcode $postcode<br>
    | Invoice Email $email<br>
    | <br>
    | Delivery Name $delvName<br>
    | Delivery Address $delvAddress<br >
    | Delivery Postcode $delvPostcode<b r>
    | Delivery E-Mail $delvEmail<br>
    | Delivery Telephone $delvPhone<br>
    | <br><br>
    | <table>";
    |
    | $message .= "<tr><td>To tal</td></tr>\n";
    | $message .= "<tr>";
    | for ($n=0;$n<$total items;$n++){
    | $ss = $n+1;
    | $sss = "total$ss";
    | $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
    | true)]."</td>";
    | $message .= "</tr>";
    | $message .= "\n";
    | }
    | $message .= "</table></body></html>";
    | echo $message;
    | ?>
    |
    | <?php
    | if (mail($toadd, $subject, $message, $headers)){
    | echo "Thankyou ".$dealname."<b r>";
    | echo "Mail has been sent to Stairrods USA with your order<br>";
    | }
    | else
    | {
    | echo "Mail send failure.<br>";
    | }
    | ?>
    | </body>
    | </html>
    |
    | I get the e-mails, but the total isn't being shown. I believe:
    |
    | $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
    | true)]."</td>";
    |
    | is the code that displays the total, but it doesn't show up in the e-mail.
    | The top part works i.e. everything up to the one line of code above, then
    | nothing is displayed.
    |
    | Please help, and many thanks ina dvance.
    |
    | pee2pee
    |
    | -----------------------------
    | http://janusz.monkey-it.co.uk
    |
    |


    Comment

    • pee2pee

      #3
      Re: PHP Mail

      No worries,

      Just thought if I post the page, it would give the code some context,
      however here is the main bulk of the code that I am having problems with:

      | for ($n=0;$n<$total items;$n++){
      | $ss = $n+1;
      | $sss = "total$ss";
      | $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
      | true)]."</td>";
      | $message .= "</tr>";
      | $message .= "\n";
      | }

      I want it to show the total sum, but nothing is displayed at all, all I get
      is the column heading of total, and nothing else further down the page.

      pee2pee

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



      Comment

      • Jeffrey Silverman

        #4
        Re: PHP Mail

        On Fri, 24 Oct 2003 17:03:56 +0100, pee2pee wrote:
        [color=blue]
        > No worries,
        >
        > Just thought if I post the page, it would give the code some context,
        > however here is the main bulk of the code that I am having problems with:
        >
        > | for ($n=0;$n<$total items;$n++){
        > | $ss = $n+1;
        > | $sss = "total$ss";
        > | $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
        > | true)]."</td>";
        > | $message .= "</tr>";
        > | $message .= "\n";
        > | }
        > | }
        > I want it to show the total sum, but nothing is displayed at all, all I
        > get is the column heading of total, and nothing else further down the
        > page.
        >
        > pee2pee
        >
        > -----------------------------
        > http://janusz.monkey-it.co.uk[/color]


        What's up with how you determine "$totalitem s"?

        relevant lines:
        $basketkeys = array_keys($HTT P_POST_VARS);
        $totalitems=((c ount($basketkey s))-17)/11;

        -17? /11 ?? How do you know that you are going to always get a number
        that is divisble by 11? looks very odd to me.

        What are you trying to do there?

        my guess is that the value of $totalitems is getting munged and since
        $totalitems is being used in the for() loop you are not getting the output
        you are expecting.

        later...
        --
        Jeffrey D. Silverman | jeffrey AT jhu DOT edu
        Johns Hopkins University | Baltimore, MD
        Website | http://www.wse.jhu.edu/newtnotes/

        Comment

        • pee2pee

          #5
          Re: PHP Mail

          Ja,

          I don't know why, I just picke up the script and this is where I'm stuck
          also! Using static figures though, it still don't work

          pee2pee

          --

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

          "Jeffrey Silverman" <jeffrey@jhu.ed u> wrote in message
          news:pan.2003.1 0.24.16.20.39.9 97921@jhu.edu.. .[color=blue]
          > On Fri, 24 Oct 2003 17:03:56 +0100, pee2pee wrote:
          >[color=green]
          > > No worries,
          > >
          > > Just thought if I post the page, it would give the code some context,
          > > however here is the main bulk of the code that I am having problems[/color][/color]
          with:[color=blue][color=green]
          > >
          > > | for ($n=0;$n<$total items;$n++){
          > > | $ss = $n+1;
          > > | $sss = "total$ss";
          > > | $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
          > > | true)]."</td>";
          > > | $message .= "</tr>";
          > > | $message .= "\n";
          > > | }
          > > | }
          > > I want it to show the total sum, but nothing is displayed at all, all I
          > > get is the column heading of total, and nothing else further down the
          > > page.
          > >
          > > pee2pee
          > >
          > > -----------------------------
          > > http://janusz.monkey-it.co.uk[/color]
          >
          >
          > What's up with how you determine "$totalitem s"?
          >
          > relevant lines:
          > $basketkeys = array_keys($HTT P_POST_VARS);
          > $totalitems=((c ount($basketkey s))-17)/11;
          >
          > -17? /11 ?? How do you know that you are going to always get a number
          > that is divisble by 11? looks very odd to me.
          >
          > What are you trying to do there?
          >
          > my guess is that the value of $totalitems is getting munged and since
          > $totalitems is being used in the for() loop you are not getting the output
          > you are expecting.
          >
          > later...
          > --
          > Jeffrey D. Silverman | jeffrey AT jhu DOT edu
          > Johns Hopkins University | Baltimore, MD
          > Website | http://www.wse.jhu.edu/newtnotes/
          >[/color]


          Comment

          • Jeffrey Silverman

            #6
            Re: PHP Mail

            On Fri, 24 Oct 2003 20:23:53 +0100, pee2pee wrote:
            [color=blue]
            > Ja,
            >
            > I don't know why, I just picke up the script and this is where I'm stuck
            > also! Using static figures though, it still don't work
            >
            > pee2pee[/color]

            I'm sorry but I don't think I have a solution for you.
            --
            Jeffrey | Silverman
            jeffrey-AT-jhu-DOT-edu |
            Johns Hopkins University | Baltimore, MD

            (Spam Prevention: replace -AT- and -DOT- with @ and . respectively)

            Comment

            • Steve

              #7
              Re: PHP Mail

              Ok let me first start off by saying, whoever wrote that thing should
              be drug out in the street and shot.
              BTW I'm not going to fix your script, you are
              But I'm going to write in the fixes in such a way as that you learn
              learn a little PHP,
              rather than just copy/paste it, but the fixes to apply will hopefully
              be obvious so bear with me
              Since you appear to have no idea how this script functions, why don't
              we start from scratch and see what happens.
              The script starts out with HTML, I'm not a big fan of starting my
              scripts the way that this thing is, so lets begin at the beginning.

              <?php
              /*<?php begins a PHP script, it's a matter of prefference but I try to
              only use one call to the preprocessor.
              Once my data is ready for output, I try to do it all in one fell swoop
              like this
              echo <<< EOF
              This is my data and I'm proud of it, I can use $Strings and other
              $Variables as well as all HTML
              About the only thing I can't do inside of this sort of echo is a
              function call
              EOF;

              Now we need to retrieve all of our variables

              $basketvalues = array_values($H TTP_POST_VARS);
              $basketkeys = array_keys($HTT P_POST_VARS);

              //Are wrong the method is deprecated and no longer used

              The proper method is
              $x=0;
              while(list($key ,$value)=explod e($_POST)){
              $basketvalues[$x] = $value;
              $basketkeys[$x] = $key;

              /*Also looking forward we can see we will be posting this information
              to a form, rather than duplicate our efforts, lets make a part of that
              form right now.*/
              $form .="<input type = \"hidden\" name=\"$key\" value=\"$value\ ">";
              $x++; //Finally increment x
              }

              /*Alot of this was a little bit pointless by the way because the
              simplest thing would be to just use extract, since we really don't
              need to create the arrays basketvalues and basketkeys, so to prove a
              point I will put in the following line, even though I usually consider
              it sloppy, but for berevity we will use it anyways*/

              extract($_POST) ;

              //And unless you are offering items without an associated cost
              $totalitems = count($cost);

              /* Those two lines replace ALL of the code contained in this comment,
              as well as negating all the other calls to BasketValues and BasketKeys

              $totalitems=((c ount($basketkey s))-17)/11;
              $instId = $basketvalues[array_search("i nstId", $basketkeys, true)];
              $cartId = $basketvalues[array_search("c artId", $basketkeys, true)];
              $cost = $basketvalues[array_search("c ost", $basketkeys, true)];
              $currency = $basketvalues[array_search("c urrency", $basketkeys,
              true)];
              $desc = $basketvalues[array_search("d esc", $basketkeys, true)];
              $country = $basketvalues[array_search("c ountry", $basketkeys, true)];
              $name = $basketvalues[array_search("n ame", $basketkeys, true)];
              $address = $basketvalues[array_search("a ddress", $basketkeys, true)];
              $postcode = $basketvalues[array_search("p ostcode", $basketkeys,
              true)];
              $tel = $basketvalues[array_search("t el", $basketkeys, true)];
              $email = $basketvalues[array_search("e mail", $basketkeys, true)];

              And so now we have all of our variables*/


              /*Next we want to do all of our math operations BEFORE we move on to
              form creation*/
              for ($n=0;$n<$total items;$n++){
              $ss = $n+1;
              $sss = "total$ss";
              $message .= "<td>".$basketv alues[array_search($s ss $basketkeys,tru e)]."</td>";
              $message .= "</tr>";
              $message .= "\n";
              }

              /*The above code should gives me nausea looking at it, so what do we
              do instead?
              Well the first question is to ask what it's doing in the first place.
              It's a simple for loop, $n is a dummy counter and as long as it is
              less than $totalitems,
              it assigns $ss to the value of $n+1
              then it creates a new string called $sss (gotta love these descriptive
              variables)
              next it appends $basketvalues[array_search($s ss, $basketkeys)]
              to $message in a new HTML column.
              Figuring this out will make you a basket case, but lets break it down
              even further.

              According to PHP.net
              array_search: Searches the array for a given value and returns the
              corresponding key if successful.
              PROTOTYPE: mixed array_search ( mixed needle, array haystack [, bool
              strict])
              Simplified: Searches haystack for needle and returns the key if it is
              found in the array, FALSE otherwise.

              So we are searching basketkeys for a key named total$ss with $ss being
              the next number we would be counting.

              This means on the first iteration of the loop we will be looking in
              basketkeys for a key named total1
              on the next, we will be looking for total2 etc and so forth.

              Since these values are sent to us via post method,
              this points to a serious flaw either in this script or the one calling
              it.
              This can't be right, it seems so counter-intuitive.
              But, considering the rest of this script lets go forth with the
              assumption the author was correct
              and the calling script really IS passing us values with names like
              total1, total2 etc.
              This is what you should do instead
              */

              for ($counter=0;$co unter<=$totalit ems;$counter++) {
              /*I am going to make a leap of faith here and assume that $cost is
              what the author was orginally intending to return
              also there is appearantly no grand total in the code but I will put
              one here anyways just so we know*/
              $message .="<tr><td>$cos t[$counter]</td></tr>";
              $Total +=$cost[$counter];
              }
              $message .="<tr><td>Gran d Total :$Total</td></tr>";

              Alright that should be enough of a rewrite to get you started. And
              your fix is contained in here
              I know you probably thought that I was going to rewrite the whole
              script
              But I'm getting tired, now and I can't guarantee bug free code. Also
              the remaining mods to the script, are mostly a
              matter of programmers choice.

              However here is what I have found is the best way to write, analyze,
              rewrite code to keep it easily maintained and understood.

              First off decide what you WANT to do. (Obviously, but sometimes it is
              forgotten)
              Secondly make sure that you set up your data prior to using it.
              Thirdly make sure your data is what you expect.
              Finally Use your data to the best effect possible.
              All of this usually follows the pattern.

              Open Script,
              Cull data from available sources
              Analyze data (Modify,Add, Subtract, Mulitply to / from data)
              Utilize Data (This is where you output to screen, mail,
              database,whatev er)
              Close Script

              Also make sure you follow best practices when coding, by making sure
              your code is well commented and as simple as you can make it.
              (not as comment much as my examples but you see the picture)
              and also that ALL of your variables are descriptive, 4 letters or more
              is my preffered choice.

              Well Good Night folks I'm going to bed, please feel free to point out
              any mistakes I may have made
              With the exception of course of the open and close comments, I'm well
              aware my commenting is overkill and would also trigger parse errors


              "pee2pee" <not_telling@yo u.com> wrote in message news:<3f99355c$ 0$247$cc9e4d1f@ news.dial.pipex .com>...[color=blue]
              > Hi,
              >
              > I have below code:
              >
              > <html>
              > <head>
              > <title>Contacti ng Worldpay, Please wait.......</title>
              > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
              > </head>
              > <body text="#CCCCCC">
              > <?php
              >
              > $basketvalues = array_values($H TTP_POST_VARS);
              > $basketkeys = array_keys($HTT P_POST_VARS);
              > $totalitems=((c ount($basketkey s))-17)/11;
              > $instId = $basketvalues[array_search("i nstId", $basketkeys, true)];
              > $cartId = $basketvalues[array_search("c artId", $basketkeys, true)];
              > $cost = $basketvalues[array_search("c ost", $basketkeys, true)];
              > $currency = $basketvalues[array_search("c urrency", $basketkeys, true)];
              > $desc = $basketvalues[array_search("d esc", $basketkeys, true)];
              > $country = $basketvalues[array_search("c ountry", $basketkeys, true)];
              > $name = $basketvalues[array_search("n ame", $basketkeys, true)];
              > $address = $basketvalues[array_search("a ddress", $basketkeys, true)];
              > $postcode = $basketvalues[array_search("p ostcode", $basketkeys, true)];
              > $tel = $basketvalues[array_search("t el", $basketkeys, true)];
              > $email = $basketvalues[array_search("e mail", $basketkeys, true)];
              > ?>
              > <form name='worldform 1' method='post'
              > action='https://select.worldpay .com/wcc/transaction'>
              > <input type="hidden" name="instId" value="<?php echo $instId ?>">
              > <input type="hidden" name="cartId" value="1234">
              > <input type="hidden" name="cost" value="<?php echo $cost ?>">
              > <input type="hidden" name="currency" value="<?php echo $currency ?>">
              > <input type="hidden" name="desc" value="<?php echo $desc ?>">
              > <input type="hidden" name="country" value="<?php echo $country ?>">
              > <input type="hidden" name="name" value="<?php echo $name ?>">
              > <input type="hidden" name="address" value="<?php echo $address ?>">
              > <input type="hidden" name="postcode" value="<?php echo $postcode ?>">
              > <input type="hidden" name="county" value="<?php echo $county ?>">
              > <input type="hidden" name="tel" value="<?php echo $phone ?>">
              > <input type="hidden" name="email" value="<?php echo $email ?>">
              > <input type="hidden" name="testMode" value="101">
              > </form>
              >
              > <font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
              > <script language="Javas cript">
              > document.worldf orm1.submit();
              > </script>
              > <br><br>Contact ing WorlPay Secure Payment Server<br>
              > Please Wait ....</font>
              >
              >
              > <?php
              > echo "Total Items: $totalitems <br>";
              > $toadd="mail@ma il.com";
              > $subject="Subje ct";
              > $headers = "MIME-Version: 1.0\r\n";
              > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
              > $headers .= "From: mail@mail.com\nReply-To: mail@mail.com\n";
              > $message ="<html>
              >
              > <head>
              > <title>Carpet Runners</title>
              > </head>
              > <body>
              >
              > Cart ID $cartId<br>
              > Cost $cost<br>
              > Currency $currency<br>
              > <br>
              > Invoice Name $name<br>
              > Invoice Address $address<br>
              > Invoice Postcode $postcode<br>
              > Invoice Email $email<br>
              > <br>
              > Delivery Name $delvName<br>
              > Delivery Address $delvAddress<br >
              > Delivery Postcode $delvPostcode<b r>
              > Delivery E-Mail $delvEmail<br>
              > Delivery Telephone $delvPhone<br>
              > <br><br>
              > <table>";
              >
              > $message .= "<tr><td>To tal</td></tr>\n";
              > $message .= "<tr>";
              > for ($n=0;$n<$total items;$n++){
              > $ss = $n+1;
              > $sss = "total$ss";
              > $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
              > true)]."</td>";
              > $message .= "</tr>";
              > $message .= "\n";
              > }
              > $message .= "</table></body></html>";
              > echo $message;
              > ?>
              >
              > <?php
              > if (mail($toadd, $subject, $message, $headers)){
              > echo "Thankyou ".$dealname."<b r>";
              > echo "Mail has been sent to Stairrods USA with your order<br>";
              > }
              > else
              > {
              > echo "Mail send failure.<br>";
              > }
              > ?>
              > </body>
              > </html>
              >
              > I get the e-mails, but the total isn't being shown. I believe:
              >
              > $message .= "<td>".$basketv alues[array_search($s ss, $basketkeys,
              > true)]."</td>";
              >
              > is the code that displays the total, but it doesn't show up in the e-mail.
              > The top part works i.e. everything up to the one line of code above, then
              > nothing is displayed.
              >
              > Please help, and many thanks ina dvance.
              >
              > pee2pee
              >
              > -----------------------------
              > http://janusz.monkey-it.co.uk[/color]

              Comment

              Working...