php-general Digest 28 Mar 2010 13:28:16 -0000 Issue 6663

Topics (messages 303526 through 303547):

Re: Noloh PHP Framework
        303526 by: Ashley Sheridan
        303529 by: Ashley Sheridan
        303530 by: Ashley Sheridan
        303533 by: Asher Snyder
        303534 by: Robert Cummings
        303536 by: Adam Richardson
        303537 by: Asher Snyder

Re: Server-side postscript-to-PDF on-the-fly conversion
        303527 by: tedd
        303528 by: Ashley Sheridan
        303535 by: Yousif Masoud
        303538 by: Frank Arensmeier

Adding Time
        303531 by: Gary
        303532 by: Nilesh Govindarajan
        303539 by: Gary
        303540 by: Yousif Masoud
        303541 by: Gary
        303542 by: Yousif Masoud
        303543 by: Gary
        303544 by: Yousif Masoud
        303545 by: Yousif Masoud
        303546 by: Gary

bug tracking system
        303547 by: Andre Polykanine

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Sat, 2010-03-27 at 12:18 -0400, Brandon Rampersad wrote:

> Hello buds,
> 
> Anyone have experience with the noloh php framework (noloh) and knows where
> i can download it? Im not sure if its open source or encrypted.
> 
> Thanks

http://www.google.co.uk/search?q=php+noloh

Searching usually helps, and the first result seems to be the main
website for the framework ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Sat, 2010-03-27 at 13:21 -0400, Brandon Rampersad wrote:

> Thank you but i can't find the download on that website. Anyone have
> it that can send it to me via an attachment? Thank You
> 
> 
> On Sat, Mar 27, 2010 at 12:45 PM, Ashley Sheridan
> <a...@ashleysheridan.co.uk> wrote:
> 
>         
>         On Sat, 2010-03-27 at 12:18 -0400, Brandon Rampersad wrote: 
>         
>         > Hello buds,
>         > 
>         > Anyone have experience with the noloh php framework (noloh) and 
> knows where
>         > i can download it? Im not sure if its open source or encrypted.
>         > 
>         > Thanks
>         
>         http://www.google.co.uk/search?q=php+noloh
>         
>         Searching usually helps, and the first result seems to be the
>         main website for the framework ;)
>         
>         Thanks,
>         Ash
>         http://www.ashleysheridan.co.uk
>         
>         
>         
> 
> 


There's a massive 'Download Now' link that goes to their products
page...

Ps, you should hit reply to all rather than just reply so that it goes
back to the whole list.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Sat, 2010-03-27 at 13:33 -0400, Brandon Rampersad wrote:

> Sorry, im on gmail and can't find that button. i only see the reply
> button.


maybe try manually adding the php-general email address in?

I know a lot of people here use Gmail accounts on the list, maybe one of
them knows something that could help you?


Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Hello Brandon,

I'm Asher Snyder, one of the developers of NOLOH. Please feel free to e-mail
me with any questions you have.

On Sat, Mar 27, 2010 at 1:23 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk>wrote:

> On Sat, 2010-03-27 at 13:21 -0400, Brandon Rampersad wrote:
>
> > Thank you but i can't find the download on that website. Anyone have
> > it that can send it to me via an attachment? Thank You
> >
> >
> > On Sat, Mar 27, 2010 at 12:45 PM, Ashley Sheridan
> > <a...@ashleysheridan.co.uk> wrote:
> >
> >
> >         On Sat, 2010-03-27 at 12:18 -0400, Brandon Rampersad wrote:
> >
> >         > Hello buds,
> >         >
> >         > Anyone have experience with the noloh php framework (noloh) and
> knows where
> >         > i can download it? Im not sure if its open source or encrypted.
> >         >
> >         > Thanks
> >
> >         http://www.google.co.uk/search?q=php+noloh
> >
> >         Searching usually helps, and the first result seems to be the
> >         main website for the framework ;)
> >
> >         Thanks,
> >         Ash
> >         http://www.ashleysheridan.co.uk
> >
> >
> >
> >
> >
>
>
> There's a massive 'Download Now' link that goes to their products
> page...
>
> Ps, you should hit reply to all rather than just reply so that it goes
> back to the whole list.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


