php-general Digest 22 Dec 2002 02:30:00 -0000 Issue 1777

Topics (messages 129057 through 129088):

Re: Is there any method to filter the single quote fromastring?
        129057 by: Alexander Guevara
        129059 by: John W. Holmes
        129063 by: Alexander Guevara

Re: session life
        129058 by: John W. Holmes
        129070 by: Jason Sheets

Re: Disable session cookies
        129060 by: John W. Holmes

Adding to Apache access log from PHP
        129061 by: Geoff Caplan
        129087 by: Tom Rogers

pspell and html tags
        129062 by: Gil Disatnik
        129064 by: Gil Disatnik

running perl script via su
        129065 by: Larry Brown

Sorry
        129066 by: Gil Disatnik

No tshowing url in title bar....
        129067 by: Alexander Guevara
        129068 by: Larry Brown
        129071 by: Alexander Guevara

Problem with the List?
        129069 by: Larry Brown
        129074 by: Kyle Gibson

\Z characters
        129072 by: Dave J. Hala Jr.
        129073 by: Kyle Gibson

Sessions on a shared server
        129075 by: Beth Gore
        129085 by: Tom Rogers

Mass Mailing
        129076 by: Jonathan Chum
        129078 by: Gil Disatnik
        129080 by: Jonathan Chum
        129082 by: Chris Knipe
        129083 by: Mark Charette
        129086 by: Jonathan Chum

Loading modules not compiled in php
        129077 by: John Nichel
        129084 by: Tony Earnshaw

Re: text parser
        129079 by: Sean Burlington

tool to organize & design a project?
        129081 by: Chris Hayes

Forms and PHP variables
        129088 by: Beauford.2002

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 ---
WEll for example i got this:
 In a field called name i write a name with single quotes for example 'Alex'
and click submit... in the verify.php i store the data i filled in the
form.php that contains name, surnmane,etcetc...

so when i save my data to the db i use the addslashes($name) in this case...
and the i look up the database and i see that the valeu oin my db for name
is like i wrote it in this cas 'Alex'.. that's perfect.. but when i try to
retrieve the user data in another page for example change_user.php i want to
retrive the user name and show it in a text box but it doesnt show up.. and
i have this code:
<td><input type='text' name='name' value='".stripslashes($userName)."'
></td>

where userName i retrieved from the data base with a simple query..

so tell me what is wrong there!...Thanks!

"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
on 21/12/02 2:00 PM, Alexander Guevara ([EMAIL PROTECTED]) wrote:

