Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #1696 > unrolled thread

problem saving date fields

Started byCo <vonclausowitz@gmail.com>
First post2011-05-20 11:38 -0700
Last post2011-05-22 09:11 -0400
Articles 8 on this page of 48 — 7 participants

Back to article view | Back to comp.lang.php


Contents

  problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-20 11:38 -0700
    Re: problem saving date fields Luuk <Luuk@invalid.lan> - 2011-05-20 20:50 +0200
    Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-21 08:58 +1000
      Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-20 22:35 -0400
        Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-21 13:13 +1000
          Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-20 23:47 -0700
            Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-21 00:18 -0700
              Re: problem saving date fields Luuk <Luuk@invalid.lan> - 2011-05-21 09:54 +0200
              Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 10:37 -0400
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-21 08:07 -0700
                  Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 19:55 -0400
                    Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-22 14:20 -0700
                      Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 17:28 -0400
          Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 10:32 -0400
            Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-22 02:08 +1000
              Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 20:01 -0400
                Re: problem saving date fields "Twayne" <nobody@devnull.spamcop.net> - 2011-05-21 20:30 -0400
                  Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 23:13 -0400
                Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-22 14:28 +1000
                  Re: problem saving date fields Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-22 12:45 +0200
                  Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 08:26 -0400
                    Re: problem saving date fields "Twayne" <nobody@devnull.spamcop.net> - 2011-05-22 09:20 -0400
                    Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-23 00:08 +1000
                      Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 13:47 -0400
                        Re: problem saving date fields Bill B <me@privacy.net> - 2011-05-22 14:17 -0400
                          Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 14:26 -0400
                            Re: problem saving date fields Bill B <me@privacy.net> - 2011-05-22 16:27 -0400
                        Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-23 09:01 +1000
                          Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 20:21 -0400
                            Re: problem saving date fields Bill B <me@privacy.net> - 2011-05-22 21:36 -0400
                              Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 21:46 -0400
                            Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-23 12:20 +1000
                              Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 22:30 -0400
                                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-22 21:51 -0700
                                  Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-23 07:13 -0400
                                    Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 10:18 -0700
                                    Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 10:27 -0700
                                      Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-23 14:16 -0400
                                        Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 12:17 -0700
                                          Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-23 18:00 -0400
                                            Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 22:30 -0700
                                              Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-24 05:45 -0400
                                                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-26 02:10 -0700
                                                  Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-26 05:43 -0400
                                      Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 14:26 -0700
                                        Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-23 18:01 -0400
                              Re: problem saving date fields Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-23 23:59 +0200
                  Re: problem saving date fields "Twayne" <nobody@devnull.spamcop.net> - 2011-05-22 09:11 -0400

Page 3 of 3 — ← Prev page 1 2 [3]


#1820

