Re: [PHP] PHP broadcast mailer

2009-10-17 Thread Tommy Pham
- Original Message 
 From: Brian Hazelton bdh_2...@comcast.net
 To: php-general@lists.php.net
 Sent: Fri, October 16, 2009 10:41:03 PM
 Subject: [PHP] PHP broadcast mailer
 
 I am in charge of an email newsletter list and making sure it gets sent out 
 in 
 time. My problem is I have never done broadcast emailing and right now we 
 have 
 400 subscribers but want to build a system that can scale well regardless of 
 the 
 number of subscribers. Right now I use mysql to store the email and use 
 phpmailer in a loop to send an email to each of the emails in the db, it is 
 already slow with just 400(takes around 10 min (i think that's slow isnt 
 it?). 
 Has anyone built a broadcast email script and willing to help me?
 
 -- PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

Brian,

Sounds like you're sending 1 email address at the time.  I haven't build any 
yet but here some ideas.  If the subscribers are getting the exact same 
material, you could do batch fetch of several say 20 or more of email address 
(check with your SMTP server limit) and send them all via BCC.  You could knock 
that out easily.  If only some subscribers get the same content, you can then 
fetch the batch email addresses by filtering the content they're supposed to 
receive.

The speed at which your email goes out depends on the SMTP server (delay, 
queue, hardware, attachment size, etc).  Here's a pseudo code:

// fetch email addresses in batch size - within limit of SMTP server
// create email with addresses in BCC - loop through batch to create BCC
// send mail.
// update db for the sent addresses
// rinse and repeat until all emails are sent.

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP broadcast mailer

2009-10-17 Thread Tommy Pham
- Original Message 
 From: George Langley george.lang...@shaw.ca
 To: php-general@lists.php.net
 Sent: Fri, October 16, 2009 10:56:42 PM
 Subject: Re: [PHP] PHP broadcast mailer
 
 Hi there. At what point would it be beneficial to subscribe to a mass 
 mail 
 service such as Constant Contact or iContact, to avoid being blacklisted for 
 sending too many e-mails?
 
 George
 
 On 16-Oct-09, at 11:41 PM, Brian Hazelton wrote:
 
  I am in charge of an email newsletter list and making sure it gets sent out 
  in 
 time. My problem is I have never done broadcast emailing and right now we 
 have 
 400 subscribers but want to build a system that can scale well regardless of 
 the 
 number of subscribers. Right now I use mysql to store the email and use 
 phpmailer in a loop to send an email to each of the emails in the db, it is 
 already slow with just 400(takes around 10 min (i think that's slow isnt 
 it?). 
 Has anyone built a broadcast email script and willing to help me?
  
  --PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 --PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

Good point, George.  Forgot about that ... hehe.  My reply went out just as 
yours came in.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP broadcast mailer

2009-10-17 Thread Brian Hazelton
I thought about doing a batch email, is that an accepted practice, also 
how do I find my smtp server limit?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-17 Thread Tommy Pham
- Original Message 
 From: Dotan Cohen dotanco...@gmail.com
 To: php-general. php-general@lists.php.net
 Sent: Fri, October 16, 2009 7:13:41 PM
 Subject: [PHP] Sanitizing potential MySQL strings with no database connection
 
 How can I configure mysql_real_escape_string() to _not_ need a
 database connection in order to do it's work on a string. I understand
 that the function wants a database connection to determine which
 charset / encoding is in use, but in my case it will always be UTF-8.
 
 I have a file of reusable functions that I include in several scripts,
 one of them is a MySQL sanitation function, like this:
 function clean_mysql ($dirty) {
 $dirty=trim($dirty);
 $clean=mysql_real_escape_string($dirty);
 return $clean;
 }
 
 As different scripts reuse this code but connect to different
 databases, I need the function to work independently of the database
 connection. In other words, the include file cannot connect to the
 database but it still must perform the mysql_real_escape_string()
 function on UTF-8 data.
 
 Thanks in advance for any ideas.
 
 -- 
 Dotan Cohen
 
 http://what-is-what.com
 http://gibberish.co.il
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

Dotan,

I don't think so since the mysql_real_escape_string() requires a connection 
handler.  Why not use bind param?

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP broadcast mailer

2009-10-17 Thread Tommy Pham
- Original Message 
 From: Brian Hazelton bdh_2...@comcast.net
 To: php-general@lists.php.net
 Sent: Fri, October 16, 2009 11:11:06 PM
 Subject: Re: [PHP] PHP broadcast mailer
 
 I thought about doing a batch email, is that an accepted practice, also how 
 do I 
 find my smtp server limit?
 
 -- PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

Brian,

As George mentioned, beware of getting blacklisted.  Try to randomize the batch 
fetch so you're less likely to spam the receiving server(s).  As for getting 
the SMTP server limit, It's beyond the scope of this list.  You'll need to 
contact your server/network admin.  The method varies on SMTP server  
(SENDMAIL, MS SMTP/Exchange, etc).

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] all local sites stopped working ...

2009-10-17 Thread cr.vegelin
Hi All,

All my local PHP sites (http://127.0.0.1/... and http://localhost/...) worked 
until today.
Now all these local sites don't work anymore.
The only difference since yesterday is running 16 Windows Updates.

I checked C:\WINDOWS\system32\LogFiles\W3SVC1\... but no errors.
Can I set a php.ini setting to track down the problem ?
Or where else to look to solve this problem ?

Configuration: Windows XP SP3, PHP 5.2.0, IIS 5.1, MySQL 5.0.15 NT

Any help highly appreciated !!!

TIA, Cor

Re: [PHP] all local sites stopped working ...

2009-10-17 Thread Hanjie Xu
Is your Web Server started?

2009/10/17 cr.vege...@gmail.com

 Hi All,

 All my local PHP sites (http://127.0.0.1/... and http://localhost/...)
 worked until today.
 Now all these local sites don't work anymore.
 The only difference since yesterday is running 16 Windows Updates.

 I checked C:\WINDOWS\system32\LogFiles\W3SVC1\... but no errors.
 Can I set a php.ini setting to track down the problem ?
 Or where else to look to solve this problem ?

 Configuration: Windows XP SP3, PHP 5.2.0, IIS 5.1, MySQL 5.0.15 NT

 Any help highly appreciated !!!

 TIA, Cor




-- 
许汉杰


Re: [PHP] all local sites stopped working ...

2009-10-17 Thread Tommy Pham
- Original Message 
 From: cr.vege...@gmail.com cr.vege...@gmail.com
 To: Hanjie Xu iamj...@gmail.com
 Cc: php-general@lists.php.net
 Sent: Sat, October 17, 2009 12:34:49 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 Yes, my web server is started.
 I also did: Start - Run - IISRESET
 and it says: Internet services successfully stopped, etc.
 So I think that's not the problem.
 
   - Original Message - 
   From: Hanjie Xu 
   To: cr.vege...@gmail.com 
   Cc: php-general@lists.php.net 
   Sent: Saturday, October 17, 2009 9:29 AM
   Subject: Re: [PHP] all local sites stopped working ...
 
 
   Is your Web Server started?
 
 
   2009/10/17 
 
 Hi All,
 
 All my local PHP sites (http://127.0.0.1/... and http://localhost/...) 
 worked until today.
 Now all these local sites don't work anymore.
 The only difference since yesterday is running 16 Windows Updates.
 
 I checked C:\WINDOWS\system32\LogFiles\W3SVC1\... but no errors.
 Can I set a php.ini setting to track down the problem ?
 Or where else to look to solve this problem ?
 
 Configuration: Windows XP SP3, PHP 5.2.0, IIS 5.1, MySQL 5.0.15 NT
 
 Any help highly appreciated !!!
 
 TIA, Cor
   -- 
   许汉杰

* Did you restart your system after windows update?
* What's your ini settings regarding logging and start-up errors?  
* Did you check PHP error log?  
* Is PHP running as CGI/FCGI or ISAPI?  
* Have you tried a simple phpinfo(); to see if PHP is running as configured?

Regards,
Tommy


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread cr.vegelin
- Original Message - 
From: Tommy Pham tommy...@yahoo.com

To: php-general@lists.php.net
Sent: Saturday, October 17, 2009 10:19 AM
Subject: Re: [PHP] all local sites stopped working ...


- Original Message 

From: cr.vege...@gmail.com cr.vege...@gmail.com
To: Hanjie Xu iamj...@gmail.com
Cc: php-general@lists.php.net
Sent: Sat, October 17, 2009 12:34:49 AM
Subject: Re: [PHP] all local sites stopped working ...

Yes, my web server is started.
I also did: Start - Run - IISRESET
and it says: Internet services successfully stopped, etc.
So I think that's not the problem.

  - Original Message - 
  From: Hanjie Xu

  To: cr.vege...@gmail.com
  Cc: php-general@lists.php.net
  Sent: Saturday, October 17, 2009 9:29 AM
  Subject: Re: [PHP] all local sites stopped working ...


  Is your Web Server started?


  2009/10/17

Hi All,

All my local PHP sites (http://127.0.0.1/... and http://localhost/...)
worked until today.
Now all these local sites don't work anymore.
The only difference since yesterday is running 16 Windows Updates.

I checked C:\WINDOWS\system32\LogFiles\W3SVC1\... but no errors.
Can I set a php.ini setting to track down the problem ?
Or where else to look to solve this problem ?

Configuration: Windows XP SP3, PHP 5.2.0, IIS 5.1, MySQL 5.0.15 NT

Any help highly appreciated !!!

TIA, Cor
  -- 
  许汉杰


* Did you restart your system after windows update?
A: yes I did. After the restart this morning, the problem occurs.

* What's your ini settings regarding logging and start-up errors?
A: my php.ini has the following settings (not changed for a year):
   log_errors = On
   ; Log errors to syslog (Event Log on NT, not valid in Windows 95).
   ;error_log = syslog
   ; fastcgi.log = 0
   define_syslog_variables  = Off
   display_startup_errors = On
   session.auto_start = 0

* Did you check PHP error log?
A: The only log files I can find are:
   C:\WINDOWS\system32\LogFiles\W3SVC1\ex091017.log with:
#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2009-10-17 08:20:06
#Fields: time c-ip cs-method cs-uri-stem sc-status
08:20:06 127.0.0.1 GET /.../favicon.ico 404
08:20:06 127.0.0.1 GET /.../favicon.ico 404
   C:\WINDOWS\Temp\WGAErrLog.txt (dated 17/10/2009) with:
   a repeated string of D446F964-596-80004005
Where / how to look for a PHP specific log file ?

* Is PHP running as CGI/FCGI or ISAPI?
A: Don't know. Where can I see which mode it is running ?

* Have you tried a simple phpinfo(); to see if PHP is running as configured?
A: Yes I did, but http://127.0.0.1/.../phpinfo.php is not working because of 
the same problem.


Thanks for your time / effort.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread John Black

cr.vege...@gmail.com wrote:
Where / how to look for a PHP specific log file ?


Inside php.ini is the option to specify a separate PHP log file
here is the setting for my main system (Linux)

error_log = /home/user/php_log.txt

Remember to restart your webserver after adjusting php.ini

EDIT: Sry, for the double post, I did not use reply all.
--
John
Gerechtigkeit entspringt dem Neid; denn ihr oberster Grundsatz ist:
Allen das Gleiche.
[Walther Rathenau]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread Tommy Pham
 Original Message 
 From: cr.vege...@gmail.com cr.vege...@gmail.com
 To: Tommy Pham tommy...@yahoo.com; php-general@lists.php.net
 Sent: Sat, October 17, 2009 2:00:25 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 - Original Message - From: Tommy Pham 
 To: 
 Sent: Saturday, October 17, 2009 10:19 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 
 - Original Message 
  From: cr.vege...@gmail.com 
  To: Hanjie Xu 
  Cc: php-general@lists.php.net
  Sent: Sat, October 17, 2009 12:34:49 AM
  Subject: Re: [PHP] all local sites stopped working ...
  
  Yes, my web server is started.
  I also did: Start - Run - IISRESET
  and it says: Internet services successfully stopped, etc.
  So I think that's not the problem.
  
- Original Message -   From: Hanjie Xu
To: cr.vege...@gmail.com
Cc: php-general@lists.php.net
Sent: Saturday, October 17, 2009 9:29 AM
Subject: Re: [PHP] all local sites stopped working ...
  
  
Is your Web Server started?
  
  
2009/10/17
  
  Hi All,
  
  All my local PHP sites (http://127.0.0.1/... and http://localhost/...)
  worked until today.
  Now all these local sites don't work anymore.
  The only difference since yesterday is running 16 Windows Updates.
  
  I checked C:\WINDOWS\system32\LogFiles\W3SVC1\... but no errors.
  Can I set a php.ini setting to track down the problem ?
  Or where else to look to solve this problem ?
  
  Configuration: Windows XP SP3, PHP 5.2.0, IIS 5.1, MySQL 5.0.15 NT
  
  Any help highly appreciated !!!
  
  TIA, Cor
--   许汉杰
 
 * Did you restart your system after windows update?
 A: yes I did. After the restart this morning, the problem occurs.
 
 * What's your ini settings regarding logging and start-up errors?
 A: my php.ini has the following settings (not changed for a year):
log_errors = On
; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog
; fastcgi.log = 0
define_syslog_variables  = Off
display_startup_errors = On
session.auto_start = 0
 
 * Did you check PHP error log?
 A: The only log files I can find are:
C:\WINDOWS\system32\LogFiles\W3SVC1\ex091017.log with:
 #Software: Microsoft Internet Information Services 5.1
 #Version: 1.0
 #Date: 2009-10-17 08:20:06
 #Fields: time c-ip cs-method cs-uri-stem sc-status
 08:20:06 127.0.0.1 GET /.../favicon.ico 404
 08:20:06 127.0.0.1 GET /.../favicon.ico 404
C:\WINDOWS\Temp\WGAErrLog.txt (dated 17/10/2009) with:
a repeated string of D446F964-596-80004005
 Where / how to look for a PHP specific log file ?

See John Black's reply.  Forgot to ask you if there are any errors in System  
Application event logs.

 
 * Is PHP running as CGI/FCGI or ISAPI?
 A: Don't know. Where can I see which mode it is running ?

Did you setup PHP?  You don't remember how you configured it?  Is the PHP 
you're using an official distribution from PHP.net?  Or is it from someone else 
build it?

 
 * Have you tried a simple phpinfo(); to see if PHP is running as configured?
 A: Yes I did, but http://127.0.0.1/.../phpinfo.php is not working because of 
 the 
 same problem.
 
 Thanks for your time / effort.
 
 
 
 -- PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread John Black

cr.vege...@gmail.com wrote:

In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
then restarted the server with iisreset.exe
then started with IE: http://127.0.0.1/.../phpinfo.php
and after 10 minutes still Connecting / Waiting for .../phpinfo.php
and still no C:\Inetpub\wwwroot\PHPError.log created ...
Other suggestions ?
TIA, Cor


So it is not just .php files which will not work? If you have trouble 
with .html files as well then it almost sounds like a firewall issue 
since your connection hangs until timeout.


Try this to see if the webserver is accepting a connection:
telnet 127.0.0.1 80
Then type the two lines below, ending each one with the enter key (new line)
HEAD / HTTP/1.1
Host: 127.0.0.1
(hit enter once more)

And you should get an answer from your server, mine looks like this:
HTTP/1.1 200 OK
Date: Sat, 17 Oct 2009 09:49:16 GMT
Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 
SVN/1.6.5 PHP/5.3.0 with Suhosin-Patch

Content-Type: text/html;charset=ISO-8859-1
Connection closed by foreign host.


Does this work?

--
John
Je größer die Lüge, desto mehr Menschen folgen ihr.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread Tommy Pham
- Original Message 
 From: cr.vege...@gmail.com cr.vege...@gmail.com
 To: John Black s...@network-technologies.org
 Cc: Tommy Pham tommy...@yahoo.com; php-general@lists.php.net
 Sent: Sat, October 17, 2009 2:44:32 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 - Original Message - From: John Black 
 To: 
 Cc: Tommy Pham ; 
 Sent: Saturday, October 17, 2009 11:08 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 
  cr.vege...@gmail.com wrote:
  Where / how to look for a PHP specific log file ?
  
  Inside php.ini is the option to specify a separate PHP log file
  here is the setting for my main system (Linux)
  
  error_log = /home/user/php_log.txt
  
  Remember to restart your webserver after adjusting php.ini
  
  EDIT: Sry, for the double post, I did not use reply all.
  -- 
 
 Thanks John,
 
 In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
 then restarted the server with iisreset.exe
 then started with IE: http://127.0.0.1/.../phpinfo.php
 and after 10 minutes still Connecting / Waiting for .../phpinfo.php
 and still no C:\Inetpub\wwwroot\PHPError.log created ...
 

I see several problems.

1) It's bad practice to put the log file in C:\Inetpub\wwwroot where anyone can 
access it.  It's a major security issue.
2) It's been over 3 years since I dealt (hands on) with WinXP so here goes...  
IIS by default runs as NETWORK SERVICE.  That builtin account does not have 
create/modify rights on C:\Inetpub\wwwroot (by default).  Thus you wouldn't be 
able to see the file created.

 and after 10 minutes still Connecting / Waiting for .../phpinfo.php

This is a good sign as it seems IIS is trying to run PHP but having some 
problems.  Check the System  Application event logs for errors.  Change 
phperror.log file location, restart IIS, and try phpinfo.php again.

 Other suggestions ?
 TIA, Cor
 
 
 -- PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread cr.vegelin
- Original Message - 
From: John Black s...@network-technologies.org

To: cr.vege...@gmail.com
Cc: Tommy Pham tommy...@yahoo.com; php-general@lists.php.net
Sent: Saturday, October 17, 2009 11:08 AM
Subject: Re: [PHP] all local sites stopped working ...



cr.vege...@gmail.com wrote:
Where / how to look for a PHP specific log file ?


Inside php.ini is the option to specify a separate PHP log file
here is the setting for my main system (Linux)

error_log = /home/user/php_log.txt

Remember to restart your webserver after adjusting php.ini

EDIT: Sry, for the double post, I did not use reply all.
--


Thanks John,

In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
then restarted the server with iisreset.exe
then started with IE: http://127.0.0.1/.../phpinfo.php
and after 10 minutes still Connecting / Waiting for .../phpinfo.php
and still no C:\Inetpub\wwwroot\PHPError.log created ...

Other suggestions ?
TIA, Cor


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread cr.vegelin
- Original Message - 
From: Tommy Pham tommy...@yahoo.com

To: general php php-general@lists.php.net
Sent: Saturday, October 17, 2009 11:54 AM
Subject: Re: [PHP] all local sites stopped working ...



- Original Message 

From: cr.vege...@gmail.com cr.vege...@gmail.com
To: John Black s...@network-technologies.org
Cc: Tommy Pham tommy...@yahoo.com; php-general@lists.php.net
Sent: Sat, October 17, 2009 2:44:32 AM
Subject: Re: [PHP] all local sites stopped working ...

- Original Message - From: John Black
To:
Cc: Tommy Pham ;
Sent: Saturday, October 17, 2009 11:08 AM
Subject: Re: [PHP] all local sites stopped working ...


 cr.vege...@gmail.com wrote:
 Where / how to look for a PHP specific log file ?

 Inside php.ini is the option to specify a separate PHP log file
 here is the setting for my main system (Linux)

 error_log = /home/user/php_log.txt

 Remember to restart your webserver after adjusting php.ini

 EDIT: Sry, for the double post, I did not use reply all.
 -- 


Thanks John,

In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
then restarted the server with iisreset.exe
then started with IE: http://127.0.0.1/.../phpinfo.php
and after 10 minutes still Connecting / Waiting for .../phpinfo.php
and still no C:\Inetpub\wwwroot\PHPError.log created ...



I see several problems.

1) It's bad practice to put the log file in C:\Inetpub\wwwroot where 
anyone can access it.  It's a major security issue.
2) It's been over 3 years since I dealt (hands on) with WinXP so here 
goes...  IIS by default runs as NETWORK SERVICE.  That builtin account 
does not have create/modify rights on C:\Inetpub\wwwroot (by default). 
Thus you wouldn't be able to see the file created.



and after 10 minutes still Connecting / Waiting for .../phpinfo.php


This is a good sign as it seems IIS is trying to run PHP but having some 
problems.  Check the System  Application event logs for errors.  Change 
phperror.log file location, restart IIS, and try phpinfo.php again.



Hi Tommy,

In php.ini I changed to: error_log = C:\PHPerror.log
restarted the IIS server, then http://127.0.0.1/.../phpinfo.php
and after 5 minutes still Connecting / Waiting for .../phpinfo.php

Then I changed to: error_log = C:\tmp\PHPerror.log
restarted the IIS server, then http://127.0.0.1/.../phpinfo.php
and after 5 minutes still Connecting / Waiting for .../phpinfo.php

I will look for all local filenames containing the string log ...

Thanks, Cor



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How do YOU set default function/method params?

2009-10-17 Thread Carlos Medina

Jim Lucas schrieb:

Stephan Ebelt wrote:

On Mon, Oct 05, 2009 at 05:48:32PM -0700, Jim Lucas wrote:

Here is a problem that I have had for years now.  I have been trying to come up
with the perfect solution for this problem.  But, I have come down to two
different methods for solving it.

Here is the problem...

[...]


Now, we all have a function or method like this floating around somewhere.

My question is, how do YOU go about setting the required entries of the $headers
array() ?


[...]


END of examples...

Now, IMO, the last one is the simplest one and for me, I think it will be the
new way that I solve this type of problem.

But, my question that I put out to all of you is...

How would you solve this problem?

I have use this array_merge() approach mentioned in other posts for
quite some time but found that it introduced many bugs when fieldnames changed.
Ie. if the defaults come from a database table and I changed the schema it
caused undefined values during the merging and - worse - sometimes messed up the
inner workings of functions...

Then I heard of the value object approach somewhere and found that much more
solid. One would basically define a class where default values are represented
by its properties. Ie:

class vo_email extends vo {
public $to = '';
public $from = '';
public $subject = '(no subject)';
public $body = '';
...
}

the constructor can make sure that absolutly necessary values are required and
set properly - and could complain if something is not right. There could be
methods that add() or set() or change() things. These could also be inherited
from a very generic class vo so that this stuff is written once and applies
to all sorts of defaults in the program.
In my app the inherited constructor accepts arrays as parameter and assigns
their elements to the object properties and - by that - overwrites the default
settings. If elements do not match with the defined properties it will trigger
a very visible call trace.

A function like sendEmail() would then require a object of type vo_email as
parameter and would work with its properties internally and can rely on it as
the vo's constructor should have catched anything bad.

If additional logic for the input values is required, it can be added easily:

class dao_email extends vo_email {
...
public function encode_body() {
...
}

public function sanitize_mail_address() {

}
...
}



This is a very interesting approach.  How would you initialize the class?  Using
a Singleton Method, or a Globally available class variable?



sendEmail() would then require a dao_email object (dao=data access object) as
input.

stephan


TIA

Jim Lucas

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Hi,
i would use here two Classes to do this. A Class like Configuration
where the Mail Configuration is implemented. Configuration class load
the Configuration. There you can use Arrays like

$mailConf = array( 'to' = array('type' = 'string', 'required' = true ) );

( You can use the parse_ini_file() method to load the Configuration from
a ini file too )

The Configuration Class can be accessed with get and set methods (your
own or magic)

$conf = $conf-getMailConfiguration(); (return the Array )

And you can use the set method like this:
$conf-setMailConfiguration( Array( values ... ) )

Here you can send a exception if the needed or required items are not set

And set it this into the mail class with

$mail-setConfiguration( mailConfiguration $mailConf )

At this point you can get the values from Object $mailConf

may be helps

Regards

Carlos

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread Tommy Pham
- Original Message 
 From: cr.vege...@gmail.com cr.vege...@gmail.com
 To: Tommy Pham tommy...@yahoo.com; general php php-general@lists.php.net
 Sent: Sat, October 17, 2009 3:57:48 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 - Original Message - From: Tommy Pham 
 To: general php 
 Sent: Saturday, October 17, 2009 12:21 PM
 Subject: Re: [PHP] all local sites stopped working ...
 
 
  - Original Message 
  From: cr.vege...@gmail.com 
  To: John Black 
  Cc: php-general@lists.php.net
  Sent: Sat, October 17, 2009 3:17:22 AM
  Subject: Re: [PHP] all local sites stopped working ...
  
  - Original Message - From: John Black
  To:
  Cc:
  Sent: Saturday, October 17, 2009 11:53 AM
  Subject: Re: [PHP] all local sites stopped working ...
  
  
   cr.vege...@gmail.com wrote:
   In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
   then restarted the server with iisreset.exe
   then started with IE: http://127.0.0.1/.../phpinfo.php
   and after 10 minutes still Connecting / Waiting for .../phpinfo.php
   and still no C:\Inetpub\wwwroot\PHPError.log created ...
   Other suggestions ?
   TIA, Cor
  
   So it is not just .php files which will not work? If you have trouble  
 with
  .html files as well then it almost sounds like a firewall issue since your
  connection hangs until timeout.
  
   Try this to see if the webserver is accepting a connection:
   telnet 127.0.0.1 80
   Then type the two lines below, ending each one with the enter key (new  
 line)
   HEAD / HTTP/1.1
   Host: 127.0.0.1
   (hit enter once more)
  
   And you should get an answer from your server, mine looks like this:
   HTTP/1.1 200 OK
   Date: Sat, 17 Oct 2009 09:49:16 GMT
   Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2  
 SVN/1.6.5
  PHP/5.3.0 with Suhosin-Patch
   Content-Type: text/html;charset=ISO-8859-1
   Connection closed by foreign host.
  
  
   Does this work?
  
  John,
  Opening a *.HTM file from Windows Explorer goes well.
  
  It's not the same thing as using your web browser and try to view the *.HTM 
 file(s) through IIS.  Notice the protocol difference file:// vs http://.
  
  So the webserver is accepting a connection ...
  Nevertheless, where should I enter: telnet 127.0.0.1 80 ?
  From the OS prompt C:\  ?
  
  In a command prompt.  Directory path doesn't matter.
  
 From the C:\ prompt, I did:
 telnet 127.0.0.1 80[Enter]
 HEAD / HTTP/1.1[Enter]
 Host: 127.0.0.1 [Enter]
 [Enter]
 but all I get is a black window ...

Looks like John was right about the firewall.  What service pack did you have 
before your recent windows update?  You'll need to disable the firewall in 
services and try the telnet again.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread Tommy Pham
- Original Message 
 From: cr.vege...@gmail.com cr.vege...@gmail.com
 To: Tommy Pham tommy...@yahoo.com; general php php-general@lists.php.net
 Sent: Sat, October 17, 2009 4:00:24 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 - Original Message - From: Tommy Pham 
 To: general php 
 Sent: Saturday, October 17, 2009 11:54 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 
  - Original Message 
  From: cr.vege...@gmail.com 
  To: John Black 
  Cc: Tommy Pham ; php-general@lists.php.net
  Sent: Sat, October 17, 2009 2:44:32 AM
  Subject: Re: [PHP] all local sites stopped working ...
  
  - Original Message - From: John Black
  To:
  Cc: Tommy Pham ;
  Sent: Saturday, October 17, 2009 11:08 AM
  Subject: Re: [PHP] all local sites stopped working ...
  
  
   cr.vege...@gmail.com wrote:
   Where / how to look for a PHP specific log file ?
  
   Inside php.ini is the option to specify a separate PHP log file
   here is the setting for my main system (Linux)
  
   error_log = /home/user/php_log.txt
  
   Remember to restart your webserver after adjusting php.ini
  
   EDIT: Sry, for the double post, I did not use reply all.
   -- 
  Thanks John,
  
  In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
  then restarted the server with iisreset.exe
  then started with IE: http://127.0.0.1/.../phpinfo.php
  and after 10 minutes still Connecting / Waiting for .../phpinfo.php
  and still no C:\Inetpub\wwwroot\PHPError.log created ...
  
  
  I see several problems.
  
  1) It's bad practice to put the log file in C:\Inetpub\wwwroot where anyone 
 can access it.  It's a major security issue.
  2) It's been over 3 years since I dealt (hands on) with WinXP so here 
  goes...  
 IIS by default runs as NETWORK SERVICE.  That builtin account does not have 
 create/modify rights on C:\Inetpub\wwwroot (by default). Thus you wouldn't be 
 able to see the file created.
  
  and after 10 minutes still Connecting / Waiting for .../phpinfo.php
  
  This is a good sign as it seems IIS is trying to run PHP but having some 
 problems.  Check the System  Application event logs for errors.  Change 
 phperror.log file location, restart IIS, and try phpinfo.php again.
  
 Hi Tommy,
 
 In php.ini I changed to: error_log = C:\PHPerror.log
 restarted the IIS server, then http://127.0.0.1/.../phpinfo.php
 and after 5 minutes still Connecting / Waiting for .../phpinfo.php
 
 Then I changed to: error_log = C:\tmp\PHPerror.log
 restarted the IIS server, then http://127.0.0.1/.../phpinfo.php
 and after 5 minutes still Connecting / Waiting for .../phpinfo.php
 