> It works.. but when you retrieve the data from the database to a text box
it
> doesnt appear if it has the single quote ('), o tought it was cause i have
> the stripslashes but i delete stripslashes and it still doesnt appear in
the
> text box!

Huh?  I can't really understand what you're saying.

If you're adding stuff to a database, and getting an error, use
addslashes(), then on the way out of the database, you need to
stripslashes(). Easy.

If you don't get any errors, then magic quotes is probably enabled in your
php.ini file.


Justin




> "Justin French" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> don't filter the quotes... escape them with add_slashes()
>
> justin
>
> on 20/12/02 10:50 PM, ŞüYam ([EMAIL PROTECTED]) wrote:
>
>> as title that I'm getting a trouble on filtering the single quote '  ,
> since
>> there would be error when storing those string into MySQL, thus, i have
to
>> find the appropriate method to solve it, anybody can help please?
>> thx a lot
>>
>>
>
>


--- End Message ---
--- Begin Message ---
> WEll for example i got this:
>  In a field called name i write a name with single quotes for example
> 'Alex'
> and click submit... in the verify.php i store the data i filled in the
> form.php that contains name, surnmane,etcetc...
> 
> so when i save my data to the db i use the addslashes($name) in this
> case...
> and the i look up the database and i see that the valeu oin my db for
name
> is like i wrote it in this cas 'Alex'.. that's perfect.. but when i
try to
> retrieve the user data in another page for example change_user.php i
want
> to
> retrive the user name and show it in a text box but it doesnt show
up..
> and
> i have this code:
> <td><input type='text' name='name' value='".stripslashes($userName)."'
> ></td>

I thought this was already covered today? First, you don't need
stripslashes() on the data when you pull it from the database unless you
have magic_quotes_runtime enabled. Second, slashes mean nothing in HTML.
It doesn't recognize them as escape characters. The reason your data
isn't appearing is because it's coming out with a value like
value=''Alex'', which HTML sees as a value of '' and ignores the rest of
the data and an unrecognized attribute. 

Finally, what you need to do is use htmlentities() or htmlspecialchars()
on $userName before you place it between the quotes. This will give you
a value of value='&quote;Alex&quote;', which will display correctly with
HTML. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
Thanks.. i solved it but not with that solution.. ill give a try with it..
the way i solved was using ereg_replace before storing in the db and chnging
the ' and " with the html characters as you mention with htmlentities()

Thank you all for the responsees!.....
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
000101c2a903$4672cd40$7c02a8c0@coconut">news:000101c2a903$4672cd40$7c02a8c0@coconut...
> > WEll for example i got this:
> >  In a field called name i write a name with single quotes for example
> > 'Alex'
> > and click submit... in the verify.php i store the data i filled in the
> > form.php that contains name, surnmane,etcetc...
> >
> > so when i save my data to the db i use the addslashes($name) in this
> > case...
> > and the i look up the database and i see that the valeu oin my db for
> name
> > is like i wrote it in this cas 'Alex'.. that's perfect.. but when i
> try to
> > retrieve the user data in another page for example change_user.php i
> want
> > to
> > retrive the user name and show it in a text box but it doesnt show
> up..
> > and
> > i have this code:
> > <td><input type='text' name='name' value='".stripslashes($userName)."'
> > ></td>
>
> I thought this was already covered today? First, you don't need
> stripslashes() on the data when you pull it from the database unless you
> have magic_quotes_runtime enabled. Second, slashes mean nothing in HTML.
> It doesn't recognize them as escape characters. The reason your data
> isn't appearing is because it's coming out with a value like
> value=''Alex'', which HTML sees as a value of '' and ignores the rest of
> the data and an unrecognized attribute.
>
> Finally, what you need to do is use htmlentities() or htmlspecialchars()
> on $userName before you place it between the quotes. This will give you
> a value of value='&quote;Alex&quote;', which will display correctly with
> HTML.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>


--- End Message ---
--- Begin Message ---
> I'm setting a session with
> session_set_cookie_params (time()+6480000);
> so the cookie should last 70 days+ but the data wasn't
> returned.
> 
> from looking in the manual i see that session_cache_expire is used to
set
> or print the current value of the expire. Its set in php.ini by
default to
> 180 minutes.
> 
> So it seems that the garbage collector will clean up the session file
> after 180 mins or 10800 seconds which is less then i was expecting
after
> setting the cookie life.
> 
> do i need to set
> 
> session_set_cookie_params (time()+6480000);
> session_cache_expire (6480000);
> 
> for the data to still be available if the user returns during the
cookies
> life and is this on a per session basis.

Well, first of all, session cookies are deleted when the user closes
their browser. So unless the user is leaving the browser open for 70
days, this setting won't matter. 

session.gc_lifetime is the setting that controls the garbage cleanup. If
the session is inactive past that time limit, then the session file will
be deleted. 

Sessions aren't meant to be a "remember me" function. You'll need to use
regular cookies that persist after the browser is closed for that. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
On Sat, 2002-12-21 at 08:03, John W. Holmes wrote:
> > I'm setting a session with
> > session_set_cookie_params (time()+6480000);
> > so the cookie should last 70 days+ but the data wasn't
> > returned.
> > 
> > from looking in the manual i see that session_cache_expire is used to
> set
> > or print the current value of the expire. Its set in php.ini by
> default to
> > 180 minutes.
> > 
> > So it seems that the garbage collector will clean up the session file
> > after 180 mins or 10800 seconds which is less then i was expecting
> after
> > setting the cookie life.
> > 
> > do i need to set
> > 
> > session_set_cookie_params (time()+6480000);
> > session_cache_expire (6480000);
> > 
> > for the data to still be available if the user returns during the
> cookies
> > life and is this on a per session basis.
> 
> Well, first of all, session cookies are deleted when the user closes
> their browser. So unless the user is leaving the browser open for 70
> days, this setting won't matter. 

This is incorrect, by default session cookies have a lifetime of 0 which
means they are peresistent until the browser is closed.  If you set the
ini directive session.cookie_lifetime to something other than 0, for
example 86400 then the session will for the number of seconds specified,
in this case 1 day, even after the browser has been closed.

> 
> session.gc_lifetime is the setting that controls the garbage cleanup. If
> the session is inactive past that time limit, then the session file will
> be deleted. 
> 
> Sessions aren't meant to be a "remember me" function. You'll need to use
> regular cookies that persist after the browser is closed for that. 

> 
> ---John W. Holmes...
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
>  I'm guessing then that it's possible to use only server side sessions
> and use trans_id then if you need to store values throughout a site?

Well, session are always server side, but, yes, basically. PHP must be
compiled correctly so you can enable trans_sid.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
Hi folks,

I would like to add a few fields to a custom Apache access log format
and populate the values from mod_php.

As a mechanism, I was thinking of using the PHP function putenv( ) to
set environmental variables. I am assuming that these would be in the
same request namespace used by Apache?

Then in Apache, I would use the mod_log_config directive documented
as:

"%...{FOOBAR}e:  The contents of the environment variable FOOBAR"

to place the value of the variables in the log string.

Is this a sensible approach? I only have a live server to test on, so
I'd like to be sure I am on the right track b

-- 

Geoff Caplan
Advantae Ltd

mailto:[EMAIL PROTECTED]
http://www.advantae.com

--- End Message ---
--- Begin Message ---
Hi,

Wednesday, December 4, 2002, 12:13:22 AM, you wrote:
GC> Hi folks,

GC> I would like to add a few fields to a custom Apache access log format
GC> and populate the values from mod_php.

GC> As a mechanism, I was thinking of using the PHP function putenv( ) to
GC> set environmental variables. I am assuming that these would be in the
GC> same request namespace used by Apache?

GC> Then in Apache, I would use the mod_log_config directive documented
GC> as:

GC> "%...{FOOBAR}e:  The contents of the environment variable FOOBAR"

GC> to place the value of the variables in the log string.

GC> Is this a sensible approach? I only have a live server to test on, so
GC> I'd like to be sure I am on the right track b

GC> -- 

GC> Geoff Caplan
GC> Advantae Ltd

GC> mailto:[EMAIL PROTECTED]
GC> http://www.advantae.com

You could use this

<?php apache_note('PHP_TITLE','Home Page')?>

Then the log formatter would be .....\"%{PHP_TITLE}n\"...

-- 
regards,
Tom

--- End Message ---
--- Begin Message --- Hello,
I am looking for a way to tell pspell_check() to ignore html tags, I tried adding a few html tags using pspell_add_to_session() but it said it won't accept words starting with "<"...

Any idea?

Thanks.

--- End Message ---
--- Begin Message --- Hello,
I am looking for a way to tell pspell_check() to ignore html tags, I tried adding a few html tags using pspell_add_to_session() but it said it won't accept words starting with "<"...

Any ideas?

Thanks.

--- End Message ---
--- Begin Message ---
I am getting a lot of information about running the web server as root and
the associated problems and so on as I've been looking for a quick solution.
I have a perl script that is run by cron that executes sequence of events
via sftp.  The sftp client has no option that I know of to denote a
different user than the one executing the command using rsa so I set up a
user with the same name as the user needed to log into the remote server and
run it under cron for that user.  I want to place a simple button on my web
site that executes that script but it has to be run by that user.  Since
there will be no interface on the site for which commands can be sent using
this page I'm not too worried about any kind of exploit.  I also don't want
to have to go through the process of installing and learning the methods of
use for apache suExec.  I also don't want the entire web server running as
this user.  Does anyone know of a quick and dirty solution for this

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388


--- End Message ---
--- Begin Message ---
Hey there,
Sorry for sending my question twice, I got a strange error saying:
--------------------
Sorry. Your message could not be delivered to:

php-list,emc (The name was not found at the remote site. Check that the
name has been entered correctly.)
----------------------
So I assumed it didn't make it (so I registered to the list and tried again...)


--- End Message ---
--- Begin Message ---
Dont know if this concerns to php genral.. but i want to know how can i do
for preventing showing the url in the title bar of the browser.. for example
i click a link that goes to a php page called verify.php and in the windows
browser title bar is show this.. http://www.server.com/verify.php

It is posssible to not show the url..  i mena show a title i dont know.

Thanks!


--- End Message ---
--- Begin Message ---
Before the <body> tag you have the <head> </head> tags.  Place <title>Title
of the page</title> and it will show up on the title bar instead of the url.
If you want to get rid of the address bar of the browser window, let me know
and I can post the javascript for creating that window.

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-----Original Message-----
From: Alexander Guevara [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 21, 2002 12:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] No tshowing url in title bar....

Dont know if this concerns to php genral.. but i want to know how can i do
for preventing showing the url in the title bar of the browser.. for example
i click a link that goes to a php page called verify.php and in the windows
browser title bar is show this.. http://www.server.com/verify.php

It is posssible to not show the url..  i mena show a title i dont know.

Thanks!



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


--- End Message ---
--- Begin Message ---
ill try it.. about the address bar icoulc be very cool for doing it!
"Larry Brown" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Before the <body> tag you have the <head> </head> tags.  Place
<title>Title
> of the page</title> and it will show up on the title bar instead of the
url.
> If you want to get rid of the address bar of the browser window, let me
know
> and I can post the javascript for creating that window.
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> -----Original Message-----
> From: Alexander Guevara [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, December 21, 2002 12:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] No tshowing url in title bar....
>
> Dont know if this concerns to php genral.. but i want to know how can i do
> for preventing showing the url in the title bar of the browser.. for
example
> i click a link that goes to a php page called verify.php and in the
windows
> browser title bar is show this.. http://www.server.com/verify.php
>
> It is posssible to not show the url..  i mena show a title i dont know.
>
> Thanks!
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Are my posts getting through?  They appear to come back on the list but I
also get this response...

Sorry. Your message could not be delivered to:

php-list,emc (The name was not found at the remote site. Check that the
name has been entered correctly.)


Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388



--- End Message ---
--- Begin Message ---
Are my posts getting through?  They appear to come back on the list but I
also get this response...
I see them, so I suppose the list has received them.

I got that same error yesterday. Hmmm. :\

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/

--- End Message ---
--- Begin Message ---
I've got a bunch of fields in a mysql database that have a \Z character
in them.  I want to search a field for \Z and if it contains that
character, make the field blank.  

In running php 4.x on RH 8.0

Here is the code:

        $connection = db_connect("Could not connect  DB");
        $SQL="SELECT id,PVLN from lhpl_side WHERE PVLN =\"\\Z\" ";
        $result= mysql_query($SQL,$connection) or die (mysql_error());
        $num = mysql_numrows($result);

This query returns 0 rows. (no error messages either) But when I execute
the query: 
SELECT id,PVLN from lhpl_side WHERE PVLN ="\Z"; from the mysql command
prompt it works properly. (returns a 172 rows)

I realize that I need to do an update to change the value in field.
However, right now I just need to get a query that works to the db.

Anyone got any ideas?
 

:) Dave
-- 