FromCo <vonclausowitz@gmail.com>
Date2011-05-23 22:30 -0700
Message-ID<2eac019a-b357-4de0-96b3-aed7b9b1dc85@y31g2000vbp.googlegroups.com>
In reply to#1818
On 24 mei, 00:00, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 5/23/2011 3:17 PM, Co wrote:
>
>
>
>
>
>
>
>
>
> > On 23 mei, 20:16, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
> >> On 5/23/2011 1:27 PM, Co wrote:
>
> >>> On 23 mei, 13:13, Jerry Stuckle<jstuck...@attglobal.net>    wrote:
> >>>> On 5/23/2011 12:51 AM, Co wrote:
>
> >>>>>> ==================
>
> >>>>> Wow you guys really love each other.
>
> >>>>> Marco
>
> >>>> Yea, unfortunately, you have to put up with some trolls on usenet.
>
> >>> So when one of the three dates is not changed it returns the month
> >>> written.
> >>> Than this code:
> >>> $arrival_month = preg_replace('#[^0-9]#i', '',
> >>> $_POST['arrival_month']);
> >>> ruins the date and it gets set back to 00-00-0000.
> >>> Is there a way to detect changes? because than I could set an if
> >>> statement before
> >>> running the UPDATE query and we leave out the dates that were not
> >>> changed.
>
> >>> Marco
>
> >> OK, the question is, where is it getting the month name instead of the
> >> number?  It has to be coming from your html code.  Look at the page
> >> source and see where you're putting 'April' in there instead of 4.
>
> >> As for detecting when the data changed - the only way is to do something
> >> like save the current data in your $_SESSION and compare when it is
> >> retrieved.  However, that isn't necessary if you get your problem with
> >> the month name being retrieved.  It doesn't hurt to update a value in
> >> the database with the same value.
>
> >> --
> >> ==================
> >> Remove the "x" from my email address
> >> Jerry Stuckle
> >> JDS Computer Training Corp.
> >> jstuck...@attglobal.net
> >> ==================
>
> > It is getting the name of the month when the pulldown menu is filled.
>
> > <select name="arrival_month" class="formFields" id="arrival_month">
> > <option value="<?php print "$arrival_month"; ?>"><?php print
> > "$arrival_month"; ?></option>
> > <option value="01">January</option>
> > <option value="02">February</option>
> > <option value="03">March</option>
> > <option value="04">April</option>
> > <option value="05">May</option>
> > <option value="06">June</option>
> > <option value="07">July</option>
> > <option value="08">August</option>
> > <option value="09">September</option>
> > <option value="10">October</option>
> > <option value="11">November</option>
> > <option value="12">December</option>
> > </select>
>
> > The problem is that during the Post it returns the name instead of the
> > number.
>
> > I tried this code but when I don't change the month it doesn't pass
> > the code:
> > if(!is_numeric($arrival_month)) {
>
> > for($i=1;$i<=12;$i++){
> >     if(strtolower(date("M", mktime(0, 0, 0, $i, 1, 0))) ==
> > strtolower($arrival_month)){
> >            $arrival_month = $i;
> >                                     }
> >                                    }
> > print $arrival_month;
> > }
>
> > Marco
>
> Of course it will.  You have:
>
> <option value="<?php print "$arrival_month"; ?>"><?php print
> "$arrival_month"; ?></option>
>
> Which has the month name as its option value.  If the arrival month were
> April, you would have two Aprils - the first one in the SELECT element
> with a value of 'April', then one later with a value of '4'.
>
> You need to straighten out your HTML.  You only need one  APRIL.  Look
> up the SELECT/OPTION element and learn how to display the previously
> selected value instead of the first value (hint: look for the SELECTED
> keyword).
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Are you saying that all this coding was necessary if I had
straightened out
my select code?

Marco

[toc] | [prev] | [next] | [standalone]