You'll need to grant modify permission to NETWORK SERVICE for the folder 
C:\tmp.  Run the below command in the command prompt:

cacls /t /e /g NETWORK SERVICE:c c:\tmp

 I will look for all local filenames containing the string log ...
 
 Thanks, Cor
 
 
 
 -- PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread cr.vegelin
- Original Message - 
From: Tommy Pham tommy...@yahoo.com

To: general php php-general@lists.php.net
Sent: Saturday, October 17, 2009 1:02 PM
Subject: Re: [PHP] all local sites stopped working ...



- Original Message 

From: cr.vege...@gmail.com cr.vege...@gmail.com
To: Tommy Pham tommy...@yahoo.com; general php 
php-general@lists.php.net

Sent: Sat, October 17, 2009 3:57:48 AM
Subject: Re: [PHP] all local sites stopped working ...

- Original Message - From: Tommy Pham
To: general php
Sent: Saturday, October 17, 2009 12:21 PM
Subject: Re: [PHP] all local sites stopped working ...


 - Original Message 
 From: cr.vege...@gmail.com
 To: John Black
 Cc: php-general@lists.php.net
 Sent: Sat, October 17, 2009 3:17:22 AM
 Subject: Re: [PHP] all local sites stopped working ...

 - Original Message - From: John Black
 To:
 Cc:
 Sent: Saturday, October 17, 2009 11:53 AM
 Subject: Re: [PHP] all local sites stopped working ...


  cr.vege...@gmail.com wrote:
  In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
  then restarted the server with iisreset.exe
  then started with IE: http://127.0.0.1/.../phpinfo.php
  and after 10 minutes still Connecting / Waiting for 
  .../phpinfo.php

  and still no C:\Inetpub\wwwroot\PHPError.log created ...
  Other suggestions ?
  TIA, Cor
 
  So it is not just .php files which will not work? If you have 
  trouble 