"...Unix, MS-DOS and Windows NT (also known as the Good, the Bad, and
the Ugly)"

OSIS
Dave J. Hala Jr.
641.485.1606


--- End Message ---
--- Begin Message ---
        $connection = db_connect("Could not connect  DB");
        $SQL="SELECT id,PVLN from lhpl_side WHERE PVLN =\"\\Z\" ";
        $result= mysql_query($SQL,$connection) or die (mysql_error());
        $num = mysql_numrows($result);
Not too sure on this, but it might solve the problem. Use single quotes instead...

$connection = db_connect("Could not connect DB");
$SQL="SELECT id,PVLN from lhpl_side WHERE PVLN ='\Z'";
$result= mysql_query($SQL,$connection) or die (mysql_error());
$num = mysql_numrows($result);


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/

--- End Message ---
--- Begin Message --- Hi,

I've finally got a host and I want to transfer my existing website - I have managed to copy and upload my database (wow that was easy.. had been dreading it!!!!) but now I'm worried that my sessions aren't going to work correctly, as I'm sure there are probably other users with "userID" variables being set and things like that - with it being a shared server, it's obviously a little different to a dedicated one.

Would it be enough to simply set a variable like "mysiteidentifier" and only bother checking for other session variables if that's set? Or, do I need to override the server's session variables each time I start sessions in every page that uses them? I imagine the former would mean that other sites would be able to potentially get my session variables, which isn't great.