#1822

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-24 05:45 -0400
Message-ID<irfuno$p2u$1@dont-email.me>
In reply to#1820
On 5/24/2011 1:30 AM, Co wrote:
> On 24 mei, 00:00, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>> On 5/23/2011 3:17 PM, Co wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> On 23 mei, 20:16, Jerry Stuckle<jstuck...@attglobal.net>    wrote:
>>>> On 5/23/2011 1:27 PM, Co wrote:
>>
>>>>> On 23 mei, 13:13, Jerry Stuckle<jstuck...@attglobal.net>      wrote:
>>>>>> On 5/23/2011 12:51 AM, Co wrote:
>>
>>>>>>>> ==================
>>
>>>>>>> Wow you guys really love each other.
>>
>>>>>>> Marco
>>
>>>>>> Yea, unfortunately, you have to put up with some trolls on usenet.
>>
>>>>> So when one of the three dates is not changed it returns the month
>>>>> written.
>>>>> Than this code:
>>>>> $arrival_month = preg_replace('#[^0-9]#i', '',
>>>>> $_POST['arrival_month']);
>>>>> ruins the date and it gets set back to 00-00-0000.
>>>>> Is there a way to detect changes? because than I could set an if
>>>>> statement before
>>>>> running the UPDATE query and we leave out the dates that were not
>>>>> changed.
>>
>>>>> Marco
>>
>>>> OK, the question is, where is it getting the month name instead of the
>>>> number?  It has to be coming from your html code.  Look at the page
>>>> source and see where you're putting 'April' in there instead of 4.
>>
>>>> As for detecting when the data changed - the only way is to do something
>>>> like save the current data in your $_SESSION and compare when it is
>>>> retrieved.  However, that isn't necessary if you get your problem with
>>>> the month name being retrieved.  It doesn't hurt to update a value in
>>>> the database with the same value.
>>
>>>> --
>>>> ==================
>>>> Remove the "x" from my email address
>>>> Jerry Stuckle
>>>> JDS Computer Training Corp.
>>>> jstuck...@attglobal.net
>>>> ==================
>>
>>> It is getting the name of the month when the pulldown menu is filled.
>>
>>> <select name="arrival_month" class="formFields" id="arrival_month">
>>> <option value="<?php print "$arrival_month"; ?>"><?php print
>>> "$arrival_month"; ?></option>
>>> <option value="01">January</option>
>>> <option value="02">February</option>
>>> <option value="03">March</option>
>>> <option value="04">April</option>
>>> <option value="05">May</option>
>>> <option value="06">June</option>
>>> <option value="07">July</option>
>>> <option value="08">August</option>
>>> <option value="09">September</option>
>>> <option value="10">October</option>
>>> <option value="11">November</option>
>>> <option value="12">December</option>
>>> </select>
>>
>>> The problem is that during the Post it returns the name instead of the
>>> number.
>>
>>> I tried this code but when I don't change the month it doesn't pass
>>> the code:
>>> if(!is_numeric($arrival_month)) {
>>
>>> for($i=1;$i<=12;$i++){
>>>      if(strtolower(date("M", mktime(0, 0, 0, $i, 1, 0))) ==
>>> strtolower($arrival_month)){
>>>             $arrival_month = $i;
>>>                                      }
>>>                                     }
>>> print $arrival_month;
>>> }
>>
>>> Marco
>>
>> Of course it will.  You have:
>>
>> <option value="<?php print "$arrival_month"; ?>"><?php print
>> "$arrival_month"; ?></option>
>>
>> Which has the month name as its option value.  If the arrival month were
>> April, you would have two Aprils - the first one in the SELECT element
>> with a value of 'April', then one later with a value of '4'.
>>
>> You need to straighten out your HTML.  You only need one  APRIL.  Look
>> up the SELECT/OPTION element and learn how to display the previously
>> selected value instead of the first value (hint: look for the SELECTED
>> keyword).
>>
>
> Are you saying that all this coding was necessary if I had
> straightened out
> my select code?
>
> Marco

No, all that coding is UNNECESSARY if you straighten out your select code.

You do still want to validate the input, but it's much less complex - 
i.e. in your case all you need to do is ensure the value is an integer 
(check out intval()).  And if it is not, just reject the input.  No need 
to try to correct it.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1844