with
 .html files as well then it almost sounds like a firewall issue since 
 your

 connection hangs until timeout.
 
  Try this to see if the webserver is accepting a connection:
  telnet 127.0.0.1 80
  Then type the two lines below, ending each one with the enter key 
  (new 

line)
  HEAD / HTTP/1.1
  Host: 127.0.0.1
  (hit enter once more)
 
  And you should get an answer from your server, mine looks like this:
  HTTP/1.1 200 OK
  Date: Sat, 17 Oct 2009 09:49:16 GMT
  Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 
SVN/1.6.5
 PHP/5.3.0 with Suhosin-Patch
  Content-Type: text/html;charset=ISO-8859-1
  Connection closed by foreign host.
 
 
  Does this work?

 John,
 Opening a *.HTM file from Windows Explorer goes well.

 It's not the same thing as using your web browser and try to view the 
 *.HTM

file(s) through IIS.  Notice the protocol difference file:// vs http://.

 So the webserver is accepting a connection ...
 Nevertheless, where should I enter: telnet 127.0.0.1 80 ?
 From the OS prompt C:\  ?

 In a command prompt.  Directory path doesn't matter.

From the C:\ prompt, I did:
telnet 127.0.0.1 80[Enter]
HEAD / HTTP/1.1[Enter]
Host: 127.0.0.1 [Enter]
[Enter]
but all I get is a black window ...