Probably very simple, so sorry if it's incredibly dull!

Thanks,

--
Beth Gore
http://bethanoia.dyndns.org



--- End Message ---
--- Begin Message ---
Hi,

Sunday, December 22, 2002, 7:24:41 AM, you wrote:
BG> Hi,

BG> I've finally got a host and I want to transfer my existing website - I 
BG> have managed to copy and upload my database (wow that was easy.. had 
BG> been dreading it!!!!) but now I'm worried that my sessions aren't going 
BG>  to work correctly, as I'm sure there are probably other users with 
BG> "userID" variables being set and things like that - with it being a 
BG> shared server, it's obviously a little different to a dedicated one.

BG> Would it be enough to simply set a variable like "mysiteidentifier" and 
BG> only bother checking for other session variables if that's set? Or, do I 
BG> need to override the server's session variables each time I start 
BG> sessions in every page that uses them? I imagine the former would mean 
BG> that other sites would be able to potentially get my session variables, 
BG> which isn't great.

BG> Probably very simple, so sorry if it's incredibly dull!

BG> Thanks,

BG> --
BG> Beth Gore
BG> http://bethanoia.dyndns.org

Session data is kept seperate for each individual access so they will never get
mixed up no matter what you call your session variables.

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
An upcoming project I'm working and spec'ing out is a mass mailing
application. Initially, I was looking at Mailman which was written in Python
since it looks like it handles delivering emails efficiently without killing
the server. We have 1 client able to send 110,000 emails at 6.5K avg per
week on PIII 800 with 128 MB RAM using Mailman. The inteface however is very
bad and we'd like to develop other features like text ads, tracking,
templates, etc. This would require writing a wrapper around Mailman in PHP.
I was considering of writing the mass mailing application in PHP instead
though.

