| re: php "date()" function
kingofkolt wrote:
[color=blue]
> "Westcoast Sheri" <sheri_deb88@nospamun8nospam.com> wrote in message
> news:40C8D5CF.506A44DB@nospamun8nospam.com...[color=green]
> > When I used the "date("nj")" function to generate an invoice, about 1
> > out of 500 times, nothing comes up
> >
> > <?php
> > $invoicedate = date("nj");
> > ?>
> > <html><head></head><body>
> > Invoice date:
> > <?php
> > print $invoicedate;
> > ?>
> > </body></html>
> >
> > So, when I noticed some invoices were missing dates, I tried this:
> >
> > <?php
> > $invoicedate = date("nj");
> > ?>
> > <html><head></head><body>
> > Invoice date:
> > <?php
> > if (!invoicedate) {
> > $invoicedate = date("nj");
> > }
> > print $invoicedate;
> > ?>
> > </body></html>
> >
> > But, still, 1 out of 500 times, no date prints to browser.
> >
> > My question is: On some web-servers, does the date() function not always
> > work? If not, then why not?
> >
> >
> >[/color]
>
> This won't completely answer your question, but one problem I did notice in
> your second example was that you left out the dollar sign $ in the if
> statement on line 7:
>
> if (!invoicedate) {
>
> should be
>
> if (!$invoicedate) {
>
> - JP[/color]
Oops, just a typo in this newsgroup only, not in script. |