Looks like John was right about the firewall.  What service pack did you 
have before your recent windows update?  You'll need to disable the 
firewall in services and try the telnet again.




Tommy,
I did and do have Windows XP SP3. My firewall was turned off.
I turned it On, but http://127.0.0.1/.../phpinfo.php is not working.
I turned it Off, and http://127.0.0.1/.../phpinfo.php is not working
and telnet commands don't show anything ...
Any other idea ?
TIA, Cor 




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread Tommy Pham
- Original Message 
 From: cr.vege...@gmail.com cr.vege...@gmail.com
 To: Tommy Pham tommy...@yahoo.com; general php php-general@lists.php.net
 Sent: Sat, October 17, 2009 4:19:17 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 - Original Message - From: Tommy Pham 
 To: general php 
 Sent: Saturday, October 17, 2009 1:02 PM
 Subject: Re: [PHP] all local sites stopped working ...
 
 
  - Original Message 
  From: cr.vege...@gmail.com 
  To: Tommy Pham ; general php 
  Sent: Sat, October 17, 2009 3:57:48 AM
  Subject: Re: [PHP] all local sites stopped working ...
  
  - Original Message - From: Tommy Pham
  To: general php
  Sent: Saturday, October 17, 2009 12:21 PM
  Subject: Re: [PHP] all local sites stopped working ...
  
  
   - Original Message 
   From: cr.vege...@gmail.com
   To: John Black
   Cc: php-general@lists.php.net
   Sent: Sat, October 17, 2009 3:17:22 AM
   Subject: Re: [PHP] all local sites stopped working ...
  
   - Original Message - From: John Black
   To:
   Cc:
   Sent: Saturday, October 17, 2009 11:53 AM
   Subject: Re: [PHP] all local sites stopped working ...
  
  