If anyone has eperience writing such applications with this amount of
emails, I'd like to know what you've done.

I'm thinking of coding the front end in PHP that will put the email into a
queue table that will force a command line PHP script listening on a
particular port to scan the database for this new task in queue. Once it
picks up the task, the timeout for this application to run will be set to
infinite. It'll establish a SMTP socket either to a really beefed up mailing
list server or the localhost SMTP server to begin blasting out these emails.

>From what I understand, it's better to blast emails via an open socket
connection to SMTP rather than looping through Sendmail. Is this the right
thing todo?

I've also heard that PHP is not good for writing mailing lists application,
but Mailman is written in Python and it's able to send thousands of email
just fine. Any thoughts on this?


--- End Message ---
--- Begin Message --- I have written a few useful php functions that put the email addresses on one file and the message on another file.
I have a crontabbed script that runs every min looking for these files and then using qmail-inject to send them (sendmail is bad, replace it ;))
It's very good for sending a few thousands emails every time as the php script execution finishes in a second and you don't have to deal with max execution time and everything.

If you wish I could send you the scripts.

At 05:10 PM 12/21/2002 -0500, you wrote:
An upcoming project I'm working and spec'ing out is a mass mailing
application. Initially, I was looking at Mailman which was written in Python
since it looks like it handles delivering emails efficiently without killing
the server. We have 1 client able to send 110,000 emails at 6.5K avg per
week on PIII 800 with 128 MB RAM using Mailman. The inteface however is very
bad and we'd like to develop other features like text ads, tracking,
templates, etc. This would require writing a wrapper around Mailman in PHP.
I was considering of writing the mass mailing application in PHP instead
though.

If anyone has eperience writing such applications with this amount of
emails, I'd like to know what you've done.

I'm thinking of coding the front end in PHP that will put the email into a
queue table that will force a command line PHP script listening on a
particular port to scan the database for this new task in queue. Once it
picks up the task, the timeout for this application to run will be set to
infinite. It'll establish a SMTP socket either to a really beefed up mailing
list server or the localhost SMTP server to begin blasting out these emails.

From what I understand, it's better to blast emails via an open socket
connection to SMTP rather than looping through Sendmail. Is this the right
thing todo?

I've also heard that PHP is not good for writing mailing lists application,
but Mailman is written in Python and it's able to send thousands of email
just fine. Any thoughts on this?



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

Regards

Gil Disatnik
UNIX system/security administrator.

GibsonLP@EFnet
http://www.disatnik.com
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
"Windows NT has detected mouse movement, you MUST restart
your computer before the new settings will take effect, [ OK ]"
--------------------------------------------------------------------
Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit operating
system, written for a 4 bit processor by a 2 bit company which can
not stand 1 bit of competition.
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
--- End Message ---
--- Begin Message ---
Yea, I'd like to see that. How many people are on your lists if you
don't mind me asking?

I also came across this evening, http://phpmailer.sourceforge.net and
http://www.octeth.com/index.php uses this class on it's backend,
claiming that it is able to send 500,00 on a AMD Duron 900 with 512MB
RAM in 10 hours.

The phpmailer class says that directly conneting to mail() is better
than using SMTP as it puts more of an overhead. Though I was looking at
Perl packages such BulkMail that uses SMTP was able to send out 100,000
emails.

Everyone says that PHP's mail() causes several Sendmail instances to
fork off which is ineffcient.

-----Original Message-----
From: Gil Disatnik [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 21, 2002 6:46 PM
To: Jonathan Chum
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Mass Mailing

I have written a few useful php functions that put the email addresses
on 
one file and the message on another file.
I have a crontabbed script that runs every min looking for these files
and 
then using qmail-inject to send them (sendmail is bad, replace it ;))
It's very good for sending a few thousands emails every time as the php 
script execution finishes in a second and you don't have to deal with
max 
execution time and everything.

If you wish I could send you the scripts.

At 05:10 PM 12/21/2002 -0500, you wrote:
>An upcoming project I'm working and spec'ing out is a mass mailing
>application. Initially, I was looking at Mailman which was written in
Python
>since it looks like it handles delivering emails efficiently without
killing
>the server. We have 1 client able to send 110,000 emails at 6.5K avg
per
>week on PIII 800 with 128 MB RAM using Mailman. The inteface however is
very
>bad and we'd like to develop other features like text ads, tracking,
>templates, etc. This would require writing a wrapper around Mailman in
PHP.
>I was considering of writing the mass mailing application in PHP
instead
>though.
>
>If anyone has eperience writing such applications with this amount of
>emails, I'd like to know what you've done.
>
>I'm thinking of coding the front end in PHP that will put the email
into a
>queue table that will force a command line PHP script listening on a
>particular port to scan the database for this new task in queue. Once
it
>picks up the task, the timeout for this application to run will be set
to
>infinite. It'll establish a SMTP socket either to a really beefed up
mailing
>list server or the localhost SMTP server to begin blasting out these
emails.
>
> From what I understand, it's better to blast emails via an open socket
>connection to SMTP rather than looping through Sendmail. Is this the
right
>thing todo?
>
>I've also heard that PHP is not good for writing mailing lists
application,
>but Mailman is written in Python and it's able to send thousands of
email
>just fine. Any thoughts on this?
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