-- 
Asher Snyder
Co-founder
NOLOH LLC.
347-416-6508
http://www.noloh.com

--- End Message ---
--- Begin Message --- I viewed the source on the site like the features suggested I should... does NOLOH always generate HTML with all those hard embedded style attributes?

Cheers,
Rob.



Asher Snyder wrote:
Hello Brandon,

I'm Asher Snyder, one of the developers of NOLOH. Please feel free to e-mail
me with any questions you have.

On Sat, Mar 27, 2010 at 1:23 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk>wrote:

On Sat, 2010-03-27 at 13:21 -0400, Brandon Rampersad wrote:

Thank you but i can't find the download on that website. Anyone have
it that can send it to me via an attachment? Thank You


On Sat, Mar 27, 2010 at 12:45 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk> wrote:


        On Sat, 2010-03-27 at 12:18 -0400, Brandon Rampersad wrote:

        > Hello buds,
        >
        > Anyone have experience with the noloh php framework (noloh) and
knows where
        > i can download it? Im not sure if its open source or encrypted.
        >
        > Thanks

        http://www.google.co.uk/search?q=php+noloh

        Searching usually helps, and the first result seems to be the
        main website for the framework ;)

        Thanks,
        Ash
        http://www.ashleysheridan.co.uk






There's a massive 'Download Now' link that goes to their products
page...

Ps, you should hit reply to all rather than just reply so that it goes
back to the whole list.

Thanks,
Ash
http://www.ashleysheridan.co.uk






--
http://www.interjinn.com
Application and Templating Framework for PHP

--- End Message ---
--- Begin Message ---
On Sat, Mar 27, 2010 at 1:30 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk>wrote:

> On Sat, 2010-03-27 at 13:33 -0400, Brandon Rampersad wrote:
>
> > Sorry, im on gmail and can't find that button. i only see the reply
> > button.
>
>
> maybe try manually adding the php-general email address in?
>
> I know a lot of people here use Gmail accounts on the list, maybe one of
> them knows something that could help you?
>
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
Brandon, to reply all in gmail, click on the downward arrow right beside the
reply button and you'll see the reply all option.

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
Hey Rob,

No. NOLOH actually generates different code for different devices. For
example, a browser with JavaScript will get all elements added via DOM, and
no actual HTMLis generated, however when the DOM is viewed via Firebug and
properties were explicitly assigned to an object, they're translated as
inline styles. All the style attributes are determined by the developer you
can either use direct object modification, and/or use CSS classes and style
sheets. See http://dev.noloh.com/#/articles/NOLOH-and-CSS/ for more
information.

There's also some information about layout here:
http://dev.noloh.com/#/articles/Layout-in-NOLOH/.

If you're interested, we recently came back from 2 weeks ago and posted our
very informative and instructive screencast of the talk here:
http://vimeo.com/10106797. If this is too long for you, we cut it up into
topically concise segments here:
http://www.youtube.com/user/phpframework#grid/user/C102458C2FFD8ACF

Please let us know if there's anything else you're curious about.

Regards,
Asher Snyder

On Sat, Mar 27, 2010 at 2:19 PM, Robert Cummings <rob...@interjinn.com>wrote:

> I viewed the source on the site like the features suggested I should...
> does NOLOH always generate HTML with all those hard embedded style
> attributes?
>
> Cheers,
> Rob.
>
>
>
>
> Asher Snyder wrote:
>
>> Hello Brandon,
>>
>> I'm Asher Snyder, one of the developers of NOLOH. Please feel free to
>> e-mail
>> me with any questions you have.
>>
>> On Sat, Mar 27, 2010 at 1:23 PM, Ashley Sheridan
>> <a...@ashleysheridan.co.uk>wrote:
>>
>>  On Sat, 2010-03-27 at 13:21 -0400, Brandon Rampersad wrote:
>>>
>>>  Thank you but i can't find the download on that website. Anyone have
>>>> it that can send it to me via an attachment? Thank You
>>>>
>>>>
>>>> On Sat, Mar 27, 2010 at 12:45 PM, Ashley Sheridan
>>>> <a...@ashleysheridan.co.uk> wrote:
>>>>
>>>>
>>>>        On Sat, 2010-03-27 at 12:18 -0400, Brandon Rampersad wrote:
>>>>
>>>>        > Hello buds,
>>>>        >
>>>>        > Anyone have experience with the noloh php framework (noloh) and
>>>>
>>> knows where
>>>
>>>>        > i can download it? Im not sure if its open source or encrypted.
>>>>        >
>>>>        > Thanks
>>>>
>>>>        http://www.google.co.uk/search?q=php+noloh
>>>>
>>>>        Searching usually helps, and the first result seems to be the
>>>>        main website for the framework ;)
>>>>
>>>>        Thanks,
>>>>        Ash
>>>>        http://www.ashleysheridan.co.uk
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>> There's a massive 'Download Now' link that goes to their products
>>> page...
>>>
>>> Ps, you should hit reply to all rather than just reply so that it goes
>>> back to the whole list.
>>>
>>> Thanks,
>>> Ash
>>> http://www.ashleysheridan.co.uk
>>>
>>>
>>>
>>>
>>
>>
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>



-- 
Asher Snyder
Co-founder
NOLOH LLC.
347-416-6508
http://www.noloh.com

--- End Message ---
--- Begin Message ---
At 12:41 AM -0400 3/27/10, Rob Gould wrote:
Is there a free solution out there that will enable me to take a PHP-generated postscript output file, and dynamically, on-the-fly convert it to a PDF document and send to the user as a download when the user clients on a link?

More description of what I'm trying to do:

1)  I've got a web-page that accepts some user input
2)  They hit SUBMIT
3) I've got a PHP file that takes that input and generates a custom Postscript file from it, which I presently serve back to the user. On a Mac, Safari and Firefox automatically take the .ps output and render it in Preview. 4) However, in the world of Windows, it seems like it'd be better to just convert it on-the-fly into a PDF, so that the user doesn't need to worry about having a post-script viewer app installed.

Rob :

Do you want something like this:

http://webbytedd.com/bb/pdf/

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Sat, 2010-03-27 at 12:55 -0400, tedd wrote:

> At 12:41 AM -0400 3/27/10, Rob Gould wrote:
> >Is there a free solution out there that will enable me to take a 
> >PHP-generated postscript output file, and dynamically, on-the-fly 
> >convert it to a PDF document and send to the user as a download when 
> >the user clients on a link?
> >
> >More description of what I'm trying to do:
> >
> >1)  I've got a web-page that accepts some user input
> >2)  They hit SUBMIT
> >3)  I've got a PHP file that takes that input and generates a custom 
> >Postscript file from it, which I presently serve back to the user. 
> >On a Mac, Safari and Firefox automatically take the .ps output and 
> >render it in Preview.
> >4)  However, in the world of Windows, it seems like it'd be better 
> >to just convert it on-the-fly into a PDF, so that the user doesn't 
> >need to worry about having a post-script viewer app installed.
> 
> Rob :
> 
> Do you want something like this:
> 
> http://webbytedd.com/bb/pdf/
> 
> Cheers,
> 
> tedd
> -- 
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 


It doesn't seem to like characters outside the normal range. I tried a
name of '©½£¿±®' (cruel parents I know!) and it added a lot of other
characters before each one as if it were made up of multibyte characters
that it didn't recognise.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Sat, Mar 27, 2010 at 4:41 AM, Rob Gould <gould...@me.com> wrote:

> Is there a free solution out there that will enable me to take a
> PHP-generated postscript output file, and dynamically, on-the-fly convert it
> to a PDF document and send to the user as a download when the user clients
> on a link?
>
> [...]
>
> 3)  I've got a PHP file that takes that input and generates a custom
> Postscript file from it, which I presently serve back to the user.  On a
> Mac, Safari and Firefox automatically take the .ps output and render it in
> Preview.
>
> [...]
>

I think you're looking for a PHP library that can take the output from the
function that produces the PS file and generates a PDF file which you then
send back to the user.  I haven't come across such a utility.

I recommend generating a PDF file directly using PDFLib or FPDF (
http://www.fpdf.org/) if possible.

An alternative strategy (if you cannot create a PDF directly) could be:

1. Validate input and Generate PS file then go to 2 otherwise raise input
exception and exit
2. Write (1) to a temporary location then go to 3 otherwise raise file
generation exception and exit
3, Use a utility like ps2pdf (or ghostscript) to convert file to pdf then go
to 4 otherwise raise file conversion exception and exit
4. Serve (3) then go to 5 otherwise raise file transfer exception and exit
5. Delete files and exit normally

Tutorial on ps2pdf: http://www.linux.com/archive/feed/35022

--- End Message ---
--- Begin Message ---
27 mar 2010 kl. 05.41 skrev Rob Gould:

Is there a free solution out there that will enable me to take a PHP- generated postscript output file, and dynamically, on-the-fly convert it to a PDF document and send to the user as a download when the user clients on a link?

More description of what I'm trying to do:

1)  I've got a web-page that accepts some user input
2)  They hit SUBMIT
3) I've got a PHP file that takes that input and generates a custom Postscript file from it, which I presently serve back to the user. On a Mac, Safari and Firefox automatically take the .ps output and render it in Preview. 4) However, in the world of Windows, it seems like it'd be better to just convert it on-the-fly into a PDF, so that the user doesn't need to worry about having a post-script viewer app installed.



If your webserver runs on MacOSX, look out for a binary called 'pstopdf'. From the man page:

[...]
pstopdf is a tool to convert PostScript input data into a PDF document. The input data may come from a file or may be read from stdin. The PDF document is always written to a file. The name of the output PDF file is derived from the name of the input file or may be explicitly named using the -o option.
[...]