cr.vege...@gmail.com wrote:
In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
then restarted the server with iisreset.exe
then started with IE: http://127.0.0.1/.../phpinfo.php
and after 10 minutes still Connecting / Waiting for   
 .../phpinfo.php
and still no C:\Inetpub\wwwroot\PHPError.log created ...
Other suggestions ?
TIA, Cor
   
So it is not just .php files which will not work? If you have   
 trouble 
  with
   .html files as well then it almost sounds like a firewall issue since 

 your
   connection hangs until timeout.
   
Try this to see if the webserver is accepting a connection:
telnet 127.0.0.1 80
Then type the two lines below, ending each one with the enter key  
 
 (new 
  line)
HEAD / HTTP/1.1
Host: 127.0.0.1
(hit enter once more)
   
And you should get an answer from your server, mine looks like this:
HTTP/1.1 200 OK
Date: Sat, 17 Oct 2009 09:49:16 GMT
Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 
  SVN/1.6.5
   PHP/5.3.0 with Suhosin-Patch
Content-Type: text/html;charset=ISO-8859-1
Connection closed by foreign host.
   
   
Does this work?
  
   John,
   Opening a *.HTM file from Windows Explorer goes well.
  
   It's not the same thing as using your web browser and try to view the  
 *.HTM
  file(s) through IIS.  Notice the protocol difference file:// vs http://.
  
   So the webserver is accepting a connection ...
   Nevertheless, where should I enter: telnet 127.0.0.1 80 ?
   From the OS prompt C:\  ?
  
   In a command prompt.  Directory path doesn't matter.
  
  From the C:\ prompt, I did:
  telnet 127.0.0.1 80[Enter]
  HEAD / HTTP/1.1[Enter]
  Host: 127.0.0.1 [Enter]
  [Enter]
  but all I get is a black window ...
  
  Looks like John was right about the firewall.  What service pack did you 
  have 
 before your recent windows update?  You'll need to disable the firewall in 
 services and try the telnet again.
  
 
 Tommy,
 I did and do have Windows XP SP3. My firewall was turned off.
 I turned it On, but http://127.0.0.1/.../phpinfo.php is not working.
 I turned it Off, and http://127.0.0.1/.../phpinfo.php is not working
 and telnet commands don't show anything ...
 Any other idea ?
 TIA, Cor 

1) Did you run that command for granting permission of NETWORK SERVICE for the 
c:\tmp?  and restart IIS?
2) run 'netstat -ano' without the single quote in the command prompt and show 
me what you see.
3) Use word pad and put in the below content and save it as itworks.htm (text 
type) in c:\inetpub\wwwroot

html
body
h1It works!/h1
/body/html

then use your web browser and go to http://localhost/itworks.htm

4) Did you check to see if there are any errors in the System and Application 
event logs?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread cr.vegelin
- Original Message - 
From: Tommy Pham tommy...@yahoo.com

To: general php php-general@lists.php.net
Sent: Saturday, October 17, 2009 1:08 PM
Subject: Re: [PHP] all local sites stopped working ...



- Original Message 

From: cr.vege...@gmail.com cr.vege...@gmail.com
To: Tommy Pham tommy...@yahoo.com; general php 
php-general@lists.php.net

Sent: Sat, October 17, 2009 4:00:24 AM
Subject: Re: [PHP] all local sites stopped working ...

- Original Message - From: Tommy Pham
To: general php
Sent: Saturday, October 17, 2009 11:54 AM
Subject: Re: [PHP] all local sites stopped working ...


 - Original Message 
 From: cr.vege...@gmail.com
 To: John Black
 Cc: Tommy Pham ; php-general@lists.php.net
 Sent: Sat, October 17, 2009 2:44:32 AM
 Subject: Re: [PHP] all local sites stopped working ...

 - Original Message - From: John Black
 To:
 Cc: Tommy Pham ;
 Sent: Saturday, October 17, 2009 11:08 AM
 Subject: Re: [PHP] all local sites stopped working ...


  cr.vege...@gmail.com wrote:
  Where / how to look for a PHP specific log file ?
 
  Inside php.ini is the option to specify a separate PHP log file
  here is the setting for my main system (Linux)
 
  error_log = /home/user/php_log.txt
 
  Remember to restart your webserver after adjusting php.ini
 
  EDIT: Sry, for the double post, I did not use reply all.
  -- 
 Thanks John,


 In php.ini I defined: error_log = C:\Inetpub\wwwroot\PHPError.log
 then restarted the server with iisreset.exe
 then started with IE: http://127.0.0.1/.../phpinfo.php
 and after 10 minutes still Connecting / Waiting for .../phpinfo.php
 and still no C:\Inetpub\wwwroot\PHPError.log created ...


 I see several problems.

 1) It's bad practice to put the log file in C:\Inetpub\wwwroot where 
 anyone

can access it.  It's a major security issue.
 2) It's been over 3 years since I dealt (hands on) with WinXP so here 
 goes...
IIS by default runs as NETWORK SERVICE.  That builtin account does not 
have
create/modify rights on C:\Inetpub\wwwroot (by default). Thus you 
wouldn't be

able to see the file created.

 and after 10 minutes still Connecting / Waiting for .../phpinfo.php

 This is a good sign as it seems IIS is trying to run PHP but having 
 some

problems.  Check the System  Application event logs for errors.  Change
phperror.log file location, restart IIS, and try phpinfo.php again.

Hi Tommy,

In php.ini I changed to: error_log = C:\PHPerror.log
restarted the IIS server, then http://127.0.0.1/.../phpinfo.php
and after 5 minutes still Connecting / Waiting for .../phpinfo.php

Then I changed to: error_log = C:\tmp\PHPerror.log
restarted the IIS server, then http://127.0.0.1/.../phpinfo.php
and after 5 minutes still Connecting / Waiting for .../phpinfo.php



You'll need to grant modify permission to NETWORK SERVICE for the folder 
C:\tmp.  Run the below command in the command prompt:


cacls /t /e /g NETWORK SERVICE:c c:\tmp


I will look for all local filenames containing the string log ...



Having in php.ini: error_log = C:\tmp\PHPerror.log
I gave from the command prompt:
cacls /t /e /g NETWORK SERVICE:c c:\tmp
then in IE: http://127.0.0.1/.../phpinfo.php
and still Connecting / Waiting for .../phpinfo.php

Apparently it is not a write permission problem.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] all local sites stopped working ...

2009-10-17 Thread cr.vegelin


- Original Message - 
From: Tommy Pham tommy...@yahoo.com

To: general php php-general@lists.php.net
Sent: Saturday, October 17, 2009 1:29 PM
Subject: Re: [PHP] all local sites stopped working ...



- Original Message 

From: cr.vege...@gmail.com cr.vege...@gmail.com
To: Tommy Pham tommy...@yahoo.com; general php 
php-general@lists.php.net