Regards

Gil Disatnik
UNIX system/security administrator.

GibsonLP@EFnet
http://www.disatnik.com
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
"Windows NT has detected mouse movement, you MUST restart
your computer before the new settings will take effect, [ OK ]"
--------------------------------------------------------------------
Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit operating
system, written for a 4 bit processor by a 2 bit company which can
not stand 1 bit of competition.
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- 

--- End Message ---
--- Begin Message ---
Why not just use simple alias files?

1) You have a file with all your addresses

file.asc:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
etc

2) You have the alias entry
my-mass-list:        :include:/path/to/file.asc

3) PHP sends one email to [EMAIL PROTECTED]
4) The mail server (if it's any good), expands all the addresses from
file.asc and does the mass mailing...

Problem sorted?  The alias file (included) can easily be managed with PHP.
With a little tweaking, you can even include a script directly via the alias
file by using a | (pipe).  The script can go as far as to even get the list
of email addresses from a MySQL DB or something... You can do the script in
just about anything you want... Sh, Perl, PHP, Python, Java... Doesn't
really make a difference.

A pipe will actually give you better security, as you can verify the email
before actually sending out 100,000 odd copies of it.  Here, you can sign
the message with a PGP key via PHP for example.  If the key's do not match,
the script doesn't send the email (And obviously, you remove the key from
the email before sending it out from the piped script)....

Anyways, that's how I would do it if I couldn't use mailman for whatever
reason.  IMHO, keeping as much of the mail on a mail server will drastically
improove the performance, because a mail server is made to
process/send/receive email, PHP is not ;-)

--
me



----- Original Message -----
From: "Jonathan Chum" <[EMAIL PROTECTED]>
To: "'Gil Disatnik'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, December 22, 2002 2:03 AM
Subject: RE: [PHP] Mass Mailing


> Yea, I'd like to see that. How many people are on your lists if you
> don't mind me asking?
>
> I also came across this evening, http://phpmailer.sourceforge.net and
> http://www.octeth.com/index.php uses this class on it's backend,
> claiming that it is able to send 500,00 on a AMD Duron 900 with 512MB
> RAM in 10 hours.
>
> The phpmailer class says that directly conneting to mail() is better
> than using SMTP as it puts more of an overhead. Though I was looking at
> Perl packages such BulkMail that uses SMTP was able to send out 100,000
> emails.
>
> Everyone says that PHP's mail() causes several Sendmail instances to
> fork off which is ineffcient.
>
> -----Original Message-----
> From: Gil Disatnik [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, December 21, 2002 6:46 PM
> To: Jonathan Chum
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Mass Mailing
>
> I have written a few useful php functions that put the email addresses
> on
> one file and the message on another file.
> I have a crontabbed script that runs every min looking for these files
> and
> then using qmail-inject to send them (sendmail is bad, replace it ;))
> It's very good for sending a few thousands emails every time as the php
> script execution finishes in a second and you don't have to deal with
> max
> execution time and everything.
>
> If you wish I could send you the scripts.
>
> At 05:10 PM 12/21/2002 -0500, you wrote:
> >An upcoming project I'm working and spec'ing out is a mass mailing
> >application. Initially, I was looking at Mailman which was written in
> Python
> >since it looks like it handles delivering emails efficiently without
> killing
> >the server. We have 1 client able to send 110,000 emails at 6.5K avg
> per
> >week on PIII 800 with 128 MB RAM using Mailman. The inteface however is
> very
> >bad and we'd like to develop other features like text ads, tracking,
> >templates, etc. This would require writing a wrapper around Mailman in
> PHP.
> >I was considering of writing the mass mailing application in PHP
> instead
> >though.
> >
> >If anyone has eperience writing such applications with this amount of
> >emails, I'd like to know what you've done.
> >
> >I'm thinking of coding the front end in PHP that will put the email
> into a
> >queue table that will force a command line PHP script listening on a
> >particular port to scan the database for this new task in queue. Once
> it
> >picks up the task, the timeout for this application to run will be set
> to
> >infinite. It'll establish a SMTP socket either to a really beefed up
> mailing
> >list server or the localhost SMTP server to begin blasting out these
> emails.
> >
> > From what I understand, it's better to blast emails via an open socket
> >connection to SMTP rather than looping through Sendmail. Is this the
> right
> >thing todo?
> >
> >I've also heard that PHP is not good for writing mailing lists
> application,
> >but Mailman is written in Python and it's able to send thousands of
> email
> >just fine. Any thoughts on this?
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> Regards
>
> Gil Disatnik
> UNIX system/security administrator.
>
> GibsonLP@EFnet
> http://www.disatnik.com
> _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
> "Windows NT has detected mouse movement, you MUST restart
> your computer before the new settings will take effect, [ OK ]"
> --------------------------------------------------------------------
> Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit operating
> system, written for a 4 bit processor by a 2 bit company which can
> not stand 1 bit of competition.
> -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
In almost all cases the number of mail messages/time unit sent is a function
of bandwidth, not CPU; my Pentium II 250Mhz machine saturates a 768K SDSL
line no problem at all.

