FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » problem saving date fields
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Re: problem saving date fields [message #174139 is a reply to message #174125] Sun, 22 May 2011 23:01 Go to previous messageGo to next message
Jeff North is currently offline  Jeff North
Messages: 58
Registered: November 2010
Karma: 0
Member
On Sun, 22 May 2011 13:47:29 -0400, in comp.lang.php Jerry Stuckle
<jstucklex(at)attglobal(dot)net>
<irbi7i$gqk$2(at)dont-email(dot)me> wrote:

> | On 5/22/2011 10:08 AM, Jeff North wrote:
> | > On Sun, 22 May 2011 08:26:48 -0400, in comp.lang.php Jerry Stuckle
> | > <jstucklex(at)attglobal(dot)net>
> | > <irave9$qdq$1(at)dont-email(dot)me> wrote:
> | >
> | >> | On 5/22/2011 12:28 AM, Jeff North wrote:
> | >> |> On Sat, 21 May 2011 20:01:17 -0400, in comp.lang.php Jerry Stuckle
> | >> |> <jstucklex(at)attglobal(dot)net>
> | >> |> <ir9jom$663$1(at)dont-email(dot)me> wrote:
> | >
> | > [snip]
> | >
> | >> |> 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."
> | >> |
> | >> | Which RFC is that?
> | >
> | > Have a look at the hyperlink provided but incase you can't read
> | > hyperlinks it is RFC 3676 - the one that YOU provided - remember?
> | >
> | >> |> 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?
Re: problem saving date fields [message #174140 is a reply to message #174139] Mon, 23 May 2011 00:21 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 5/22/2011 7:01 PM, Jeff North wrote:
> On Sun, 22 May 2011 13:47:29 -0400, in comp.lang.php Jerry Stuckle
> <jstucklex(at)attglobal(dot)net>
> <irbi7i$gqk$2(at)dont-email(dot)me> wrote:
>
>> | On 5/22/2011 10:08 AM, Jeff North wrote:
>> |> On Sun, 22 May 2011 08:26:48 -0400, in comp.lang.php Jerry Stuckle
>> |> <jstucklex(at)attglobal(dot)net>
>> |> <irave9$qdq$1(at)dont-email(dot)me> wrote:
>> |>
>> |>> | On 5/22/2011 12:28 AM, Jeff North wrote:
>> |>> |> On Sat, 21 May 2011 20:01:17 -0400, in comp.lang.php Jerry Stuckle
>> |>> |> <jstucklex(at)attglobal(dot)net>
>> |>> |> <ir9jom$663$1(at)dont-email(dot)me> wrote:
>> |>
>> |> [snip]
>> |>
>> |>> |> 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."
>> |>> |
>> |>> | Which RFC is that?
>> |>
>> |> Have a look at the hyperlink provided but incase you can't read
>> |> hyperlinks it is RFC 3676 - the one that YOU provided - remember?
>> |>
>> |>> |> 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, but it really doesn't
make any difference anyway, because the rfc has words of more than one
syllable, so you can't understand it, anyway.

Once again you prove what an idiot you are. Can't even learn to google
for yourself.

Does your mommy read books to you? And maybe even these usenet posts?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: problem saving date fields [message #174141 is a reply to message #174140] Mon, 23 May 2011 01:36 Go to previous messageGo to next message
me is currently offline  me
Messages: 192
Registered: September 2010
Karma: 0
Senior Member
On 5/22/2011 8:21 PM, Jerry Stuckle wrote:
> What an idiot. Sure, it was a typo. It's 3676, but it really doesn't
> make any difference anyway, because the rfc has words of more than one
> syllable, so you can't understand it, anyway.
>
> Once again you prove what an idiot you are. Can't even learn to google
> for yourself.
>
> Does your mommy read books to you? And maybe even these usenet posts?

No pass for being a bully, Mr. Stuckle. You can make your point using a
civil tongue.

Bill B
Re: problem saving date fields [message #174142 is a reply to message #174141] Mon, 23 May 2011 01:46 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 5/22/2011 9:36 PM, Bill B wrote:
> On 5/22/2011 8:21 PM, Jerry Stuckle wrote:
>> What an idiot. Sure, it was a typo. It's 3676, but it really doesn't
>> make any difference anyway, because the rfc has words of more than one
>> syllable, so you can't understand it, anyway.
>>
>> Once again you prove what an idiot you are. Can't even learn to google
>> for yourself.
>>
>> Does your mommy read books to you? And maybe even these usenet posts?
>
> No pass for being a bully, Mr. Stuckle. You can make your point using a
> civil tongue.
>
> Bill B
>

You can take your self-righteous attitude and stuff it where the sun
doesn't shine. That way it will be right next to your head.

But you're just a typical troll - lots of hot air but nothing positive
to add to the conversation.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: problem saving date fields [message #174143 is a reply to message #174140] Mon, 23 May 2011 02:20 Go to previous messageGo to next message
Jeff North is currently offline  Jeff North
Messages: 58
Registered: November 2010
Karma: 0
Member
On Sun, 22 May 2011 20:21:14 -0400, in comp.lang.php Jerry Stuckle
<jstucklex(at)attglobal(dot)net>
<irc99s$50v$1(at)dont-email(dot)me> wrote:

> | On 5/22/2011 7:01 PM, Jeff North wrote:
> | > On Sun, 22 May 2011 13:47:29 -0400, in comp.lang.php Jerry Stuckle
> | > <jstucklex(at)attglobal(dot)net>
> | > <irbi7i$gqk$2(at)dont-email(dot)me> wrote:
> | >
> | >> | On 5/22/2011 10:08 AM, Jeff North wrote:
> | >> |> On Sun, 22 May 2011 08:26:48 -0400, in comp.lang.php Jerry Stuckle
> | >> |> <jstucklex(at)attglobal(dot)net>
> | >> |> <irave9$qdq$1(at)dont-email(dot)me> wrote:
> | >> |>
> | >> |>> | On 5/22/2011 12:28 AM, Jeff North wrote:
> | >> |>> |> On Sat, 21 May 2011 20:01:17 -0400, in comp.lang.php Jerry Stuckle
> | >> |>> |> <jstucklex(at)attglobal(dot)net>
> | >> |>> |> <ir9jom$663$1(at)dont-email(dot)me> wrote:
> | >> |>
> | >> |> [snip]
> | >> |>
> | >> |>> |> 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."
> | >> |>> |
> | >> |>> | Which RFC is that?
> | >> |>
> | >> |> Have a look at the hyperlink provided but incase you can't read
> | >> |> hyperlinks it is RFC 3676 - the one that YOU provided - remember?
> | >> |>
> | >> |>> |> 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.

> | but it really doesn't
> | make any difference anyway, because the rfc has words of more than one
> | syllable, so you can't understand it, anyway.
> |
> | Once again you prove what an idiot you are. Can't even learn to google
> | for yourself.
> |
> | Does your mommy read books to you? And maybe even these usenet posts?
Re: problem saving date fields [message #174144 is a reply to message #174143] Mon, 23 May 2011 02:30 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 5/22/2011 10:20 PM, Jeff North wrote:
> On Sun, 22 May 2011 20:21:14 -0400, in comp.lang.php Jerry Stuckle
> <jstucklex(at)attglobal(dot)net>
> <irc99s$50v$1(at)dont-email(dot)me> wrote:
>
>> | On 5/22/2011 7:01 PM, Jeff North wrote:
>> |> On Sun, 22 May 2011 13:47:29 -0400, in comp.lang.php Jerry Stuckle
>> |> <jstucklex(at)attglobal(dot)net>
>> |> <irbi7i$gqk$2(at)dont-email(dot)me> wrote:
>> |>
>> |>> | On 5/22/2011 10:08 AM, Jeff North wrote:
>> |>> |> On Sun, 22 May 2011 08:26:48 -0400, in comp.lang.php Jerry Stuckle
>> |>> |> <jstucklex(at)attglobal(dot)net>
>> |>> |> <irave9$qdq$1(at)dont-email(dot)me> wrote:
>> |>> |>
>> |>> |>> | On 5/22/2011 12:28 AM, Jeff North wrote:
>> |>> |>> |> On Sat, 21 May 2011 20:01:17 -0400, in comp.lang.php Jerry Stuckle
>> |>> |>> |> <jstucklex(at)attglobal(dot)net>
>> |>> |>> |> <ir9jom$663$1(at)dont-email(dot)me> wrote:
>> |>> |>
>> |>> |> [snip]
>> |>> |>
>> |>> |>> |> 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."
>> |>> |>> |
>> |>> |>> | Which RFC is that?
>> |>> |>
>> |>> |> Have a look at the hyperlink provided but incase you can't read
>> |>> |> hyperlinks it is RFC 3676 - the one that YOU provided - remember?
>> |>> |>
>> |>> |>> |> 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.

IOW, your mommy isn't around to read it to you.

>
>> | but it really doesn't
>> | make any difference anyway, because the rfc has words of more than one
>> | syllable, so you can't understand it, anyway.
>> |
>> | Once again you prove what an idiot you are. Can't even learn to google
>> | for yourself.
>> |
>> | Does your mommy read books to you? And maybe even these usenet posts?


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: problem saving date fields [message #174145 is a reply to message #174144] Mon, 23 May 2011 04:51 Go to previous messageGo to next message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma: 0
Member
On 23 mei, 04:30, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 5/22/2011 10:20 PM, Jeff North wrote:
>
>
>
>
>
>
>
>
>
>> On Sun, 22 May 2011 20:21:14 -0400, in comp.lang.php Jerry Stuckle
>> <jstuck...@attglobal.net>
>> <irc99s$50...@dont-email.me>  wrote:
>
>>> | On 5/22/2011 7:01 PM, Jeff North wrote:
>>> |>  On Sun, 22 May 2011 13:47:29 -0400, in comp.lang.php Jerry Stuckle
>>> |>  <jstuck...@attglobal.net>
>>> |>  <irbi7i$gq...@dont-email.me>   wrote:
>>> |>
>>> |>>  | On 5/22/2011 10:08 AM, Jeff North wrote:
>>> |>>  |>   On Sun, 22 May 2011 08:26:48 -0400, in comp.lang.php Jerry Stuckle
>>> |>>  |>   <jstuck...@attglobal.net>
>>> |>>  |>   <irave9$qd...@dont-email.me>    wrote:
>>> |>>  |>
>>> |>>  |>>   | On 5/22/2011 12:28 AM, Jeff North wrote:
>>> |>>  |>>   |>    On Sat, 21 May 2011 20:01:17 -0400, in comp.lang.php Jerry Stuckle
>>> |>>  |>>   |>    <jstuck...@attglobal.net>
>>> |>>  |>>   |>    <ir9jom$66...@dont-email.me>     wrote:
>>> |>>  |>
>>> |>>  |>   [snip]
>>> |>>  |>
>>> |>>  |>>   |>   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."
>>> |>>  |>>   |
>>> |>>  |>>   | Which RFC is that?
>>> |>>  |>
>>> |>>  |>   Have a look at the hyperlink provided but incase you can't read
>>> |>>  |>   hyperlinks it is RFC 3676 - the one that YOU provided - remember?
>>> |>>  |>
>>> |>>  |>>   |>    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.
>
> IOW, your mommy isn't around to read it to you.
>
>
>
>>> | but it really doesn't
>>> | make any difference anyway, because the rfc has words of more than one
>>> | syllable, so you can't understand it, anyway.
>>> |
>>> | Once again you prove what an idiot you are.  Can't even learn to google
>>> | for yourself.
>>> |
>>> | Does your mommy read books to you?  And maybe even these usenet posts?
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Wow you guys really love each other.

Marco
Re: problem saving date fields [message #174148 is a reply to message #174145] Mon, 23 May 2011 11:13 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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.
jstucklex(at)attglobal(dot)net
==================
Re: problem saving date fields [message #174154 is a reply to message #174148] Mon, 23 May 2011 17:18 Go to previous messageGo to next message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma: 0
Member
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 Jerry I maneged to get the values of the query:

Array ( [firstname] => [lastname] => [gender] => m [country] =>
Netherlands [rank] => [service] => [position] => [arrival_day] => 5
[arrival_month] => April [arrival_year] => 2005 [departure_day] => 10
[departure_month] => 08 [departure_year] => 2008 [birthday_day] => 6
[birthday_month] => 11 [birthday_year] => 1980 [partner] => 2
[updateBtn2] => Update [parse_var] => location [thisWipit] =>
-231125644 ) 208

I took out the information that don't matter.
The results printed here are from an update of the Date of departure
and Birthday.
The arrival date was already set before.

What are your thoughts?
Marco
Re: problem saving date fields [message #174155 is a reply to message #174148] Mon, 23 May 2011 17:27 Go to previous messageGo to next message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma: 0
Member
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
Re: problem saving date fields [message #174160 is a reply to message #174155] Mon, 23 May 2011 18:16 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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.
jstucklex(at)attglobal(dot)net
==================
Re: problem saving date fields [message #174162 is a reply to message #174160] Mon, 23 May 2011 19:17 Go to previous messageGo to next message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma: 0
Member
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
Re: problem saving date fields [message #174164 is a reply to message #174155] Mon, 23 May 2011 21:26 Go to previous messageGo to next message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma: 0
Member
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
Re: problem saving date fields [message #174166 is a reply to message #174143] Mon, 23 May 2011 21:59 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Jeff North wrote:

> Jerry Stuckle wrote:
>> Jeff North wrote:
>>> Jerry Stuckle:
>>> <irbi7i$gqk$2(at)dont-email(dot)me> wrote:
>>>> Jeff North wrote:
>>>> > Jerry Stuckle:
>>>> > <irave9$qdq$1(at)dont-email(dot)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(at)news(dot)demon(dot)co(dot)uk>
Re: problem saving date fields [message #174167 is a reply to message #174162] Mon, 23 May 2011 22:00 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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.
jstucklex(at)attglobal(dot)net
==================
Re: problem saving date fields [message #174168 is a reply to message #174164] Mon, 23 May 2011 22:01 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: problem saving date fields [message #174169 is a reply to message #174167] Tue, 24 May 2011 05:30 Go to previous messageGo to next message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma: 0
Member
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
Re: problem saving date fields [message #174171 is a reply to message #174169] Tue, 24 May 2011 09:45 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: problem saving date fields [message #174191 is a reply to message #174171] Thu, 26 May 2011 09:10 Go to previous messageGo to next message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma: 0
Member
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
Re: problem saving date fields [message #174192 is a reply to message #174191] Thu, 26 May 2011 09:43 Go to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Pages (2): [ «    1  2]  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: is dis da place?
Next Topic: foreach in reverse
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 05:52:46 GMT 2024

Total time taken to generate the page: 0.02798 seconds