Sent: Sat, October 17, 2009 4:19:17 AM
Subject: Re: [PHP] all local sites stopped working ...

- Original Message - From: Tommy Pham
To: general php
Sent: Saturday, October 17, 2009 1:02 PM
Subject: Re: [PHP] all local sites stopped working ...


 - Original Message 
 From: cr.vege...@gmail.com
 To: Tommy Pham ; general php
 Sent: Sat, October 17, 2009 3:57:48 AM
 Subject: Re: [PHP] all local sites stopped working ...

 - Original Message - From: Tommy Pham
 To: general php
 Sent: Saturday, October 17, 2009 12:21 PM
 Subject: Re: [PHP] all local sites stopped working ...


  - Original Message 
  From: cr.vege...@gmail.com
  To: John Black
  Cc: php-general@lists.php.net
  Sent: Sat, October 17, 2009 3:17:22 AM
  Subject: Re: [PHP] all local sites stopped working ...
 
  - Original Message - From: John Black
  To:
  Cc:
  Sent: Saturday, October 17, 2009 11:53 AM
  Subject: Re: [PHP] all local sites stopped working ...
 
 
   cr.vege...@gmail.com wrote:
   In php.ini I defined: error_log = 
   C:\Inetpub\wwwroot\PHPError.log

   then restarted the server with iisreset.exe
   then started with IE: http://127.0.0.1/.../phpinfo.php
   and after 10 minutes still Connecting / Waiting for  
.../phpinfo.php
   and still no C:\Inetpub\wwwroot\PHPError.log created ...
   Other suggestions ?
   TIA, Cor
  
   So it is not just .php files which will not work? If you have  


trouble 
 with
  .html files as well then it almost sounds like a firewall issue 
  since 

your
  connection hangs until timeout.
  
   Try this to see if the webserver is accepting a connection:
   telnet 127.0.0.1 80
   Then type the two lines below, ending each one with the enter key 
 

(new 
 line)
   HEAD / HTTP/1.1
   Host: 127.0.0.1
   (hit enter once more)
  
   And you should get an answer from your server, mine looks like 
   this:

   HTTP/1.1 200 OK
   Date: Sat, 17 Oct 2009 09:49:16 GMT
   Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 


 SVN/1.6.5
  PHP/5.3.0 with Suhosin-Patch
   Content-Type: text/html;charset=ISO-8859-1
   Connection closed by foreign host.
  
  
   Does this work?
 
  John,
  Opening a *.HTM file from Windows Explorer goes well.
 
  It's not the same thing as using your web browser and try to view 
  the 

*.HTM
 file(s) through IIS.  Notice the protocol difference file:// vs 
 http://.

 
  So the webserver is accepting a connection ...
  Nevertheless, where should I enter: telnet 127.0.0.1 80 ?
  From the OS prompt C:\  ?
 
  In a command prompt.  Directory path doesn't matter.
 
 From the C:\ prompt, I did:
 telnet 127.0.0.1 80[Enter]
 HEAD / HTTP/1.1[Enter]
 Host: 127.0.0.1 [Enter]
 [Enter]
 but all I get is a black window ...

 Looks like John was right about the firewall.  What service pack did 
 you have
before your recent windows update?  You'll need to disable the firewall 
in

services and try the telnet again.


Tommy,
I did and do have Windows XP SP3. My firewall was turned off.
I turned it On, but http://127.0.0.1/.../phpinfo.php is not working.
I turned it Off, and http://127.0.0.1/.../phpinfo.php is not working
and telnet commands don't show anything ...
Any other idea ?
TIA, Cor




1) Did you run that command for granting permission of NETWORK SERVICE for 
the c:\tmp?  and restart IIS?

A: yes, I did restart IIS after every change in php.ini

2) run 'netstat -ano' without the single quote in the command prompt and 
show me what you see.

  Active Connections

 Proto  Local Address  Foreign AddressState   PID
 TCP0.0.0.0:80 0.0.0.0:0  LISTENING   1808
 TCP0.0.0.0:1350.0.0.0:0  LISTENING   848
 TCP0.0.0.0:4430.0.0.0:0  LISTENING   1808
 TCP0.0.0.0:4450.0.0.0:0  LISTENING   4
 TCP0.0.0.0:1950   0.0.0.0:0  LISTENING   1808
 TCP0.0.0.0:3306   0.0.0.0:0  LISTENING   1544
 TCP127.0.0.1:80   127.0.0.1:1952 CLOSE_WAIT  1808
 TCP127.0.0.1:80   127.0.0.1:1954 CLOSE_WAIT  1808
 TCP127.0.0.1:1025 0.0.0.0:0  LISTENING   1352
 TCP127.0.0.1:1029 0.0.0.0:0  LISTENING   2940
 TCP127.0.0.1:1056 0.0.0.0:0  LISTENING   3960
 TCP127.0.0.1:1288 127.0.0.1:1025 CLOSE_WAIT  908
 TCP127.0.0.1:5354 0.0.0.0:0  LISTENING   1116
 TCP192.168.1.33:139   0.0.0.0:0  LISTENING   

Re: [PHP] all local sites stopped working ...

2009-10-17 Thread Tommy Pham
From: cr.vege...@gmail.com cr.vege...@gmail.com
To: Tommy Pham tommy...@yahoo.com; general php php-general@lists.php.net
Sent: Sat, October 17, 2009 4:49:53 AM
Subject: Re: [PHP] all local sites stopped working ...


- Original Message - From: Tommy Pham tommy...@yahoo.com
To: general php php-general@lists.php.net
Sent: Saturday, October 17, 2009 1:29 PM
Subject: Re: [PHP] all local sites stopped working ...


 - Original Message 
 From: cr.vege...@gmail.com cr.vege...@gmail.com
 To: Tommy Pham tommy...@yahoo.com; general php php-general@lists.php.net
 Sent: Sat, October 17, 2009 4:19:17 AM
 Subject: Re: [PHP] all local sites stopped working ...
 
 - Original Message - From: Tommy Pham
 To: general php
 Sent: Saturday, October 17, 2009 1:02 PM
 Subject: Re: [PHP] all local sites stopped working ...
 
 
  - Original Message 
  From: cr.vege...@gmail.com
  To: Tommy Pham ; general php
  Sent: Sat, October 17, 2009 3:57:48 AM
  Subject: Re: [PHP] all local sites stopped working ...
 
  - Original Message - From: Tommy Pham
  To: general php
  Sent: Saturday, October 17, 2009 12:21 PM
  Subject: Re: [PHP] all local sites stopped working ...
 
 
   - Original Message 
   From: cr.vege...@gmail.com
   To: John Black
   Cc: php-general@lists.php.net
   Sent: Sat, October 17, 2009 3:17:22 AM
   Subject: Re: [PHP] all local sites stopped working ...
  
   - Original Message - From: John Black
   To:
   Cc:
   Sent: Saturday, October 17, 2009 11:53 AM
   Subject: Re: [PHP] all local sites stopped working ...
  
  
cr.vege...@gmail.com wrote:
In php.ini I defined: error_log =
C:\Inetpub\wwwroot\PHPError.log
then restarted the server with iisreset.exe
then started with IE: http://127.0.0.1/.../phpinfo.php
and after 10 minutes still Connecting / Waiting for  
 .../phpinfo.php
and still no C:\Inetpub\wwwroot\PHPError.log created ...
Other suggestions ?
TIA, Cor
   
So it is not just .php files which will not work? If you have   
   
 trouble 
  with
   .html files as well then it almost sounds like a firewall issue   
   since 
 your
   connection hangs until timeout.
   
Try this to see if the webserver is accepting a connection:
telnet 127.0.0.1 80
Then type the two lines below, ending each one with the enter key  

 (new 
  line)
HEAD / HTTP/1.1
Host: 127.0.0.1
(hit enter once more)
   
And you should get an answer from your server, mine looks like   
 this:
HTTP/1.1 200 OK
Date: Sat, 17 Oct 2009 09:49:16 GMT
Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2  
   
  SVN/1.6.5
   PHP/5.3.0 with Suhosin-Patch
Content-Type: text/html;charset=ISO-8859-1
Connection closed by foreign host.
   
   
Does this work?
  
   John,
   Opening a *.HTM file from Windows Explorer goes well.
  
   It's not the same thing as using your web browser and try to view   
   the 
 *.HTM
  file(s) through IIS.  Notice the protocol difference file:// vs  
  http://.
  
   So the webserver is accepting a connection ...
   Nevertheless, where should I enter: telnet 127.0.0.1 80 ?
   From the OS prompt C:\  ?
  
   In a command prompt.  Directory path doesn't matter.
  
  From the C:\ prompt, I did:
  telnet 127.0.0.1 80[Enter]
  HEAD / HTTP/1.1[Enter]
  Host: 127.0.0.1 [Enter]
  [Enter]
  but all I get is a black window ...
 
  Looks like John was right about the firewall.  What service pack did  you 
  have
 before your recent windows update?  You'll need to disable the firewall in
 services and try the telnet again.
 
 
 Tommy,
 I did and do have Windows XP SP3. My firewall was turned off.
 I turned it On, but http://127.0.0.1/.../phpinfo.php is not working.
 I turned it Off, and http://127.0.0.1/.../phpinfo.php is not working
 and telnet commands don't show anything ...
 Any other idea ?
 TIA, Cor
 

 1) Did you run that command for granting permission of NETWORK SERVICE for 
 the c:\tmp?  and restart IIS?
A: yes, I did restart IIS after every change in php.ini

 2) run 'netstat -ano' without the single quote in the command prompt and show 
 me what you see.
  Active Connections

Proto  Local Address  Foreign AddressState   PID
TCP0.0.0.0:80 0.0.0.0:0  LISTENING   1808
TCP0.0.0.0:1350.0.0.0:0  LISTENING   848
TCP0.0.0.0:4430.0.0.0:0  LISTENING   1808
TCP0.0.0.0:4450.0.0.0:0  LISTENING   4
TCP0.0.0.0:1950   0.0.0.0:0  LISTENING   1808
TCP0.0.0.0:3306   0.0.0.0:0  LISTENING   1544
TCP127.0.0.1:80   127.0.0.1:1952 CLOSE_WAIT  1808
TCP127.0.0.1:80   127.0.0.1:1954 CLOSE_WAIT  1808
TCP127.0.0.1:1025 0.0.0.0:0  LISTENING   1352
TCP127.0.0.1:1029 0.0.0.0:0   

Re: [PHP] all local sites stopped working ... [SOLVED]

2009-10-17 Thread cr.vegelin
- Original Message - 
From: Tommy Pham tommy...@yahoo.com

To: general php php-general@lists.php.net
Sent: Saturday, October 17, 2009 2:03 PM
Subject: Re: [PHP] all local sites stopped working ...



From: cr.vege...@gmail.com cr.vege...@gmail.com
To: Tommy Pham tommy...@yahoo.com; general php 
php-general@lists.php.net

Sent: Sat, October 17, 2009 4:49:53 AM
Subject: Re: [PHP] all local sites stopped working ...


- Original Message - From: Tommy Pham tommy...@yahoo.com
To: general php php-general@lists.php.net
Sent: Saturday, October 17, 2009 1:29 PM
Subject: Re: [PHP] all local sites stopped working ...



- Original Message 

From: cr.vege...@gmail.com cr.vege...@gmail.com
To: Tommy Pham tommy...@yahoo.com; general php 
php-general@lists.php.net

Sent: Sat, October 17, 2009 4:19:17 AM
Subject: Re: [PHP] all local sites stopped working ...

- Original Message - From: Tommy Pham
To: general php
Sent: Saturday, October 17, 2009 1:02 PM
Subject: Re: [PHP] all local sites stopped working ...


 - Original Message 
 From: cr.vege...@gmail.com
 To: Tommy Pham ; general php
 Sent: Sat, October 17, 2009 3:57:48 AM
 Subject: Re: [PHP] all local sites stopped working ...

 - Original Message - From: Tommy Pham
 To: general php
 Sent: Saturday, October 17, 2009 12:21 PM
 Subject: Re: [PHP] all local sites stopped working ...


  - Original Message 
  From: cr.vege...@gmail.com
  To: John Black
  Cc: php-general@lists.php.net
  Sent: Sat, October 17, 2009 3:17:22 AM
  Subject: Re: [PHP] all local sites stopped working ...
 
  - Original Message - From: John Black
  To:
  Cc:
  Sent: Saturday, October 17, 2009 11:53 AM
  Subject: Re: [PHP] all local sites stopped working ...
 
 
   cr.vege...@gmail.com wrote:
   In php.ini I defined: error_log =
   C:\Inetpub\wwwroot\PHPError.log

   then restarted the server with iisreset.exe
   then started with IE: http://127.0.0.1/.../phpinfo.php
   and after 10 minutes still Connecting / Waiting for  
.../phpinfo.php
   and still no C:\Inetpub\wwwroot\PHPError.log created ...
   Other suggestions ?
   TIA, Cor
  
   So it is not just .php files which will not work? If you have  


trouble 
 with
  .html files as well then it almost sounds like a firewall issue  
since 

your
  connection hangs until timeout.
  
   Try this to see if the webserver is accepting a connection:
   telnet 127.0.0.1 80
   Then type the two lines below, ending each one with the enter 
   key  

(new 
 line)
   HEAD / HTTP/1.1
   Host: 127.0.0.1
   (hit enter once more)
  
   And you should get an answer from your server, mine looks like 
   this:

   HTTP/1.1 200 OK
   Date: Sat, 17 Oct 2009 09:49:16 GMT
   Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 


 SVN/1.6.5
  PHP/5.3.0 with Suhosin-Patch
   Content-Type: text/html;charset=ISO-8859-1
   Connection closed by foreign host.
  
  
   Does this work?
 
  John,
  Opening a *.HTM file from Windows Explorer goes well.
 
  It's not the same thing as using your web browser and try to view 
 the 

*.HTM
 file(s) through IIS.  Notice the protocol difference file:// vs  
 http://.

 
  So the webserver is accepting a connection ...
  Nevertheless, where should I enter: telnet 127.0.0.1 80 ?
  From the OS prompt C:\  ?
 
  In a command prompt.  Directory path doesn't matter.
 
 From the C:\ prompt, I did:
 telnet 127.0.0.1 80[Enter]
 HEAD / HTTP/1.1[Enter]
 Host: 127.0.0.1 [Enter]
 [Enter]
 but all I get is a black window ...

 Looks like John was right about the firewall.  What service pack did  
 you have
before your recent windows update?  You'll need to disable the firewall 
in

services and try the telnet again.


Tommy,
I did and do have Windows XP SP3. My firewall was turned off.
I turned it On, but http://127.0.0.1/.../phpinfo.php is not working.
I turned it Off, and http://127.0.0.1/.../phpinfo.php is not working
and telnet commands don't show anything ...
Any other idea ?
TIA, Cor




1) Did you run that command for granting permission of NETWORK SERVICE 
for the c:\tmp?  and restart IIS?

A: yes, I did restart IIS after every change in php.ini

2) run 'netstat -ano' without the single quote in the command prompt and 
show me what you see.

 Active Connections

Proto  Local Address  Foreign AddressState   PID
TCP0.0.0.0:80 0.0.0.0:0  LISTENING   1808
TCP0.0.0.0:1350.0.0.0:0  LISTENING   848
TCP0.0.0.0:4430.0.0.0:0  LISTENING   1808
TCP0.0.0.0:4450.0.0.0:0  LISTENING   4
TCP0.0.0.0:1950   0.0.0.0:0  LISTENING   1808
TCP0.0.0.0:3306   0.0.0.0:0  LISTENING   1544
TCP127.0.0.1:80   127.0.0.1:1952 CLOSE_WAIT  1808
TCP127.0.0.1:80   127.0.0.1:1954 CLOSE_WAIT  1808
TCP   

Re: [PHP] How to pronounce PHP code over the phone?

2009-10-17 Thread tedd

At 4:15 AM +0200 10/17/09, Dotan Cohen wrote:

  This is a lot of posts to say either read it off character by

 character


If there is a jargon for operators such as - I'd like to know them.

Dotan Cohen



As I said previously, it's called an operator.

Of course you can call it whatever you want, such as arrow pointing 
right, pointy thing, or even blind evil grin. :-)


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] all local sites stopped working ... [SOLVED]

2009-10-17 Thread Marc Christopher Hall
0.0.0.0:0  LISTENING   4
 TCP0.0.0.0:1950   0.0.0.0:0  LISTENING   1808
 TCP0.0.0.0:3306   0.0.0.0:0  LISTENING   1544
 TCP127.0.0.1:80   127.0.0.1:1952 CLOSE_WAIT  1808
 TCP127.0.0.1:80   127.0.0.1:1954 CLOSE_WAIT  1808
 TCP127.0.0.1:1025 0.0.0.0:0  LISTENING   1352
 TCP127.0.0.1:1029 0.0.0.0:0  LISTENING   2940
 TCP127.0.0.1:1056 0.0.0.0:0  LISTENING   3960
 TCP127.0.0.1:1288 127.0.0.1:1025 CLOSE_WAIT  908
 TCP127.0.0.1:5354 0.0.0.0:0  LISTENING   1116
 TCP192.168.1.33:139   0.0.0.0:0  LISTENING   4
 UDP0.0.0.0:445*:*4
 UDP0.0.0.0:500*:*612
 UDP0.0.0.0:1026   *:*1116
 UDP0.0.0.0:3456   *:*1808
 UDP0.0.0.0:4500   *:*612
 UDP127.0.0.1:123  *:*916
 UDP127.0.0.1:1900 *:*1088
 UDP127.0.0.1:1909 *:*524
 UDP192.168.1.33:123   *:*916
 UDP192.168.1.33:137   *:*4
 UDP192.168.1.33:138   *:*4
 UDP192.168.1.33:1900  *:*1088
 UDP192.168.1.33:5353  *:*1116

 3) Use word pad and put in the below content and save it as itworks.htm 
 (text type) in c:\inetpub\wwwroot
 htmlbodyh1It works!/h1/body/html
 then use your web browser and go to http://localhost/itworks.htm
 A: That works okay !!

 4) Did you check to see if there are any errors in the System and 
 Application event logs?
 A: I found C:Windows\EventSystem.log (modified 30/09/2007)
   And C:Windows\WindowsUpdate.log with (modified 17/10/2009); I will check

 this one ...

 T You'll need to view the logs in the Event Viewer.

I restarted Windows, and guess what, the problem is gone.
Don't know what caused it, but it's working again.
Thanks again and have a nice weekend !!!

This sounds like you had a Windows Update applied and the system needed a
reboot to complete the patch. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


__ Information from ESET Smart Security, version of virus signature
database 4517 (20091017) __

The message was checked by ESET Smart Security.

http://www.eset.com


 

__ Information from ESET Smart Security, version of virus signature
database 4518 (20091017) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-17 Thread Dotan Cohen
 As for following a convention, just
 get the PHP terminology right,

That is what I was hoping to learn!

 or at least agree on your on
 bastardized terminology.


Because this may cause problems in the future.


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP broadcast mailer

2009-10-17 Thread Manuel Lemos
Hello,

on 10/17/2009 02:41 AM Brian Hazelton said the following:
 I am in charge of an email newsletter list and making sure it gets sent
 out in time. My problem is I have never done broadcast emailing and
 right now we have 400 subscribers but want to build a system that can
 scale well regardless of the number of subscribers. Right now I use
 mysql to store the email and use phpmailer in a loop to send an email to
 each of the emails in the db, it is already slow with just 400(takes
 around 10 min (i think that's slow isnt it?). Has anyone built a
 broadcast email script and willing to help me?

I use the MIME message mailer class which has optimizations specifically
for sending messages to many recipients. Take a look at the
test_personalized_bulk_mail.php example script.

Also keep in mind that for sending many messages, queueing messages in
an SMTP server is the slowest method of all. Read this article for more
details:

http://www.phpclasses.org/blog/package/14/post/1-Sending-messages-to-many-recipients-via-SMTP-in-PHP.html

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

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



Re: [PHP] PHP broadcast mailer

2009-10-17 Thread George Langley

On 16-Oct-09, at 11:56 PM, George Langley wrote:

	 At what point would it be beneficial to subscribe to a mass mail  
service such as Constant Contact or iContact, to avoid being  
blacklisted for sending too many e-mails?


On 17-Oct-09, at 12:01 AM, Brian Hazelton wrote:

I am sorry, but I am confused by your question. I thought that these  
companies worked with email providers to stay off the blacklists?

---
	They do - my point exactly. You may be fine for a small mass e-mail  
campaign (you mentioned 400 but growing). But if you do grow to the  
point of something getting triggered, and your URL or server, or  
worse, your ISP, gets black-listed, it may be hard to undo the damage.
	Am not sure what sort of limits any of these will allow before they  
start thinking you are spamming. Or how big you have to be to be  
considered trust-worthy to be allowed to send multiple e-mails. My  
main ISP (shaw.ca - 100s of 1,000s of customers) has gotten  
blacklisted a number of times, and suddenly friends would get e-mails  
to my @shaw address rejected, and had to start using one of my other  
addresses. A very tiny mail list I belonged to (40 people if even  
that) refused to send to all of its @shaw members, and I ended up re- 
registering under a different address because it happened enough times.
	The company I work for has internal clamps that get triggered if  
anyone tries to send to more than 50 addresses. They also run a  
separate mail server from their web site hosting. The site is hosted  
on Amazon's Cloud - a huge company, and yet every one of their IPs are  
black-listed:


http://searchcloudcomputing.techtarget.com/news/article/0,289142,sid201_gci1371369,00.html 



 The result was that even just a single e-mail to confirm  
registration to the member-only section of the site was getting  
flagged as spam by hotmail, or rejected outright by some other mail  
servers. Kinda hard to complete a registration if you never see the e- 
mail! We ended up relaying through our own mail server, which is fine  
for a one-at-a-time e-mail. But at over 50,000 customers, I have been  
strongly recommending the use of service if they do decide to start  
any mass e-mail newsletters or campaigns.
	Anyway, my point is - how important is this part of your business,  
and would it be worth the $ cost to use a service, rather than  
building, maintaining and potentially protecting your own? Just a  
thought.


George

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-17 Thread Tommy Pham
- Original Message 
 From: Dotan Cohen dotanco...@gmail.com
 To: Tommy Pham tommy...@yahoo.com
 Cc: php-general. php-general@lists.php.net
 Sent: Sat, October 17, 2009 10:59:52 AM
 Subject: Re: [PHP] Sanitizing potential MySQL strings with no database  
 connection
 
  I don't think so since the mysql_real_escape_string() requires a connection 
 handler.  Why not use bind param?
 
 
 Thanks. I just googled bind param but I am still a bit unclear as to
 what is going on.
 
 To be clear, I have a file of functions that I use in many scripts,
 lets call it functions.inc. One of the functions calls
 mysql_real_escape_string() but in order to do that it looks like I
 have to connect to a database. However, different scripts connect to
 different databases, and some do not connect to a database at all, so
 I cannot simple connect to a database from the functions.inc file as
 that will interfere with the database connections going on in the
 scripts including that file.
 
 -- 
 Dotan Cohen
 
 http://what-is-what.com
 http://gibberish.co.il
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

I assumed the reason you wanted to do escape the string so that you could 
perform DB operations.  In your select/insert/update class(es)/function(s), you 
could just use prepare statement and bind param.  Thus, no need to escape the 
string to protect against injection.  It's also faster if by chance you're 
doing several updates/inserts due to the nature of prepare statement.  You 
could use a call back function in case you have a varying size array of 
parameters, making your code more adaptable and somewhat smaller.  I generally 
prefer using prepare statement + bind param over escape string + query for 
speed and flexibility.

http://www.php.net/manual/en/mysqli.prepare.php
http://www.php.net/manual/en/mysqli-stmt.bind-param.php

have good examples.

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP broadcast mailer

2009-10-17 Thread Paul M Foster
On Sat, Oct 17, 2009 at 01:41:03AM -0400, Brian Hazelton wrote:

 I am in charge of an email newsletter list and making sure it gets sent
 out in time. My problem is I have never done broadcast emailing and
 right now we have 400 subscribers but want to build a system that can
 scale well regardless of the number of subscribers. Right now I use
 mysql to store the email and use phpmailer in a loop to send an email to
 each of the emails in the db, it is already slow with just 400(takes
 around 10 min (i think that's slow isnt it?). Has anyone built a
 broadcast email script and willing to help me?


Use PHPList. It's free.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php