FromCo <vonclausowitz@gmail.com>
Date2011-05-26 02:10 -0700
Message-ID<8bbf6db3-ac7b-4d72-9e70-5c9915920e66@z19g2000yqz.googlegroups.com>
In reply to#1822
On 24 mei, 12:45, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 5/24/2011 1:30 AM, Co wrote:
>
>
>
> > On 24 mei, 00:00, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
> >> On 5/23/2011 3:17 PM, Co wrote:
>
> >>> On 23 mei, 20:16, Jerry Stuckle<jstuck...@attglobal.net>    wrote:
> >>>> On 5/23/2011 1:27 PM, Co wrote:
>
> >>>>> On 23 mei, 13:13, Jerry Stuckle<jstuck...@attglobal.net>      wrote:
> >>>>>> On 5/23/2011 12:51 AM, Co wrote:
>
> >>>>>>>> ==================
>
> >>>>>>> Wow you guys really love each other.
>
> >>>>>>> Marco
>
> >>>>>> Yea, unfortunately, you have to put up with some trolls on usenet.
>
> >>>>> So when one of the three dates is not changed it returns the month
> >>>>> written.
> >>>>> Than this code:
> >>>>> $arrival_month = preg_replace('#[^0-9]#i', '',
> >>>>> $_POST['arrival_month']);
> >>>>> ruins the date and it gets set back to 00-00-0000.
> >>>>> Is there a way to detect changes? because than I could set an if
> >>>>> statement before
> >>>>> running the UPDATE query and we leave out the dates that were not
> >>>>> changed.
>
> >>>>> Marco
>
> >>>> OK, the question is, where is it getting the month name instead of the
> >>>> number?  It has to be coming from your html code.  Look at the page
> >>>> source and see where you're putting 'April' in there instead of 4.
>
> >>>> As for detecting when the data changed - the only way is to do something
> >>>> like save the current data in your $_SESSION and compare when it is
> >>>> retrieved.  However, that isn't necessary if you get your problem with
> >>>> the month name being retrieved.  It doesn't hurt to update a value in
> >>>> the database with the same value.
>
> >>>> --
> >>>> ==================
> >>>> Remove the "x" from my email address
> >>>> Jerry Stuckle
> >>>> JDS Computer Training Corp.
> >>>> jstuck...@attglobal.net
> >>>> ==================
>
> >>> It is getting the name of the month when the pulldown menu is filled.
>
> >>> <select name="arrival_month" class="formFields" id="arrival_month">
> >>> <option value="<?php print "$arrival_month"; ?>"><?php print
> >>> "$arrival_month"; ?></option>
> >>> <option value="01">January</option>
> >>> <option value="02">February</option>
> >>> <option value="03">March</option>
> >>> <option value="04">April</option>
> >>> <option value="05">May</option>
> >>> <option value="06">June</option>
> >>> <option value="07">July</option>
> >>> <option value="08">August</option>
> >>> <option value="09">September</option>
> >>> <option value="10">October</option>
> >>> <option value="11">November</option>
> >>> <option value="12">December</option>
> >>> </select>
>
> >>> The problem is that during the Post it returns the name instead of the
> >>> number.
>
> >>> I tried this code but when I don't change the month it doesn't pass
> >>> the code:
> >>> if(!is_numeric($arrival_month)) {
>
> >>> for($i=1;$i<=12;$i++){
> >>>      if(strtolower(date("M", mktime(0, 0, 0, $i, 1, 0))) ==
> >>> strtolower($arrival_month)){
> >>>             $arrival_month = $i;
> >>>                                      }
> >>>                                     }
> >>> print $arrival_month;
> >>> }
>
> >>> Marco
>
> >> Of course it will.  You have:
>
> >> <option value="<?php print "$arrival_month"; ?>"><?php print
> >> "$arrival_month"; ?></option>
>
> >> Which has the month name as its option value.  If the arrival month were
> >> April, you would have two Aprils - the first one in the SELECT element
> >> with a value of 'April', then one later with a value of '4'.
>
> >> You need to straighten out your HTML.  You only need one  APRIL.  Look
> >> up the SELECT/OPTION element and learn how to display the previously
> >> selected value instead of the first value (hint: look for the SELECTED
> >> keyword).
>
> > Are you saying that all this coding was necessary if I had
> > straightened out
> > my select code?
>
> > Marco
>
> No, all that coding is UNNECESSARY if you straighten out your select code.
>
> You do still want to validate the input, but it's much less complex -
> i.e. in your case all you need to do is ensure the value is an integer
> (check out intval()).  And if it is not, just reject the input.  No need
> to try to correct it.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Jerry,

that doesn't solve my problem.
It just tells me that there is a dead end street.

Marco

[toc] | [prev] | [next] | [standalone]


#1845

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-26 05:43 -0400
Message-ID<irl7c5$fth$1@dont-email.me>
In reply to#1844
On 5/26/2011 5:10 AM, Co wrote:
> On 24 mei, 12:45, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>> On 5/24/2011 1:30 AM, Co wrote:
>>
>>
>>
>>> On 24 mei, 00:00, Jerry Stuckle<jstuck...@attglobal.net>    wrote:
>>>> On 5/23/2011 3:17 PM, Co wrote:
>>
>>>>> On 23 mei, 20:16, Jerry Stuckle<jstuck...@attglobal.net>      wrote:
>>>>>> On 5/23/2011 1:27 PM, Co wrote:
>>
>>>>>>> On 23 mei, 13:13, Jerry Stuckle<jstuck...@attglobal.net>        wrote:
>>>>>>>> On 5/23/2011 12:51 AM, Co wrote:
>>
>>>>>>>>>> ==================
>>
>>>>>>>>> Wow you guys really love each other.
>>
>>>>>>>>> Marco
>>
>>>>>>>> Yea, unfortunately, you have to put up with some trolls on usenet.
>>
>>>>>>> So when one of the three dates is not changed it returns the month
>>>>>>> written.
>>>>>>> Than this code:
>>>>>>> $arrival_month = preg_replace('#[^0-9]#i', '',
>>>>>>> $_POST['arrival_month']);
>>>>>>> ruins the date and it gets set back to 00-00-0000.
>>>>>>> Is there a way to detect changes? because than I could set an if
>>>>>>> statement before
>>>>>>> running the UPDATE query and we leave out the dates that were not
>>>>>>> changed.
>>
>>>>>>> Marco
>>
>>>>>> OK, the question is, where is it getting the month name instead of the
>>>>>> number?  It has to be coming from your html code.  Look at the page
>>>>>> source and see where you're putting 'April' in there instead of 4.
>>
>>>>>> As for detecting when the data changed - the only way is to do something
>>>>>> like save the current data in your $_SESSION and compare when it is
>>>>>> retrieved.  However, that isn't necessary if you get your problem with
>>>>>> the month name being retrieved.  It doesn't hurt to update a value in
>>>>>> the database with the same value.
>>
>>>>>> --
>>>>>> ==================
>>>>>> Remove the "x" from my email address
>>>>>> Jerry Stuckle
>>>>>> JDS Computer Training Corp.
>>>>>> jstuck...@attglobal.net
>>>>>> ==================
>>
>>>>> It is getting the name of the month when the pulldown menu is filled.
>>
>>>>> <select name="arrival_month" class="formFields" id="arrival_month">
>>>>> <option value="<?php print "$arrival_month"; ?>"><?php print
>>>>> "$arrival_month"; ?></option>
>>>>> <option value="01">January</option>
>>>>> <option value="02">February</option>
>>>>> <option value="03">March</option>
>>>>> <option value="04">April</option>
>>>>> <option value="05">May</option>
>>>>> <option value="06">June</option>
>>>>> <option value="07">July</option>
>>>>> <option value="08">August</option>
>>>>> <option value="09">September</option>
>>>>> <option value="10">October</option>
>>>>> <option value="11">November</option>
>>>>> <option value="12">December</option>
>>>>> </select>
>>
>>>>> The problem is that during the Post it returns the name instead of the
>>>>> number.
>>
>>>>> I tried this code but when I don't change the month it doesn't pass
>>>>> the code:
>>>>> if(!is_numeric($arrival_month)) {
>>
>>>>> for($i=1;$i<=12;$i++){
>>>>>       if(strtolower(date("M", mktime(0, 0, 0, $i, 1, 0))) ==
>>>>> strtolower($arrival_month)){
>>>>>              $arrival_month = $i;
>>>>>                                       }
>>>>>                                      }
>>>>> print $arrival_month;
>>>>> }
>>
>>>>> Marco
>>
>>>> Of course it will.  You have:
>>
>>>> <option value="<?php print "$arrival_month"; ?>"><?php print
>>>> "$arrival_month"; ?></option>
>>
>>>> Which has the month name as its option value.  If the arrival month were
>>>> April, you would have two Aprils - the first one in the SELECT element
>>>> with a value of 'April', then one later with a value of '4'.
>>
>>>> You need to straighten out your HTML.  You only need one  APRIL.  Look
>>>> up the SELECT/OPTION element and learn how to display the previously
>>>> selected value instead of the first value (hint: look for the SELECTED
>>>> keyword).
>>
>>> Are you saying that all this coding was necessary if I had
>>> straightened out
>>> my select code?
>>
>>> Marco
>>
>> No, all that coding is UNNECESSARY if you straighten out your select code.
>>
>> You do still want to validate the input, but it's much less complex -
>> i.e. in your case all you need to do is ensure the value is an integer
>> (check out intval()).  And if it is not, just reject the input.  No need
>> to try to correct it.
>>
>
> Jerry,
>
> that doesn't solve my problem.
> It just tells me that there is a dead end street.
>
> Marco

Marco, I gave you hints on how to code your html.  Learn how to do it 
properly.  And if you need html help, try an html newsgroup.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1815

FromCo <vonclausowitz@gmail.com>
Date2011-05-23 14:26 -0700
Message-ID<05869633-655f-482b-b163-b8b301603800@w36g2000vbi.googlegroups.com>
In reply to#1806
On 23 mei, 19:27, Co <vonclausow...@gmail.com> wrote:
> On 23 mei, 13:13, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>
>
>
>
>
>
>
>
>
> > On 5/23/2011 12:51 AM, Co wrote:
>
> > >> ==================
>
> > > Wow you guys really love each other.
>
> > > Marco
>
> > Yea, unfortunately, you have to put up with some trolls on usenet.
>
> > --
> > ==================
> > Remove the "x" from my email address
> > Jerry Stuckle
> > JDS Computer Training Corp.
> > jstuck...@attglobal.net
> > ==================
>
> So when one of the three dates is not changed it returns the month
> written.
> Than this code:
> $arrival_month = preg_replace('#[^0-9]#i', '',
> $_POST['arrival_month']);
> ruins the date and it gets set back to 00-00-0000.
> Is there a way to detect changes? because than I could set an if
> statement before
> running the UPDATE query and we leave out the dates that were not
> changed.
>
> Marco

Guys,

I solved the problem.
Maybe not the nicest way but it is working.
Here is the code:

$num_arrival_month = "";
$arrival_month = $_POST['arrival_month'];
if(!is_numeric($arrival_month)) {

for($i=1;$i<=12;$i++){
	if(date("F", mktime(0, 0, 0, $i, 1, 0)) == $arrival_month){
	$num_arrival_month = $i;
    break;
					 }
   				}
} else {
	$num_arrival_month = $arrival_month;
}

	$arrival_day = preg_replace('#[^0-9]#i', '', $_POST['arrival_day']);
	$arrival_year = preg_replace('#[^0-9]#i', '',
$_POST['arrival_year']);
    $arrival_date = "$arrival_year-$num_arrival_month-$arrival_day";


Any comments?

Marco

[toc] | [prev] | [next] | [standalone]


#1819

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-23 18:01 -0400
Message-ID<irelft$8pj$2@dont-email.me>
In reply to#1815
On 5/23/2011 5:26 PM, Co wrote:
> On 23 mei, 19:27, Co<vonclausow...@gmail.com>  wrote:
>> On 23 mei, 13:13, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> On 5/23/2011 12:51 AM, Co wrote:
>>
>>>>> ==================
>>
>>>> Wow you guys really love each other.
>>
>>>> Marco
>>
>>> Yea, unfortunately, you have to put up with some trolls on usenet.
>>
>>> --
>>> ==================
>>> Remove the "x" from my email address
>>> Jerry Stuckle
>>> JDS Computer Training Corp.
>>> jstuck...@attglobal.net
>>> ==================
>>
>> So when one of the three dates is not changed it returns the month
>> written.
>> Than this code:
>> $arrival_month = preg_replace('#[^0-9]#i', '',
>> $_POST['arrival_month']);
>> ruins the date and it gets set back to 00-00-0000.
>> Is there a way to detect changes? because than I could set an if
>> statement before
>> running the UPDATE query and we leave out the dates that were not
>> changed.
>>
>> Marco
>
> Guys,
>
> I solved the problem.
> Maybe not the nicest way but it is working.
> Here is the code:
>
> $num_arrival_month = "";
> $arrival_month = $_POST['arrival_month'];
> if(!is_numeric($arrival_month)) {
>
> for($i=1;$i<=12;$i++){
> 	if(date("F", mktime(0, 0, 0, $i, 1, 0)) == $arrival_month){
> 	$num_arrival_month = $i;
>      break;
> 					 }
>     				}
> } else {
> 	$num_arrival_month = $arrival_month;
> }
>
> 	$arrival_day = preg_replace('#[^0-9]#i', '', $_POST['arrival_day']);
> 	$arrival_year = preg_replace('#[^0-9]#i', '',
> $_POST['arrival_year']);
>      $arrival_date = "$arrival_year-$num_arrival_month-$arrival_day";
>
>
> Any comments?
>
> Marco

No, you will be much better off learning to use the SELECT element 
properly, as I indicated before.  Look for some HTML tutorials.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1817

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-05-23 23:59 +0200
Message-ID<2708551.dWV9SEqChM@PointedEars.de>
In reply to#1791
Jeff North wrote:

> Jerry Stuckle wrote:
>> Jeff North wrote:
>> > Jerry Stuckle:
>> > <irbi7i$gqk$2@dont-email.me>  wrote:
>> >> Jeff North wrote:
>> >> > Jerry Stuckle:
>> >> > <irave9$qdq$1@dont-email.me>   wrote:
>> >> >> > Now where does it state "It needs to be exactly
>> >> >> > hyphen-hyphen-space-newline."
>> >> >> In the RFC.  But you can't read either, so we also know you
>> >> >> are an idiot.
>> >> > Which RFC is that - it isn't in the one you provided (3676 or
>> >> > 3736). Care to provide another RFC?
>> >> 3767.  Learn to read, idiot.  But we already know that is beyond
>> >> your limited capabilities.
>> > First it was 3736, then 3676 and on the third attempt we have 3767!!!
>> >
>> > What on earth has "Securely Available Credentials Protocol" got to do
>> > with the signature line format?
>> What an idiot.  Sure, it was a typo.  It's 3676,
> 
> IOW your full of crap.
         ^
Apparently your English is even worse than your comprehension or manners.  
(This should mean something to you coming from me who speaks English as 
foreign language.)

While Jerry certainly could take more care in typing (and display some 
manners himself), you are evidentially the one who was and is wrong here.  
Take it like a man, shut up, and learn to post for a change (as for quoting, 
the `|' character is to be used as prefix for third-party quotes only, also 
skip the attribution novels, and trim your quotes).

Or be killfiled.

Your continued off-topic whining does nobody any service.


Score adjusted

PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

[toc] | [prev] | [next] | [standalone]


#1766

From"Twayne" <nobody@devnull.spamcop.net>
Date2011-05-22 09:11 -0400
Message-ID<irb22h$ahu$1@dont-email.me>
In reply to#1760
In news:7otgt6963n7tt7ns1of8ug7d5uf0ne641d@4ax.com,
Jeff North <jnorthau@yahoo.com.au> typed:
> On Sat, 21 May 2011 20:01:17 -0400, in comp.lang.php
> Jerry Stuckle <jstucklex@attglobal.net>
> <ir9jom$663$1@dont-email.me> wrote:
>
>>> On 5/21/2011 12:08 PM, Jeff North wrote:
>>>> On Sat, 21 May 2011 10:32:20 -0400, in comp.lang.php
>>>> Jerry Stuckle <jstucklex@attglobal.net>
>>>> <ir8idn$ojm$1@dont-email.me>  wrote:
>>>>
>
> [snip]
>
>>>> There is no need to have variables in the code that
>>>> aren't being used.
>>>
>>> Yes, there is.  In fact, it is quite common to have
>>> variables in the code which are not being use *at this
>>> time*.  And very good reasons for *not* initializing
>>> them - as a *programmer* would know.
>
> Programmers who know more that just PHP know that you are
> full of crap.
>
> [snip]
>
>>>>>>>  The SQL statement should be ok - it's the "When I
>>>>>>>  change of them the other one gets set back to
>>>>>>> default: 00-00-0000" I'm considering.
>>>>>>
>>>>>> The SQL statement is NOT ok.  As he would find if he
>>>>>> printed it out as was suggested.
>>>>
>>>> If the SQL statement was not ok then the record
>>>> wouldn't be updated.
>>>
>>> Or the row (tables have ROWS, not RECORDS) is not being
>>> updated with the correct data - which is the case here.
>>> But then a *programmer* would understand that.
>
> A row, or record, would NOT be updated if the SQL
> statement is NOT ok - even a moron like you can
> understand that - oh you do that is why you chose to
> answer the question the way you did.
>
>>>>>>>>  | BTW - your sig separator is broken.  It needs
>>>>>>>>  to be exactly | hyphen-hyphen-space-newline.
>
> [snip]
>
>>>>>> It has nothing to do with Thunderbird.  It has
>>>>>> EVERYTHING to do with following usenet standards, in
>>>>>> this case RFC 3736.
>>>>
>>>> Please highlight the line(s) from RFC 3736 that can
>>>> back up your claim.
>>>>
>>>>>> But I see you're as clueless about rfcs as you are
>>>>>> programming.
>>>> -- -------------------------------------------------
>>>> The supplied code is for guideline purposes only.
>>>
>>> Typo - the rfc is 3676,
>
> 3676 and 3736 is NOT a typo not matter how you try to
> spin it. If you are going to speak with the voice of
> authority then get your facts correct first.
>
>>> which you could find if you knew how to do a
>>> simple google search.
>
> Everyone would know that they needed to search for "The
> Text/Plain Format and DelSp Parameters" to get to the
> relevant information that you got wrong in the first
> place - right?
>
>>> But that looks to be beyond your capability, also.
>
> http://www.apps.ietf.org/rfc/rfc3676.html#sec-4.3
> "There is a long-standing convention in Usenet news which
> also commonly appears in Internet mail of using "-- " as
> the separator line between the body and the signature of
> a message. When generating a Format=Flowed message
> containing a Usenet-style separator before the signature,
> the separator line is sent as-is."
>
> Now where does it state "It needs to be exactly
> hyphen-hyphen-space-newline."
>
> [snip]
> --
> -----------------------------------------------------------
> "Pr0r3p" <pr0r3p@yahoo.com> wrote:
> I said I was aiming at your stupidity, not your brain.
>
> "Johnny" <wxpprofessional@msn.com> writes:
> You missed. You can not hit a non-existent thing.
> --
> -----------------------------------------------------------

 I can't tell you which of the netiquette/protocol RFCs contains the 
dash-dash-space conventon, but it is included in one of them. For instance, 
neither of the two sig delimiters above has the requisite space after it, so 
it was not removed in this reply.
   Otherwise I agree with you.

HTH,

Twayne`

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.php


csiph-web