Another option might be xpdf (http://www.foolabs.com/xpdf/). There are several different tools bundled with that app and there might be some ps -> pdf converter too.

Otherwise, there is always Ghostscript.

/frank


--- End Message ---
--- Begin Message --- I have a manual input field to add a date on a form. There is another manual input field to add number of months (This is for a loan agreement).I am trying to add the two together to get an ending date. I dont think I am close, can anyone poimt me in the right direction.


 $pay_date=($_SESSION['pay_date']);
$loan_length=($_SESSION['loan_length']);


$pay_date = new DateTime($_SESSION['pay_date']);

$end_date = new DateTime($_SESSION['pay_date']) + ($_SESSION['loan_length']);

echo $end_date->format("m-d.Y").'<br />';


date_add($pay_date + new DateInterval($_SESSION['loan_length']));
echo '<br />'.$date->format("d-m-Y");

Gary

__________ Information from ESET NOD32 Antivirus, version of virus signature 
database 4978 (20100326) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




--- End Message ---
--- Begin Message ---
On 03/27/2010 11:13 PM, Gary wrote:
I have a manual input field to add a date on a form.  There is another
manual input field to add number of months (This is for a loan
agreement).I am trying to add the two together to get an ending date. I
dont think I am close, can anyone poimt me in the right direction.


$pay_date=($_SESSION['pay_date']);
$loan_length=($_SESSION['loan_length']);


$pay_date = new DateTime($_SESSION['pay_date']);

$end_date = new DateTime($_SESSION['pay_date']) +
($_SESSION['loan_length']);

echo $end_date->format("m-d.Y").'<br />';


date_add($pay_date + new DateInterval($_SESSION['loan_length']));
echo '<br />'.$date->format("d-m-Y");

Gary

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4978 (20100326) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com





Add time in Unix Timestamps. Then format it using strftime.

Also to format inputted date time in the form, check in php manual, to convert dates to timestamps (i forgot the func. name).

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

--- End Message ---
--- Begin Message ---
Thanks for your reply.  This comes from the manual, I have tried to change 
to my variables. I am not getting any error messages, but I am not able to 
add the $loan_length to the $pay_date.

Thanks again for any help.

gary

        <?php


  $pay_date=($_SESSION['pay_date']);


  $loan_length=($_SESSION['loan_length']);

$orgDate=($_SESSION['pay_date']);
$mth=($_SESSION['loan_length']);
function add_date($orgDate,$mth){
  $cd = strtotime($orgDate);
  $end_date = date('Y-m-d', 
mktime(0,0,0,date('m',$cd)+$mth,date('d',$cd),date('Y',$cd)));
  return $end_date;
}
echo $orgDate ."<br />";
echo $end_date ."<br />";
echo $pay_date ."<br />";
echo $loan_length;
?>

"Nilesh Govindarajan" <li...@itech7.com> wrote in message 
news:4bae4578.9080...@itech7.com...
> On 03/27/2010 11:13 PM, Gary wrote:
>> I have a manual input field to add a date on a form.  There is another
>> manual input field to add number of months (This is for a loan
>> agreement).I am trying to add the two together to get an ending date. I
>> dont think I am close, can anyone poimt me in the right direction.
>>
>>
>> $pay_date=($_SESSION['pay_date']);
>> $loan_length=($_SESSION['loan_length']);
>>
>>
>> $pay_date = new DateTime($_SESSION['pay_date']);
>>
>> $end_date = new DateTime($_SESSION['pay_date']) +
>> ($_SESSION['loan_length']);
>>
>> echo $end_date->format("m-d.Y").'<br />';
>>
>>
>> date_add($pay_date + new DateInterval($_SESSION['loan_length']));
>> echo '<br />'.$date->format("d-m-Y");
>>
>> Gary
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4978 (20100326) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>>
>
> Add time in Unix Timestamps. Then format it using strftime.
>
> Also to format inputted date time in the form, check in php manual, to 
> convert dates to timestamps (i forgot the func. name).
>
> -- 
> Nilesh Govindarajan
> Site & Server Administrator
> www.itech7.com
> ???? ???? ???? !
> ?? ????: ?????? ???? !
>
> __________ Information from ESET Smart Security, version of virus 
> signature database 4978 (20100326) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
> 



__________ Information from ESET Smart Security, version of virus signature 
database 4978 (20100326) __________

The message was checked by ESET Smart Security.

http://www.eset.com





--- End Message ---
--- Begin Message ---
On Sat, Mar 27, 2010 at 8:41 PM, Gary <gwp...@ptd.net> wrote:

> [...]
>        <?php
>
>
>  $pay_date=($_SESSION['pay_date']);
>
>
>  $loan_length=($_SESSION['loan_length']);
>
> $orgDate=($_SESSION['pay_date']);
> $mth=($_SESSION['loan_length']);
> function add_date($orgDate,$mth){
>  $cd = strtotime($orgDate);
>  $end_date = date('Y-m-d',
> mktime(0,0,0,date('m',$cd)+$mth,date('d',$cd),date('Y',$cd)));
>  return $end_date;
> }
> echo $orgDate ."<br />";
> echo $end_date ."<br />";
> echo $pay_date ."<br />";
> echo $loan_length;
> ?>


You access form element values via the $_POST superglobal, why are you using
$_SESSION?

http://php.net/manual/en/reserved.variables.post.php

--- End Message ---
--- Begin Message ---
It is a multi page form with all information being writting to the database 
via the $_SESSION's.

Gary


"Yousif Masoud" <yousif.mas...@gmail.com> wrote in message 
news:k2qbffe24ad1003271414za1377a2dsb0e4a2d23d411...@mail.gmail.com...
> On Sat, Mar 27, 2010 at 8:41 PM, Gary <gwp...@ptd.net> wrote:
>
>> [...]
>>        <?php
>>
>>
>>  $pay_date=($_SESSION['pay_date']);
>>
>>
>>  $loan_length=($_SESSION['loan_length']);
>>
>> $orgDate=($_SESSION['pay_date']);
>> $mth=($_SESSION['loan_length']);
>> function add_date($orgDate,$mth){
>>  $cd = strtotime($orgDate);
>>  $end_date = date('Y-m-d',
>> mktime(0,0,0,date('m',$cd)+$mth,date('d',$cd),date('Y',$cd)));
>>  return $end_date;
>> }
>> echo $orgDate ."<br />";
>> echo $end_date ."<br />";
>> echo $pay_date ."<br />";
>> echo $loan_length;
>> ?>
>
>
> You access form element values via the $_POST superglobal, why are you 
> using
> $_SESSION?
>
> http://php.net/manual/en/reserved.variables.post.php
>
>
>
> __________ Information from ESET Smart Security, version of virus 
> signature database 4978 (20100326) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
> 



__________ Information from ESET Smart Security, version of virus signature 
database 4978 (20100326) __________

The message was checked by ESET Smart Security.

http://www.eset.com





--- End Message ---
--- Begin Message ---
On Sat, Mar 27, 2010 at 8:41 PM, Gary <gwp...@ptd.net> wrote:

> [...]
>        <?php
>
>
>  $pay_date=($_SESSION['pay_date']);
>
>
>  $loan_length=($_SESSION['loan_length']);
>
> $orgDate=($_SESSION['pay_date']);
> $mth=($_SESSION['loan_length']);
> function add_date($orgDate,$mth){
>  $cd = strtotime($orgDate);
>  $end_date = date('Y-m-d',
> mktime(0,0,0,date('m',$cd)+$mth,date('d',$cd),date('Y',$cd)));
>  return $end_date;
> }
> echo $orgDate ."<br />";
> echo $end_date ."<br />";
> echo $pay_date ."<br />";
> echo $loan_length;
> ?>


Can you echo $pay_date and show us how the input date is formatted? eg.
2010-03-27

Can you also show us the output of the last four echo statements?

This works for me:

function addMonthsToDate($start,$month)
{
    return strtotime("$start + $month months");
}

$test = addMonthsToDate("2010-03-26",3);

echo date('Y-m-d',$test); // gives 2010-06-26

--- End Message ---
--- Begin Message ---
I have copied the echo and the code, for clarity I have echo'd 1,2,3,   etc 
to see which is working.

Thank you for your help. Hope this is clear.

Gary

$loan_length=($_SESSION['loan_length']); //is set to 36 months
$pay_date=($_SESSION['pay_date']); //is set to 01-05-2010
$orgDate=($_SESSION['pay_date']);
$mth=($_SESSION['loan_length']);

$end_date=date('m-d-Y',strtotime('$mth')) + date('m-d-Y', 
strtotime('$pay_date'));

$loan_length=date('m-d-Y');
$mthdate=date('m-d-Y',
function add_date($orgDate,$mth){
  $cd = strtotime($orgDate);

  return $end_date;
}
$orgDate=date("m",strtotime('$loan_length'));
echo 1 ."<br />";
echo $mth ."<br />";
echo 2 ."<br />";
echo $end_date ."<br />";
echo 3 ."<br />";
echo $pay_date ."<br />";
echo 4 ."<br />";
echo $loan_length."<br />";
echo 5 ."<br />";
echo $orgDate."<br />";



?>
***Page output***

1
36 //this is correct
2
24 //this is not
3
01-05-2010
4
03-27-2010
5
12 //this is not


"Yousif Masoud" <yousif.mas...@gmail.com> wrote in message 
news:x2sbffe24ad1003271508xb1f414fck7b6eb93a6cd79...@mail.gmail.com...
> On Sat, Mar 27, 2010 at 8:41 PM, Gary <gwp...@ptd.net> wrote:
>
>> [...]
>>        <?php
>>
>>
>>  $pay_date=($_SESSION['pay_date']);
>>
>>
>>  $loan_length=($_SESSION['loan_length']);
>>
>> $orgDate=($_SESSION['pay_date']);
>> $mth=($_SESSION['loan_length']);
>> function add_date($orgDate,$mth){
>>  $cd = strtotime($orgDate);
>>  $end_date = date('Y-m-d',
>> mktime(0,0,0,date('m',$cd)+$mth,date('d',$cd),date('Y',$cd)));
>>  return $end_date;
>> }
>> echo $orgDate ."<br />";
>> echo $end_date ."<br />";
>> echo $pay_date ."<br />";
>> echo $loan_length;
>> ?>
>
>
> Can you echo $pay_date and show us how the input date is formatted? eg.
> 2010-03-27
>
> Can you also show us the output of the last four echo statements?
>
> This works for me:
>
> function addMonthsToDate($start,$month)
> {
>    return strtotime("$start + $month months");
> }
>
> $test = addMonthsToDate("2010-03-26",3);
>
> echo date('Y-m-d',$test); // gives 2010-06-26
>
>
>
> __________ Information from ESET Smart Security, version of virus 
> signature database 4978 (20100326) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
> 



__________ Information from ESET Smart Security, version of virus signature 
database 4978 (20100326) __________

The message was checked by ESET Smart Security.

http://www.eset.com





--- End Message ---
--- Begin Message ---
On Sat, Mar 27, 2010 at 10:26 PM, Gary <gwp...@ptd.net> wrote:

> [...]
>
> strtotime('$pay_date'));
>
> [...]
>

If you want the value of $pay_date to be the argument of strtotime, you need
to enclose it in double quotes (do the same for all other occurrences).

Try:

strtotime("$pay_date");

[...]

When a string <http://www.php.net/manual/en/language.types.string.php> is
specified in double quotes or with heredoc,
variables<http://www.php.net/manual/en/language.variables.php>are
parsed within it.

[...]

from: http://php.net/manual/en/language.types.string.php
Beginning of Variable Parsing Section

--- End Message ---
--- Begin Message ---
On Sat, Mar 27, 2010 at 10:26 PM, Gary <gwp...@ptd.net> wrote:

> [...]
>

$end_date=date('m-d-Y',strtotime('$mth')) + date('m-d-Y',
> strtotime('$pay_date'));
>
> [...]


Try changing above to:

$end_date = date('m-d-Y',strtotime("$pay_date + $mth months"));

I think your mail client took it out of the add_date function.

--- End Message ---
--- Begin Message ---
Perfect, thank you very much for your help!

Gary


"Yousif Masoud" <yousif.mas...@gmail.com> wrote in message 
news:x2tbffe24ad1003271548l65cb6e65qd8f35ae0636e...@mail.gmail.com...
> On Sat, Mar 27, 2010 at 10:26 PM, Gary <gwp...@ptd.net> wrote:
>
>> [...]
>>
>
> $end_date=date('m-d-Y',strtotime('$mth')) + date('m-d-Y',
>> strtotime('$pay_date'));
>>
>> [...]
>
>
> Try changing above to:
>
> $end_date = date('m-d-Y',strtotime("$pay_date + $mth months"));
>
> I think your mail client took it out of the add_date function.
>
>
>
> __________ Information from ESET Smart Security, version of virus 
> signature database 4978 (20100326) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
> 



__________ Information from ESET Smart Security, version of virus signature 
database 4978 (20100326) __________

The message was checked by ESET Smart Security.

http://www.eset.com





--- End Message ---
--- Begin Message ---
Hello everyone,

Can you recommend a bug tracking system to be installed on the site?
Requirements: written in PHP (or maybe Perl); tickets system; e-mail
notifications.
-- 
With best regards from Ukraine,
Andre
Http://oire.org/ - The Fantasy blogs of Oire
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: http://twitter.com/m_elensule


--- End Message ---

Reply via email to