php-general Digest 12 Nov 2006 04:00:33 -0000 Issue 4454
Topics (messages 244493 through 244511):
Re: Staff log-in
244493 by: John Nichel
244494 by: David Giragosian
244506 by: Google Kreme
convert postgres date to PHP
244495 by: Alain Roger
244497 by: M.Sokolewicz
244498 by: Alain Roger
244499 by: Børge Holen
244500 by: Børge Holen
244501 by: M.Sokolewicz
PHP Source File Encoding
244496 by: C Drozdowski
244507 by: Google Kreme
244509 by: M.Sokolewicz
PEAR, MDB2 and MDB2_Driver_pgsql
244502 by: Alain Roger
Re: http_build_query ... argh
244503 by: Roman Neuhauser
activation through email
244504 by: Ahmad Al-Twaijiry
244508 by: Google Kreme
Re: PEAR and MDB2
244505 by: Roman Neuhauser
Encoder efficiency
244510 by: Sancar Saran
How do you do the ? mark after a filename
244511 by: Thomas Bonham
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Paul Novitski wrote:
At 11/10/2006 07:09 AM, tedd wrote:
Lastly, I think we all know that "non-profit" simply means that at the
end of the year you get to roll your profits over to the next year
without incurring taxes on the excess. Nothing more.
Plus, there's no limit or requirements as to the amount/percentage you
pay yourself as compared to what amounts you apply to your "cause".
So, mentioning "non-profit" to me is like saying you're just another
scam -- and one, who's trolling for free php services.
<snip school lesson>
In the meantime, I suppose it is emblematic of my own innocence that it
always surprises me when someone asks a naive question and is answered
by insults and jeers in a listserve composed of bright and knowledgeable
people who have purportedly come together for mutual education.
The OP didn't ask a 'naive question' about why his register globals
isn't working or something like that...he asked us to do his work for
him. No 'mutual education' there.
There
may be no such thing as a stupid question, but the same cannot be said
of the range of possible answers.
It's naive to think there are no stupid questions.
Had the original poster known enough about our field to ask for
recommendations of open source solutions, would he have been treated so
roughly?
Nope.
He didn't, by the way, ask for anything for free. He said,
I unfortunately can't make it myself because I don't have the
knowledge, can
anyone of you do this for me?
When no mention of remuneration has been made, why do you assume none
will be forthcoming? Is this how you greet all prospective clients,
non-profit or otherwise, who approach you asking for help? Are we to
assume that this indicates your innate curiosity, your desire to gain
clients, your ability to negotiate, your willingness to devote yourself
to a good cause, or your capacity for politeness?
If you followed the thread, you would have read that the OP got his
panties in a knot when I posted him my rates for doing the job for him.
On the surface you appear defend your right to be paid for your work (as
though anyone had demanded otherwise!), but I would be very surprised if
the OP considered for a moment hiring any self-proclaimed professional
who replied so harshly to his query.
His loss.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On 11/11/06, John Nichel <[EMAIL PROTECTED]> wrote:
Paul Novitski wrote:
> At 11/10/2006 07:09 AM, tedd wrote:
>> Lastly, I think we all know that "non-profit" simply means that at the
>> end of the year you get to roll your profits over to the next year
>> without incurring taxes on the excess. Nothing more.
>>
>> Plus, there's no limit or requirements as to the amount/percentage you
>> pay yourself as compared to what amounts you apply to your "cause".
>> So, mentioning "non-profit" to me is like saying you're just another
>> scam -- and one, who's trolling for free php services.
>
<snip school lesson>
> In the meantime, I suppose it is emblematic of my own innocence that it
> always surprises me when someone asks a naive question and is answered
> by insults and jeers in a listserve composed of bright and knowledgeable
> people who have purportedly come together for mutual education.
The OP didn't ask a 'naive question' about why his register globals
isn't working or something like that...he asked us to do his work for
him. No 'mutual education' there.
> There
> may be no such thing as a stupid question, but the same cannot be said
> of the range of possible answers.
>
It's naive to think there are no stupid questions.
> Had the original poster known enough about our field to ask for
> recommendations of open source solutions, would he have been treated so
> roughly?
>
Nope.
> He didn't, by the way, ask for anything for free. He said,
>> I unfortunately can't make it myself because I don't have the
>> knowledge, can
>> anyone of you do this for me?
>
> When no mention of remuneration has been made, why do you assume none
> will be forthcoming? Is this how you greet all prospective clients,
> non-profit or otherwise, who approach you asking for help? Are we to
> assume that this indicates your innate curiosity, your desire to gain
> clients, your ability to negotiate, your willingness to devote yourself
> to a good cause, or your capacity for politeness?
>
If you followed the thread, you would have read that the OP got his
panties in a knot when I posted him my rates for doing the job for him.
> On the surface you appear defend your right to be paid for your work (as
> though anyone had demanded otherwise!), but I would be very surprised if
> the OP considered for a moment hiring any self-proclaimed professional
> who replied so harshly to his query.
>
His loss.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
Paul Novitski previously wrote:
My, aren't we grumpy! What big bad non-profit organization rained on
your parade?
I agree with Paul. No need to jump to conclusions when it would have been
just as easy for anyone on this list to ask a clarifying question of the OP.
David
--- End Message ---
--- Begin Message ---
On 10 Nov 2006, at 19:25 , Daevid Vincent wrote:
-----Original Message-----
From: Google Kreme [mailto:[EMAIL PROTECTED]
Is that *really* your name?! :)
Well, I TRIED to change it, but two guys in birks, tie-dyed t-shirts,
and macramé briefcases showed up with an injunction. :)
The trouble comes when you
need to time-out a session because someone never logged out
properly. That can be hairy.
Yeah, it's so hard to do that subtraction...
Figuring out when and how to time out a connection and what time
stamp to give to a timeout. After all, if minutes count and a
connection times out after 30 minutes do you set the logout time
then, or 30 minutes i the past?
That's the sort of hairy I meant. Not math. Math is never hairy.
Squiggly, yes, tentacle-ly, perhaps if there is calculus involved.
--
Gentlemen, you can't fight in here! This is the War Room.
--- End Message ---
--- Begin Message ---
Hi,
in my database PosgreSQL i have stored some date in the following format :
YYYY-MM-DD HH:MM:SS
this is a real TimeStamp without time zone field format.
Under PHP i would like to display this field as text with the following
format "DD.MM.YYYY"
How can i do that ?
i was thinking to do :
$date_from_pgsql;
echo date("d.m.Y",$date_from_pgsql);
but in this case it displays 01.01.1970 :-(
any idea ?
thanks.
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5
--- End Message ---
--- Begin Message ---
well, I could say RTFM, but I'll help you this time with a few links:
1. date() http://www.php.net/manual/en/function.date.php
2. strtotime() http://www.php.net/manual/en/function.strtotime.php
- tul
P.S. RTFM!
Alain Roger wrote:
Hi,
in my database PosgreSQL i have stored some date in the following format :
YYYY-MM-DD HH:MM:SS
this is a real TimeStamp without time zone field format.
Under PHP i would like to display this field as text with the following
format "DD.MM.YYYY"
How can i do that ?
i was thinking to do :
$date_from_pgsql;
echo date("d.m.Y",$date_from_pgsql);
but in this case it displays 01.01.1970 :-(
any idea ?
thanks.
--- End Message ---
--- Begin Message ---
Sorry to tell you that but that's why i ask here this question, because i
get everytime 01.01.1970..
RTFM i did !
On 11/11/06, M.Sokolewicz <[EMAIL PROTECTED]> wrote:
well, I could say RTFM, but I'll help you this time with a few links:
1. date() http://www.php.net/manual/en/function.date.php
2. strtotime() http://www.php.net/manual/en/function.strtotime.php
- tul
P.S. RTFM!
Alain Roger wrote:
> Hi,
>
> in my database PosgreSQL i have stored some date in the following format
:
> YYYY-MM-DD HH:MM:SS
>
> this is a real TimeStamp without time zone field format.
>
> Under PHP i would like to display this field as text with the following
> format "DD.MM.YYYY"
> How can i do that ?
>
> i was thinking to do :
> $date_from_pgsql;
> echo date("d.m.Y",$date_from_pgsql);
>
> but in this case it displays 01.01.1970 :-(
>
> any idea ?
> thanks.
>
--
Alain R.
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5
--- End Message ---
--- Begin Message ---
Dunno 'bout posgresql, but mysql can handle that situation quite easily with
DATE_FORMAT witch is what I use.
On Saturday 11 November 2006 16:59, Alain Roger wrote:
> Hi,
>
> in my database PosgreSQL i have stored some date in the following format :
> YYYY-MM-DD HH:MM:SS
>
> this is a real TimeStamp without time zone field format.
>
> Under PHP i would like to display this field as text with the following
> format "DD.MM.YYYY"
> How can i do that ?
>
> i was thinking to do :
> $date_from_pgsql;
> echo date("d.m.Y",$date_from_pgsql);
>
> but in this case it displays 01.01.1970 :-(
>
> any idea ?
> thanks.
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
And while on it...
Explode could do the trick to.
On Saturday 11 November 2006 16:59, Alain Roger wrote:
> Hi,
>
> in my database PosgreSQL i have stored some date in the following format :
> YYYY-MM-DD HH:MM:SS
>
> this is a real TimeStamp without time zone field format.
>
> Under PHP i would like to display this field as text with the following
> format "DD.MM.YYYY"
> How can i do that ?
>
> i was thinking to do :
> $date_from_pgsql;
> echo date("d.m.Y",$date_from_pgsql);
>
> but in this case it displays 01.01.1970 :-(
>
> any idea ?
> thanks.
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
You get that because your input is not a unix timestamp, it's a RFC 3339
formatted date-/timestamp. You first need to convert it (using ie.
strtotime, or explode() and feeding it to mktime()) to a unix timestamp
before you can feed the unix timestamp to the date() function.
Unix timestamps are integers. When feeding it into date() the STRING
(because '2006-11-11 01:02:03' is a STRING) will be converted to an
integer (value of 0) and interpreted as being a "valid" unix timestamp
(namely, 0). Unix Timestamp = 0 is January 1st, 1970. The start of the
UNIX epoch.
- tul
Alain Roger wrote:
Sorry to tell you that but that's why i ask here this question, because i
get everytime 01.01.1970..
RTFM i did !
On 11/11/06, M.Sokolewicz <[EMAIL PROTECTED]> wrote:
well, I could say RTFM, but I'll help you this time with a few links:
1. date() http://www.php.net/manual/en/function.date.php
2. strtotime() http://www.php.net/manual/en/function.strtotime.php
- tul
P.S. RTFM!
Alain Roger wrote:
> Hi,
>
> in my database PosgreSQL i have stored some date in the following
format
:
> YYYY-MM-DD HH:MM:SS
>
> this is a real TimeStamp without time zone field format.
>
> Under PHP i would like to display this field as text with the following
> format "DD.MM.YYYY"
> How can i do that ?
>
> i was thinking to do :
> $date_from_pgsql;
> echo date("d.m.Y",$date_from_pgsql);
>
> but in this case it displays 01.01.1970 :-(
>
> any idea ?
> thanks.
>
--- End Message ---
--- Begin Message ---
Gotta a question whose answer should be really obvious to me but, for
some reason, is just eluding me.
Which encodings can PHP handle for source files? I've been using
iso-8859-1 but what about utf-8?
Thanks,
C Drozdowski
--- End Message ---
--- Begin Message ---
On 11 Nov 2006, at 08:45 , C Drozdowski wrote:
Gotta a question whose answer should be really obvious to me but,
for some reason, is just eluding me.
Which encodings can PHP handle for source files? I've been using
iso-8859-1 but what about utf-8?
Try it?
5.0.6 seems to work fine with files from BBEdit saved as utf-8, but I
don't know that there are any non-ISO-8859-1 characters in the file,
so it's not a fair test.
--
Because you can't cotton to evil. No Sir. You have to smack evil on
the nose with the rolled-up newspaper of justice and say,'Bad evil.
bad BAD evil'"
--- End Message ---
--- Begin Message ---
UTF-8 works as long as you don't include a BOM (ByteOrderMark).
- tul
Google Kreme wrote:
On 11 Nov 2006, at 08:45 , C Drozdowski wrote:
Gotta a question whose answer should be really obvious to me but, for
some reason, is just eluding me.
Which encodings can PHP handle for source files? I've been using
iso-8859-1 but what about utf-8?
Try it?
5.0.6 seems to work fine with files from BBEdit saved as utf-8, but I
don't know that there are any non-ISO-8859-1 characters in the file, so
it's not a fair test.
--Because you can't cotton to evil. No Sir. You have to smack evil on
the nose with the rolled-up newspaper of justice and say,'Bad evil. bad
BAD evil'"
--- End Message ---
--- Begin Message ---
Hi,
So i solved my problem with Pager, MDB2...therefore thanks a lot to
everybody for your support.
I have nevertheless still 1 question to which i need help.
I would like to understand how MDB2_Driver_pgsql and MDB2 class are linked
to each other ?
i was thinking that the first one is derived from the MDB2 but it is not.
MDB2_Driver_pgsql has almost the same function that MDB2...
So i would like to understand how MDB2_Driver_pgsql works ?
Could you give me an example where :
- there we open a connection to a pgsql db
- where there is a query
- where we display the result of this query ?
because i have the feeling that every time we come back to MDB2::connect,
MDB2::fetchrow,...
thanks a lot,
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5
--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2006-11-10 14:08:22 +0100:
> Arpad Ray wrote:
> > ~
> > %5[bd] # the bracket
> > (?= # must be followed by
> > [^&]* # any characters except "&"
> > = # then a "="
> > )
> > ~eix
>
> thanks very much for the explanation!
Note that it's still a valid PCRE, and you can use this commented
version in place of the one Arpad posted earlier.
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
--- End Message ---
--- Begin Message ---
Hi everyone
I have a site with around 1000 new users everyday, and when every user
register my scripts will send a random password to his email.
the problem is that I got many users (specially hotmail users)
complain that they didn't receive any email (even in the hotmail junk
box).
I know that hotmail is filtering me as a possibly a spammer (because I
use a shared mail server) and there is nothing I can do about this.
now I stooped sending the password to the users email and I just make
the user chose his own password and he can login directly without the
need to check his email for the password.
but the problem now is that many users are registering with a fake emails :(
so I want to ask you if you have any solution for this ? how can I (in
someway) make my scripts check if the email is valid and exists email
before I register him without the need to send any password or
activation link to his email ?
do you have any idea ?
Thanks
--
echo "Hello World :)"
--- End Message ---
--- Begin Message ---
On 11 Nov 2006, at 12:38 , Ahmad Al-Twaijiry wrote:
I know that hotmail is filtering me as a possibly a spammer (because I
use a shared mail server) and there is nothing I can do about this.
Sure there is, move to a better neighborhood. And hotmail will not
block you for being on a shared server unless the others on the
shared server are spammers.
so I want to ask you if you have any solution for this ? how can I (in
someway) make my scripts check if the email is valid and exists email
before I register him without the need to send any password or
activation link to his email ?
Well, you can do what some mail servers do, and try to connect to the
MX for the domain and see if the username is accepted.
Or, if this is a hotmail specific issue, you can not allow hotmail
addresses.
--
Like the moment when the brakes lock/And you slide towards the big
truck/You stretch the frozen moments with your fear
--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2006-11-11 12:02:37 +0100:
> require_once 'Pear/MDB2.php';
> $dsn = 'pgsql://login:[EMAIL PROTECTED]';
>
> $mdb2 =& MDB2::connect($dsn);
> if (PEAR::isError($mdb2))
> {
> die($mdb2->getMessage());
> }
>
> $res =& $mdb2->query('SELECT * FROM articles');
if (PEAR::isError($res))
{
die($res->getMessage());
}
> while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))
> {
> echo $row['title'] . ', ' . $row['content'] . "\n";
> }
> $res->free();
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
--- End Message ---
--- Begin Message ---
Hi,
What is Zend Encoder efficency. After encoding shall we assume our code was
safe...
Or what should we expected
Regards
Sancar
--- End Message ---
--- Begin Message ---
Hi All,
I keep seeing the ? mark after many file names index.php?id=234.
So what I would like to know is how do you make them. I have heard that
they can make a programs life sampler when doing somethings with a database.
Thank you,
Thomas
--- End Message ---