Mark C.

--- End Message ---
--- Begin Message ---
Well, the problem I'm facing is that the application I'm building will have
several users that may have a few subscribers to very large subscriber list.
Using the include function in sendmail aliases will still be using Sendmail
to deliver the email, but folks have been saying that SMTP is much faster
and includes features such as enveloping which increases the speed of
delivery.

The ability to use include function seems too easy of a solution as there
are list server apps out there that costs 6,000 with added support costs and
SMTP server.

"Chris Knipe" <[EMAIL PROTECTED]> wrote in message
000e01c2a94f$6cef0730$[EMAIL PROTECTED]">news:000e01c2a94f$6cef0730$[EMAIL PROTECTED]...
> Why not just use simple alias files?
>
> 1) You have a file with all your addresses
>
> file.asc:
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> etc
>
> 2) You have the alias entry
> my-mass-list:        :include:/path/to/file.asc
>
> 3) PHP sends one email to [EMAIL PROTECTED]
> 4) The mail server (if it's any good), expands all the addresses from
> file.asc and does the mass mailing...
>
> Problem sorted?  The alias file (included) can easily be managed with PHP.
> With a little tweaking, you can even include a script directly via the
alias
> file by using a | (pipe).  The script can go as far as to even get the
list
> of email addresses from a MySQL DB or something... You can do the script
in
> just about anything you want... Sh, Perl, PHP, Python, Java... Doesn't
> really make a difference.
>
> A pipe will actually give you better security, as you can verify the email
> before actually sending out 100,000 odd copies of it.  Here, you can sign
> the message with a PGP key via PHP for example.  If the key's do not
match,
> the script doesn't send the email (And obviously, you remove the key from
> the email before sending it out from the piped script)....
>
> Anyways, that's how I would do it if I couldn't use mailman for whatever
> reason.  IMHO, keeping as much of the mail on a mail server will
drastically
> improove the performance, because a mail server is made to
> process/send/receive email, PHP is not ;-)
>
> --
> me
>
>
>
> ----- Original Message -----
> From: "Jonathan Chum" <[EMAIL PROTECTED]>
> To: "'Gil Disatnik'" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, December 22, 2002 2:03 AM
> Subject: RE: [PHP] Mass Mailing
>
>
> > Yea, I'd like to see that. How many people are on your lists if you
> > don't mind me asking?
> >
> > I also came across this evening, http://phpmailer.sourceforge.net and
> > http://www.octeth.com/index.php uses this class on it's backend,
> > claiming that it is able to send 500,00 on a AMD Duron 900 with 512MB
> > RAM in 10 hours.
> >
> > The phpmailer class says that directly conneting to mail() is better
> > than using SMTP as it puts more of an overhead. Though I was looking at
> > Perl packages such BulkMail that uses SMTP was able to send out 100,000
> > emails.
> >
> > Everyone says that PHP's mail() causes several Sendmail instances to
> > fork off which is ineffcient.
> >
> > -----Original Message-----
> > From: Gil Disatnik [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, December 21, 2002 6:46 PM
> > To: Jonathan Chum
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Mass Mailing
> >
> > I have written a few useful php functions that put the email addresses
> > on
> > one file and the message on another file.
> > I have a crontabbed script that runs every min looking for these files
> > and
> > then using qmail-inject to send them (sendmail is bad, replace it ;))
> > It's very good for sending a few thousands emails every time as the php
> > script execution finishes in a second and you don't have to deal with
> > max
> > execution time and everything.
> >
> > If you wish I could send you the scripts.
> >
> > At 05:10 PM 12/21/2002 -0500, you wrote:
> > >An upcoming project I'm working and spec'ing out is a mass mailing
> > >application. Initially, I was looking at Mailman which was written in
> > Python
> > >since it looks like it handles delivering emails efficiently without
> > killing
> > >the server. We have 1 client able to send 110,000 emails at 6.5K avg
> > per
> > >week on PIII 800 with 128 MB RAM using Mailman. The inteface however is
> > very
> > >bad and we'd like to develop other features like text ads, tracking,
> > >templates, etc. This would require writing a wrapper around Mailman in
> > PHP.
> > >I was considering of writing the mass mailing application in PHP
> > instead
> > >though.
> > >
> > >If anyone has eperience writing such applications with this amount of
> > >emails, I'd like to know what you've done.
> > >
> > >I'm thinking of coding the front end in PHP that will put the email
> > into a
> > >queue table that will force a command line PHP script listening on a
> > >particular port to scan the database for this new task in queue. Once
> > it
> > >picks up the task, the timeout for this application to run will be set
> > to
> > >infinite. It'll establish a SMTP socket either to a really beefed up
> > mailing
> > >list server or the localhost SMTP server to begin blasting out these
> > emails.
> > >
> > > From what I understand, it's better to blast emails via an open socket
> > >connection to SMTP rather than looping through Sendmail. Is this the
> > right
> > >thing todo?
> > >
> > >I've also heard that PHP is not good for writing mailing lists
> > application,
> > >but Mailman is written in Python and it's able to send thousands of
> > email
> > >just fine. Any thoughts on this?
> > >
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > Regards
> >
> > Gil Disatnik
> > UNIX system/security administrator.
> >
> > GibsonLP@EFnet
> > http://www.disatnik.com
> > _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
> > "Windows NT has detected mouse movement, you MUST restart
> > your computer before the new settings will take effect, [ OK ]"
> > --------------------------------------------------------------------
> > Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit operating
> > system, written for a 4 bit processor by a 2 bit company which can
> > not stand 1 bit of competition.
> > -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


