You are here: Re: What is Wrong with this thing « All PHP « IT news, forums, messages
Re: What is Wrong with this thing

Posted by Christopher Pettet on 02/22/06 19:50

I personally would have written it different to reduce the concatenation...

$charge_id = "Charge ID: ".$charge_id
$billing_period = "\nBilling Period: ".date("m/d/Y h:i A",
$billing_start)." - ".date("m/d/Y h:i A", $billing_end);
$charge_time = "\nDate/Time of Charge: ".date("m/d/Y h:i A",
$current_time);
$card_charged = "\nCard Charged: **** **** **** ".$last_four;
$amount_charged = "\nAmount Charged: $".sprintf("%01.2f", $total);
$detail_text =
$charge_id.$billing_period.$charge_time.$card_charged.$amount_charged;

I'm presuming that $billing_start, $billing_end, $current_time, $last_four
and $total are defined somewhere else (probablly in a form) as they aren't
in the code example you supplied.

Hope this helps

Chris

"AK" <nospam@itn.com> wrote in message
news:an%Kf.25935$Ob5.9160@tornado.texas.rr.com...
> Hello - new to the group. Hope this is the right place to post this
> question.
>
> I have a script as follows. The script is part of an email message send
> routine for a credit card charge and is meant to show details of the
> charge. It is building a variable, $detail_text, and then using it in a
> "send email" routine
>
>
> Here is what it is supposed to print out on the email -
>
> Charge ID: 18
> Billing Period: 02/20/2006 12:00 AM - 02/21/2006 12:00 AM
> Date/Time of Charge: 02/21/2006 07:22 AM
> Card Charged: **** **** **** 4393
> Amount Charged: $0.86
>
>
>
> Here is what it prints -
>
> Charge ID: 18
> Billing Period: 02/20/2006 12:00 AM - 02/21/2006 12:00 AM Date/Time of
> Charge: 02/21/2006 07:22 AM
> Card Charged: **** **** **** 4393
> Amount Charged: $0.86
>
>
>
>
> Script as it now exists-
>
> //Include the details of the charge
> $detail_text = "Charge ID: " . $charge_id;
> $detail_text = $detail_text . "\n" . "Billing Period: " . date("m/d/Y
> h:i A", $billing_start) . " - " . date("m/d/Y h:i A", $billing_end);
> $detail_text = $detail_text . "\n" . "Date/Time of Charge: " .
> date("m/d/Y h:i A", $current_time);
> $detail_text = $detail_text . "\n" . "Card Charged: **** **** **** "
> . $last_four;
> $detail_text = $detail_text . "\n" . "Amount Charged: $" .
> sprintf("%01.2f", $total);
>
>
>
> (for whatever reason, the scrip is building up the variable $detail_text
> and then using that buildup variable in the email send routine.) Dont know
> why it was set up like this)
>
> Seems like the"\n" should force the break before that Date/Time line but
> is doesn't.
>
> What is wrong. Must be a syntax error but darned if I can see it.
>
> Thanks
> AK
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация