php-general Digest 27 Mar 2008 08:57:50 -0000 Issue 5370
Topics (messages 272132 through 272153):
Re: PHP Book
272132 by: Wolf
272133 by: Daniel Brown
Re: optimilize web page loading
272134 by: Al
272140 by: Andrew Ballard
272149 by: Al
Quick email address check
272135 by: Al
272136 by: Eric Butera
272138 by: Richard Lynch
272141 by: Per Jessen
272142 by: Shawn McKenzie
272143 by: Al
272150 by: Manuel Lemos
272153 by: Tom Chubb
date CDT CST UTC
272137 by: Dee Ayy
272139 by: Richard Lynch
character encoding
272144 by: Bill
272145 by: Zoltán Németh
272146 by: Bill
272147 by: Zoltán Németh
272151 by: Manuel Lemos
APC & FastCGI != upload progress ?
272148 by: steve
272152 by: Jim Lucas
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 ---
---- alexus <[EMAIL PROTECTED]> wrote:
> What's the good PHP book to learn PHP?
>
> --
> http://alexus.org/
>
STFA -> this was gone over last week....
--- End Message ---
--- Begin Message ---
On Wed, Mar 26, 2008 at 1:01 PM, Wolf <[EMAIL PROTECTED]> wrote:
>
> ---- alexus <[EMAIL PROTECTED]> wrote:
> > What's the good PHP book to learn PHP?
> >
> > --
> > http://alexus.org/
> >
>
> STFA -> this was gone over last week....
STFU would be better. ;-P He was the same one who posted the
same question on 20 March.
--
</Daniel P. Brown>
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283
--- End Message ---
--- Begin Message ---
You are really asking an HTML question, if you think about it.
At the PHP level, either use output buffering or assemble all your html string as a variable and
then echo it. The goal is to compress the string into the minimum number of packets.
Alain Roger wrote:
Hi,
i would like to know if there is a way to know how long does a web page need
to be loaded into browser ?
this is interesting fact for me, as i will optimilize my PHP code in order
to reduce this time to minimum.
i was thinking to use some timestamp but as it will be in PHP, it mean that
it should take time from server and therefore it is not fully representative
from client browser time needed to load page :-(
purpose :
mywebpage.php -> 23 s before optimalization
mywebpage.php -> 12 s after optimalization
do you have any idea ?
--- End Message ---
--- Begin Message ---
On Wed, Mar 26, 2008 at 1:18 PM, Al <[EMAIL PROTECTED]> wrote:
> You are really asking an HTML question, if you think about it.
>
> At the PHP level, either use output buffering or assemble all your html
> string as a variable and
> then echo it. The goal is to compress the string into the minimum number of
> packets.
Yes, but do so smartly. Excessive string concatenation can slow things
down as well. On most pages you probably won't notice much difference,
but I have seen instances where the difference was painfully obvious.
Andrew
--- End Message ---
--- Begin Message ---
Depends on the server and it's load. I've strung together some rather large html strings and they
aways take far less time than the transient time on the internet. I used to use OB extensively until
one day I took the time to measure the difference. I don't recall the numbers; but, I do recall it
was not worth the slight extra trouble to use OB.
Now, I simple assemble by html strings with $report .= "foo"; And then echo $report at the end. It
also makes the code very easy to read and follow.
Andrew Ballard wrote:
On Wed, Mar 26, 2008 at 1:18 PM, Al <[EMAIL PROTECTED]> wrote:
You are really asking an HTML question, if you think about it.
At the PHP level, either use output buffering or assemble all your html string
as a variable and
then echo it. The goal is to compress the string into the minimum number of
packets.
Yes, but do so smartly. Excessive string concatenation can slow things
down as well. On most pages you probably won't notice much difference,
but I have seen instances where the difference was painfully obvious.
Andrew
--- End Message ---
--- Begin Message ---
I'm scripting a simple registry where the user can input their name and email
address.
I'd like to do a quick validity check on the email address they just inputted. I can check the
syntax, etc. but want check if the address exists. I realize that servers can take a long time to
bounce etc. I'll just deal with this separately.
Is there a better way than simply sending a test email to see if it bounces?
Thanks....
--- End Message ---
--- Begin Message ---
On Wed, Mar 26, 2008 at 1:28 PM, Al <[EMAIL PROTECTED]> wrote:
> I'm scripting a simple registry where the user can input their name and email
> address.
>
> I'd like to do a quick validity check on the email address they just
> inputted. I can check the
> syntax, etc. but want check if the address exists. I realize that servers
> can take a long time to
> bounce etc. I'll just deal with this separately.
>
> Is there a better way than simply sending a test email to see if it bounces?
>
> Thanks....
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
You could use PEAR Validate::email() with the hostname lookup. It
isn't exactly what you're asking for but I use it a lot with fairly
good success.
--- End Message ---
--- Begin Message ---
On Wed, March 26, 2008 12:28 pm, Al wrote:
> Is there a better way than simply sending a test email to see if it
> bounces?
Yes.
Force the user to click on a link to prove that they actually CHECK
that email address.
Just because it doesn't bounce doesn't mean it's a valid email address.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
Al wrote:
> I'm scripting a simple registry where the user can input their name
> and email address.
>
> I'd like to do a quick validity check on the email address they just
> inputted. I can check the syntax, etc. but want check if the address
> exists. I realize that servers can take a long time to bounce etc.
> I'll just deal with this separately.
> Is there a better way than simply sending a test email to see if it
> bounces?
Do an MX lookup on the domain, maybe attempt a brief connection to it.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
Al wrote:
> I'm scripting a simple registry where the user can input their name and
> email address.
>
> I'd like to do a quick validity check on the email address they just
> inputted. I can check the syntax, etc. but want check if the address
> exists. I realize that servers can take a long time to bounce etc. I'll
> just deal with this separately.
>
> Is there a better way than simply sending a test email to see if it
> bounces?
>
> Thanks....
There may be a SMTP class to help you do it, or you can do it manually
but here is a quick process. Look up the MX for thedomain.com. maybe
use checkdnsrr(). If not found then it is bad, if found connect and
issue the following SMTP commands:
MAIL FROM: [EMAIL PROTECTED]
250 ok
RCPT TO: [EMAIL PROTECTED]
550 sorry, no mailbox here by that name. (#5.7.17)
Optimally you want to see:
250 ok
You could also see:
553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
This would mean that there is an MX record for thedomain.com pointing to
this server but this server isn't configured to accept mail for this domain.
-Shawn
--- End Message ---
--- Begin Message ---
All good suggestions guys. Richard's has the advantage of solving the potential for a delay by the
user's email server.
I'll have the user submit and tell'm to wait while I check the email address for them. Solves
several problems.
Al wrote:
I'm scripting a simple registry where the user can input their name and
email address.
I'd like to do a quick validity check on the email address they just
inputted. I can check the syntax, etc. but want check if the address
exists. I realize that servers can take a long time to bounce etc. I'll
just deal with this separately.
Is there a better way than simply sending a test email to see if it
bounces?
Thanks....
--- End Message ---
--- Begin Message ---
Hello,
on 03/26/2008 02:28 PM Al said the following:
> I'm scripting a simple registry where the user can input their name and
> email address.
>
> I'd like to do a quick validity check on the email address they just
> inputted. I can check the syntax, etc. but want check if the address
> exists. I realize that servers can take a long time to bounce etc. I'll
> just deal with this separately.
>
> Is there a better way than simply sending a test email to see if it
> bounces?
You may want to try this E-mail validation PHP class that does just
that. It simulates an attempt to send a message to the SMTP server of
the e-mail domain. It does not finish to send the message. The message
could still bounce later, but at least you will still detect some
invalid addresses.
http://www.phpclasses.org/emailvalidation
--
Regards,
Manuel Lemos
PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Can anyone recommend anything that would be good to use on an existing
mailing list that is a few years old and didn't have any bounce handling?
On 27/03/2008, Manuel Lemos <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> on 03/26/2008 02:28 PM Al said the following:
> > I'm scripting a simple registry where the user can input their name and
> > email address.
> >
> > I'd like to do a quick validity check on the email address they just
> > inputted. I can check the syntax, etc. but want check if the address
> > exists. I realize that servers can take a long time to bounce etc. I'll
> > just deal with this separately.
> >
> > Is there a better way than simply sending a test email to see if it
> > bounces?
>
> You may want to try this E-mail validation PHP class that does just
> that. It simulates an attempt to send a message to the SMTP server of
> the e-mail domain. It does not finish to send the message. The message
> could still bounce later, but at least you will still detect some
> invalid addresses.
>
> http://www.phpclasses.org/emailvalidation
>
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP professionals looking for PHP jobs
> http://www.phpclasses.org/professionals/
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Today, we are in Central Daylight Time "CDT" in Dallas, Texas, USA -- yes?
"date" on:
mail server: Wed Mar 26 11:45:00 CDT 2008 (CORRECT)
web server: Wed Mar 26 11:45:00 CST 2008
Note CDT versus CST.
"date -u"
mail server: Wed Mar 26 16:45:00 UTC 2008 (CORRECT at 11:45 AM local
time [Central Daylight Time (CDT) is UTC minus 5 hours])
web server: Wed Mar 26 17:45:00 UTC 2008
>From a test CLI script and from the web page test script on the web server,
echo date("Y-m-d H:i:s");
returns "2008-03-26 11:45:00".
An application PHP script ran on the web server, uses date("Y-m-d
H:i:s") to generate a timestamp to put in the body of an email sent
with PHP mail().
I think the mail() command on the web server forwards to the actual
mail server (but I am not sure -- how do I verify this?).
An example email (only after we switched to daylight savings time on
3/10 and I'm sure our admin had to manually update the clock) shows
the email header as Mon, 10 Mar 2008 14:35:44 -0500
and in the email client without looking at raw source as Date: March
10, 2008 2:35:44 PM CDT, but the body of the email (which used PHP
date("Y-m-d H:i:s")) shows 2008-03-10 13:35:44.
Note 13 instead of 14.
I've asked the admin to make sure the web server reports CDT (I'm
still waiting), but it seems strange that date("Y-m-d H:i:s") from the
test scripts already shows the correct info before this change.
Any thoughts?
--- End Message ---
--- Begin Message ---
On Wed, March 26, 2008 12:50 pm, Dee Ayy wrote:
> Today, we are in Central Daylight Time "CDT" in Dallas, Texas, USA --
> yes?
>
> "date" on:
> mail server: Wed Mar 26 11:45:00 CDT 2008 (CORRECT)
> web server: Wed Mar 26 11:45:00 CST 2008
> Note CDT versus CST.
>
> "date -u"
> mail server: Wed Mar 26 16:45:00 UTC 2008 (CORRECT at 11:45 AM local
> time [Central Daylight Time (CDT) is UTC minus 5 hours])
> web server: Wed Mar 26 17:45:00 UTC 2008
>
> From a test CLI script and from the web page test script on the web
> server,
> echo date("Y-m-d H:i:s");
> returns "2008-03-26 11:45:00".
>
> An application PHP script ran on the web server, uses date("Y-m-d
> H:i:s") to generate a timestamp to put in the body of an email sent
> with PHP mail().
> I think the mail() command on the web server forwards to the actual
> mail server (but I am not sure -- how do I verify this?).
>
> An example email (only after we switched to daylight savings time on
> 3/10 and I'm sure our admin had to manually update the clock) shows
> the email header as Mon, 10 Mar 2008 14:35:44 -0500
> and in the email client without looking at raw source as Date: March
> 10, 2008 2:35:44 PM CDT, but the body of the email (which used PHP
> date("Y-m-d H:i:s")) shows 2008-03-10 13:35:44.
> Note 13 instead of 14.
>
> I've asked the admin to make sure the web server reports CDT (I'm
> still waiting), but it seems strange that date("Y-m-d H:i:s") from the
> test scripts already shows the correct info before this change.
>
> Any thoughts?
Because too many sysadmins were NOT updating their time zone database
with package/software updates as they should, the PHP Dev Team got
tired of bug reports et al about messed up dates, and they now include
a CURRENT copy of the timezone database built-in to PHP.
This, of course, violates the principle of having the source in one
place...
But it saves them a lot of headaches.
So PHP "knows" about the recent date-change of when daylight savings
kicks in, but since your sysadmin didn't update the time zone db on
the "web server" the OS does *not* know the correct time.
Daylight Savings Time must die!
Really, there cannot be any real "savings" here... The time wasted by
humanity to reset clocks and fix all the buglets from this stupid
clock-changing game MUST outweight any debatable "benefits"
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
Hi
LAMP
A column in a table has" Brébeuf " in it. (3rd caracter is é)
I use that table to send emails.
In the body that column shows " Brébeuf " in Windows Outlook.
How could I translate to the correct encoding so that accents show correctly
in Outlook ?
Thanks
--- End Message ---
--- Begin Message ---
2008. 03. 26, szerda keltezéssel 15.57-kor Bill ezt írta:
> Hi
>
> LAMP
>
> A column in a table has" Brbeuf " in it. (3rd caracter is é)
>
> I use that table to send emails.
>
> In the body that column shows " Brébeuf " in Windows Outlook.
>
> How could I translate to the correct encoding so that accents show correctly
> in Outlook ?
based on the encoding of your e-mail, my guess is that your data is in
some ISO-8859-1 encoding or something like that. of course, you should
verify that first.
so try to send those emails with that encoding, or what's much better,
use utf8 for both your data and your email. I think outlook can cope
with that, though I'm not sure ;)
greets,
Zoltán Németh
>
> Thanks
>
>
>
>
--- End Message ---
--- Begin Message ---
Hi Zoltan,
>> A column in a table has" Brbeuf " in it. (3rd caracter is é)
>> In the body that column shows " Brébeuf " in Windows Outlook.
>>
>> How could I translate to the correct encoding so that accents show
>> correctly
>> in Outlook ?
>
> based on the encoding of your e-mail, my guess is that your data is in
> some ISO-8859-1 encoding or something like that. of course, you should
> verify that first.
> so try to send those emails with that encoding, or what's much better,
> use utf8 for both your data and your email. I think outlook can cope
> with that, though I'm not sure ;)
The encoding can be set to utf-8 in the recieved email, what translates the
encoding but the sender's outlook window doesn't.
It's a site where you can ask the owner to upgrade your account limit by
clicking on a mailto link who writes most of the email body. The data used
is your record from a Mysql table.
When you use that link it opens a email window and the body of that message
isn't translated. So the people will see some garbage and may not send the
email.
If I try to change the encoding in the editing window of Outlook while this
garbaged email shows it doesn't work. I still see the garbage, yet my
outlook is set for utf-8 !!
Bill
--- End Message ---
--- Begin Message ---
2008. 03. 26, szerda keltezéssel 18.04-kor Bill ezt írta:
> Hi Zoltan,
>
> >> A column in a table has" Brbeuf " in it. (3rd caracter is é)
> >> In the body that column shows " Brbeuf " in Windows Outlook.
> >>
> >> How could I translate to the correct encoding so that accents show
> >> correctly
> >> in Outlook ?
> >
> > based on the encoding of your e-mail, my guess is that your data is in
> > some ISO-8859-1 encoding or something like that. of course, you should
> > verify that first.
> > so try to send those emails with that encoding, or what's much better,
> > use utf8 for both your data and your email. I think outlook can cope
> > with that, though I'm not sure ;)
>
> The encoding can be set to utf-8 in the recieved email, what translates the
> encoding but the sender's outlook window doesn't.
>
> It's a site where you can ask the owner to upgrade your account limit by
> clicking on a mailto link who writes most of the email body. The data used
> is your record from a Mysql table.
> When you use that link it opens a email window and the body of that message
> isn't translated. So the people will see some garbage and may not send the
> email.
>
> If I try to change the encoding in the editing window of Outlook while this
> garbaged email shows it doesn't work. I still see the garbage, yet my
> outlook is set for utf-8 !!
then change the collation of that table to utf8 and store all data in
utf8
greets
Zoltán Németh
>
> Bill
>
>
>
--- End Message ---
--- Begin Message ---
Hello,
on 03/26/2008 04:57 PM Bill said the following:
> A column in a table has" Brébeuf " in it. (3rd caracter is é)
>
> I use that table to send emails.
>
> In the body that column shows " Brébeuf " in Windows Outlook.
>
> How could I translate to the correct encoding so that accents show correctly
> in Outlook ?
You should not send 8 bit data in your messages without proper quoted
printable encoding. Also you need to specify the character set of text
you are sending.
You may want to try this MIME message composing and sending class that
supports quoted printable encoding with any character set either in the
text and in the message body.
Take a look test_email_message.php for single by character sets or even
the test_multibyte_message.php if you are not using multibyte character
sets.
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
We can get upload progress to work with the APC extension for PHP
5.2.x only on machines that are not using FastCGI. (Apache2.2 if it
matters).
Does anyone have a suggestion where to look?
Will it even be possible?
Thanks in advance,
-s
--- End Message ---
--- Begin Message ---
steve wrote:
We can get upload progress to work with the APC extension for PHP
5.2.x only on machines that are not using FastCGI. (Apache2.2 if it
matters).
Does anyone have a suggestion where to look?
Will it even be possible?
Thanks in advance,
-s
I built a work around. It requires you to run a PHP daemon. It handles
the uploads and passes the information off how ever you want. To a DB,
to the filesystem. Your choice. From that information, you can create
a progress meter.
I haven't fleshed out all the bugs, but it seems to work like I want it
too at least.
Jim Lucas
--- End Message ---