--- End Message ---
--- Begin Message --- Hello gang,

I have a site hosted at JTL Networks, and I'm looking into setting up a spell checker for my message boards. The problem is, JTL doesn't have pspell compiled in with their php build, and it may be some time before they do (if they ever do). Does anyone know of a way to include something like pspell support in php dynamically? Like by using a .htaccess file to call it or something?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
>    I have a site hosted at JTL Networks, and I'm looking into setting up
> a spell checker for my message boards.  The problem is, JTL doesn't have
> pspell compiled in with their php build, and it may be some time before
> they do (if they ever do).  Does anyone know of a way to include
> something like pspell support in php dynamically?  Like by using a
> .htaccess file to call it or something?

At the last count (Apache 1.3.27/PHP4.2.3), aspell doesn't get compiled into
PHP. It just sits in /usr/bin on RH Linux, at least..

The bad news is, that your code will have to be written for it. The good news
is, that you can cheese the code off Horde's Imp.

Best,

Tony

-- 

When all's said and done, there's nothing left to say or do ...
http://www.billy.demon.nl

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--- End Message ---
--- Begin Message ---
Uros Gruber wrote:
Hi!

I wan't to know if there is any goor text parser around here
written in php. I'm asking before i create my own.

I would like extract some text msgs to words and i would also
like take care of stop words, special characters etc... So to
know if some word is regular word, or if is number, html tag,
html entry.....


it's not php but check out

http://betsie.sourceforge.net/

written in Perl - the regular expressions may be portable to php

--

Sean

--- End Message ---
--- Begin Message --- dear list,

I've noticed that the longer i work on a project, the more i use my 'organic' way of adding features and filter, and the less i understand what my own code is doing. Now I do have some projects of, say, 5000 lines and i started very organized with flow diagrams and function descriptions and shit, but during the project i still managed to sneak in all sorts of unintended mess.

So I am looking for some thing that may help me develop, but will not cost me more time than it gives back. For instance i tried some flow diagram tools and it is just not worth it - the original scrible i make of it on paper is just as helpful.
I was thinking of some sort of function list, where i describe the functions in a detailed way, including input and output of course.
It should work with classes and object descriptions too, and lists of globals.

Does any such tool exist?

thanks,
Chris

PS apologies if this question is often asked, i just joined the list again.

--- End Message ---
--- Begin Message ---
Hi,

First off, thanks to all those that helped out with my other questions. Not
all my problems were solved, but I'm certainly closer. Still working on the
same project I need to do the following.

I have a form where users input numbers only, is there a way I can have php
check to make sure a letter or other character didn't get put in by
accident. I was looking at ereg, but not to familiar with this or if it
would work in this case.

TIA


--- End Message ---

Reply via email to