Re: [PHP] OOP, Out of Scope Issue

2004-11-07 Thread Jonathan Chum
Awesome, great tip. It works just fine in PHP 5, but after gooogling more 
information about references and values, it appears that PHP 5 supports 
references automatically.

I was trying to get it to work under 4.3.8 which I had to use the &.

For anyone else, this page goes into more depth: 
http://www.webreference.com/programming/phpanth2/5.html

Thanks!

"Zareef Ahmed" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Hi,
>
> Please visit
>
> http://www.phpcertification.com/manual.php/functions.arguments.html#func
> tions.arguments.by-reference
>
> Hope it will be helpful.
>
>
> zareef Ahmed
>
> -Original Message-
> From: Jonathan Chum [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 08, 2004 9:52 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] OOP, Out of Scope Issue
>
>
> I have a class called FrontEnd which extends a TemplateManager class.
>
> The purpose of the TemplateManager class is to initate Smarty.
>
> So my FrontEnd constructor looks like this:
>
> function FrontEnd()
> {
>$db = new DatabaseConnection();
>
>$this->db = $db->initDatabase();
>$this->sm = $this->initTemplate();
> }
>
> I have another function:
>
> function DisplayMain($parentID)
> {
>if (!isset($parentID)) $parentID = '1';
>
>$product = new Products($this->db, $this->sm);
>
>$category = new Categories($this->db, $this->sm);
>
>$category->FetchCategories($parentID);
>$product->FetchProducts($parentID);
>
>$this->DisplayPage('display-products');
> }
>
> I'm passing in an instance of the smarty object instantiated by the
> FrontEnd
> constructor into Products and Categories. The FetchCategories and
> FetchProducts methods will take the smarty instance and assign the
> variables
> into the template, assuming it's the same instance of Smarty. The
> problem
> I'm having is that it sees in each class a new instance of Smarty or a
> copy
> of the object which when I call DisplayPage, a method within the
> FrontEnd
> class, it doesn't see all of the variables I assigned earlier by
> FetchProducts and FetchCategories even though I've not declared a new
> instance of Smarty.
> How can I fix it so that it uses the same Smarty object and not a copy?
>
> 
> --
> Zareef Ahmed :: A PHP develoepr in Delhi ( India )
> Homepage :: http://www.zasaifi.com 

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



[PHP] OOP, Out of Scope Issue

2004-11-07 Thread Jonathan Chum
I have a class called FrontEnd which extends a TemplateManager class.

The purpose of the TemplateManager class is to initate Smarty.

So my FrontEnd constructor looks like this:

function FrontEnd()
{
$db = new DatabaseConnection();

$this->db = $db->initDatabase();
$this->sm = $this->initTemplate();
}

I have another function:

function DisplayMain($parentID)
{
if (!isset($parentID)) $parentID = '1';

$product = new Products($this->db, $this->sm);

$category = new Categories($this->db, $this->sm);

$category->FetchCategories($parentID);
$product->FetchProducts($parentID);

$this->DisplayPage('display-products');
}

I'm passing in an instance of the smarty object instantiated by the FrontEnd 
constructor into Products and Categories. The FetchCategories and 
FetchProducts methods will take the smarty instance and assign the variables 
into the template, assuming it's the same instance of Smarty. The problem 
I'm having is that it sees in each class a new instance of Smarty or a copy 
of the object which when I call DisplayPage, a method within the FrontEnd 
class, it doesn't see all of the variables I assigned earlier by 
FetchProducts and FetchCategories even though I've not declared a new 
instance of Smarty.
How can I fix it so that it uses the same Smarty object and not a copy? 

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



[PHP] MIME Decoding Class

2003-02-08 Thread Jonathan Chum
I'm looking through Google for MIME decoding classes, one developed by
Richard Heyes used in Pear and a few others. What I'm curious is how
complete are these classes or if there is one you recommend that completely
decodes emails from Outlook, Hotmail, Eudora, etc. based emails.

I've looked at solutions written in C and they are about 800 KB source code
in size compared to classes written in apps like Squirrel Mail which is
90KB. Does anyone know of any complete decoding classes in PHP either free
or commercial. Command line are also fine. If there are C, C++, or C#
libraries, those are okay as well if you know of any. I just couldn't come
across any that are well coded to perform the task of complete MIME
decoding.



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




Re: [PHP] 3 tier web development

2003-02-08 Thread Jonathan Chum
I use Smarty for seperate PHP logic and template logic.

For database abstraction, I use AdoDB. Not much a fan of Pear Adodb was
pretty faithful when I ported my MySQL app to PostGreSQL.

"Hardik Doshi" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok so for seperating interface and PHP code, smarty
> templace engine is the best right?
>
> What about database abstraction layer?
>
> thanks for your information. I really appreciate that.
>
> Hardik
>
> --- John Wells <[EMAIL PROTECTED]> wrote:
> > Hardik Doshi said:
> > > 1. How one can seperate HTML and PHP (or any other
> > > programming code).  Is there anything in PHP so i
> > can
> > > seperate Interface layer and programming logic
> > layer?
> >
> > http://smarty.php.net
> >
> >
>
>
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com



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




[PHP] Re: SMTP, mail() and piping directly into Sendmail, which is better?

2003-01-22 Thread Jonathan Chum
Ignore this post, I got my answers from the archives :)
"Jonathan Chum" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm working on mass mailing list application and doing my research on the
> part with the actual delivery of the message. I've been using a Perl
script
> called MojoMail which sends out blasts just fine and boasts that SMTP is
the
> fastest way for delivery than with Sendmail using a module called
BulkMail.
> I always understood that SMTP adds an additional layer around the MTA
which
> really slows things down, however only useful if you plan to blast emails
> across several SMTP servers for a load balancing purposes.
>
> So that's a 'pro' for using SMTP. The 'con' is that delivery is not quite
as
> fast.
>
> Then with PHP's mail(), folks have been saying that because it
opens/closes
> a connection, looping through mail() adds additional overhead and that the
> best way would be to pipe into the MTA with popen()/pclose()
>
> Now I'm curious which method is really better...Piping into the MTA will
> still open/close the connection and adds the same amount of overhead as
> mail() do right? What are your thoughts on SMTP?
>
>



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




[PHP] Re: Mass Mailing

2003-01-22 Thread Jonathan Chum
Hi,

I was surfing through google's archive, and some reason my USENET reader
didn't catch this reply, so here goes. . .(my comments are embedded below)

"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> On 12/22/2002 02:52 PM, Jonathan Chum wrote:
> >>>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.
> >>
> >>If you do not need to send personalized messages (messages that differ
> >>for each recipient), just put all recipients in a BCc: header and send a
> >>single message to the local mailer queue (not via SMTP).
> >>
> >>If you do not care for the users that bounce messages, just make the
> >>return path be black hole email address. OTOH, if you care about bounces
> >>(you should if you mailing list is large or is not clean), consider
> >>using ezmlm, which is a mailing list manager than among other things
> >>takes care of bounce messages thanks to qmail VERP. I was told that is
> >>the one that eGroups hacked to use in the now known YahooGroups site.
> >>
> >>Once I built a small Web interface for ezmlm. It was meant just to
> >>create and edit several mailing lists meant to be used as newsletter for
> >>a portal with many sites. Is simple but it already comes with a SOAP
> >>interface to manage the mailing list subscribers remotely.
> >>
> >>http://www.phpclasses.org/ezmlmmanager
> >
> >
> > I heard that using BCC, it can only handle a certain amount of
receipients.
>
> No, if you look in the archives of this list you will notice that this
> was explained several times. What happens is that some ISP of shared
> hosting limit the number of recipients of the messages you can send
> because they do not want you to do mass mailing at all. You should check
> your ISP Acceptable Use Policy before trying to do any mass mailing.
> Trying to queue individual messages to each recipient may fool the
> server limitations but you may still be against the AUP.
>
>
> > Also, messages that are BCC'd are also tend to be blocked by mail
servers
> > and clients.
>
> Any server owners that do that are dumb because while they think they
> are blocking spammers, what they get is they are simply blocking opt-in
> mailing lists for instance like this one you are getting. At the same
> time you still keep getting most of the spam because real spammers use
> dedicated machines make the recipients addresses show in the messages as
> needed to defeat that silly anti-spam criteria. So, what they get is to
> block solicited e-mail.
>
> Anyway, the problem of personalizing messages is that makes your
> mailings take much longer to generate and queue because you need to
> create separate message for each recipient.

I'm weighing down personalization and enveloping for this project, and
probably going for the personalization of each email. This rules out BCC and
enveloping with SMTP.

>
> >>No, queuing via SMTP is the slowest way to send messages. Your script
> >>should not bother to deliver the messages to the recipients SMTP
> >>servers.  Delivery can take hours or days to finish due to network
> >>congestions and hard to conect SMTP servers. Just queue the messages in
> >>the local mailer and let it take care the actual delivery.
> >>
> >>I would recommend a qmail based system anytime, with or without ezmlm on
> >>top. In a production system that I manage, it just takes 3 seconds to
> >>queue a alert message to be sent to 50,000 via a local qmail server.
> >>
> >>You can also use sendmail almost as fast using the queue only mode. Some
> >>people think that sendmail is slow and many forks processes because they
> >>are not aware of how to configure it to queue the messages the fastest
> >>way that is possible.
> >>
> >>You may want to look into this class that has a sub-classes for
> >>delivering with sendmail program directly instead of using the mail().
> >>It lets you configure the sendmail delivery mode. There is also a
> >>sub-class for delivering with qmail.
> >>
> >>http://www.phpclasses.org/mimemessage
> >
> >
> > I was looking at a variety of methods, and seems that everyone thinks
for
> > best performance, you would inject the email in to Qmail or Sendmail's
queue
>
> That is because it is really the

[PHP] SMTP, mail() and piping directly into Sendmail, which is better?

2003-01-22 Thread Jonathan Chum
I'm working on mass mailing list application and doing my research on the
part with the actual delivery of the message. I've been using a Perl script
called MojoMail which sends out blasts just fine and boasts that SMTP is the
fastest way for delivery than with Sendmail using a module called BulkMail.
I always understood that SMTP adds an additional layer around the MTA which
really slows things down, however only useful if you plan to blast emails
across several SMTP servers for a load balancing purposes.

So that's a 'pro' for using SMTP. The 'con' is that delivery is not quite as
fast.

Then with PHP's mail(), folks have been saying that because it opens/closes
a connection, looping through mail() adds additional overhead and that the
best way would be to pipe into the MTA with popen()/pclose()

Now I'm curious which method is really better...Piping into the MTA will
still open/close the connection and adds the same amount of overhead as
mail() do right? What are your thoughts on SMTP?



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




Re: [PHP] Problem with Search Engine Friendly URLs under PHP & Windows XP

2003-01-11 Thread Jonathan Chum
Toying with Apache further, I actually was able to get this to work a few
minutes I posted the thread. What I was doing wrong was running PHP as a CGI
rather than using it as SAPI module.

Hopefully this helps other folks as I was going nuts going through
google.com trying to find a solution.

Add this line to your httpd.conf with the path to php4apache.dll included in
the Windows distribution:

LoadModule php4_module C:\apache\php\sapi\php4apache.dll

Then add this line:

AddModule mod_php4.c

Then add the MIME types for PHP:

AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml

Also, you'll need to copy php4ts.dll into your c:\Windows\System32 folder.

After all that, this feature works under Windows whoohoo :)

"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> As far as I know, this technique doesn't work under windows...
>
> Jonathan Chum wrote:
>
> >I'm following various tutorials online that uses the PATH_INFO to do
this,
> >however Apache isn't playing nicely. I read a few documents that Apache
has
> >a built in look back feature, but a query on google on lead me back to a
few
> >articles that I just read so I'm assuming this feature is made up in the
> >article?
> >
> >I've gotten the .htaccess to run a file as a .php, however I can't attach
> >arguments to the right hand side of the URL. An example would be, I have
a
> >file called index.php. I turn this into index and run it as a .php file.
It
> >works fine, though I should be able to add /name/1 which shows up under
the
> >PATH_INFO variable.
> >
> >However, I get a blank page and this error logged in Apache:
> >
> >[Sat Jan 11 10:33:40 2003] [error] [client 127.0.0.1] PHP Fatal error:
> >Unable to open c:\apache\www\www.mxportal.com\public_html\dir\resources\d
in
> >Unknown on line 0
> >
> >So it looks like Apache is not reading back to resources, but thinks
there
> >is  folder called resources and a file called d in which it's trying to
open
> >and pass it to PHP.
> >
> >This however works under *NIX systems. I'm not sure if there's a
different
> >of doing it under Windows or if this is a bug in Apache. Any ideas?
> >
> >
> >
> >
> >
>
> --
> Gerard Samuel
> http://www.trini0.org:81/
> http://dev.trini0.org:81/
>
>



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




[PHP] Problem with Search Engine Friendly URLs under PHP & Windows XP

2003-01-11 Thread Jonathan Chum
I'm following various tutorials online that uses the PATH_INFO to do this,
however Apache isn't playing nicely. I read a few documents that Apache has
a built in look back feature, but a query on google on lead me back to a few
articles that I just read so I'm assuming this feature is made up in the
article?

I've gotten the .htaccess to run a file as a .php, however I can't attach
arguments to the right hand side of the URL. An example would be, I have a
file called index.php. I turn this into index and run it as a .php file. It
works fine, though I should be able to add /name/1 which shows up under the
PATH_INFO variable.

However, I get a blank page and this error logged in Apache:

[Sat Jan 11 10:33:40 2003] [error] [client 127.0.0.1] PHP Fatal error:
Unable to open c:\apache\www\www.mxportal.com\public_html\dir\resources\d in
Unknown on line 0

So it looks like Apache is not reading back to resources, but thinks there
is  folder called resources and a file called d in which it's trying to open
and pass it to PHP.

This however works under *NIX systems. I'm not sure if there's a different
of doing it under Windows or if this is a bug in Apache. Any ideas?



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




[PHP] Re: Mass Mailing

2002-12-22 Thread Jonathan Chum
Thanks Manuel,

"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> On 12/21/2002 08:10 PM, Jonathan Chum 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.
>
> If you do not need to send personalized messages (messages that differ
> for each recipient), just put all recipients in a BCc: header and send a
> single message to the local mailer queue (not via SMTP).
>
> If you do not care for the users that bounce messages, just make the
> return path be black hole email address. OTOH, if you care about bounces
> (you should if you mailing list is large or is not clean), consider
> using ezmlm, which is a mailing list manager than among other things
> takes care of bounce messages thanks to qmail VERP. I was told that is
> the one that eGroups hacked to use in the now known YahooGroups site.
>
> Once I built a small Web interface for ezmlm. It was meant just to
> create and edit several mailing lists meant to be used as newsletter for
> a portal with many sites. Is simple but it already comes with a SOAP
> interface to manage the mailing list subscribers remotely.
>
> http://www.phpclasses.org/ezmlmmanager

I heard that using BCC, it can only handle a certain amount of receipients.
Also, messages that are BCC'd are also tend to be blocked by mail servers
and clients.

> > 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?
>
> No, queuing via SMTP is the slowest way to send messages. Your script
> should not bother to deliver the messages to the recipients SMTP
> servers.  Delivery can take hours or days to finish due to network
> congestions and hard to conect SMTP servers. Just queue the messages in
> the local mailer and let it take care the actual delivery.
>
> I would recommend a qmail based system anytime, with or without ezmlm on
> top. In a production system that I manage, it just takes 3 seconds to
> queue a alert message to be sent to 50,000 via a local qmail server.
>
> You can also use sendmail almost as fast using the queue only mode. Some
> people think that sendmail is slow and many forks processes because they
> are not aware of how to configure it to queue the messages the fastest
> way that is possible.
>
> You may want to look into this class that has a sub-classes for
> delivering with sendmail program directly instead of using the mail().
> It lets you configure the sendmail delivery mode. There is also a
> sub-class for delivering with qmail.
>
> http://www.phpclasses.org/mimemessage

I was looking at a variety of methods, and seems that everyone thinks for
best performance, you would inject the email in to Qmail or Sendmail's queue
and run it every hour.

As for SMTP, I meant sending the email through your outbound SMTP server
which in our case, a server we build specifically for handling that sort of
volume. I was reading through Perl's BulkMail module,
http://mojo.skazat.com/support/documentation/Bulkmail.pm.html

They are using SMTP to delivery their emails. Using envelopes and sorting
the emails by their host meant even faster delivery. Though the envelope
method seems to be like BCC as you can't personalized each email To:
recepient.

Your Mime Message class seems to be better for sending mass mailings as it
queues up the email into Sendmail without opening/closing the connection for
each recepient. phpmaile

Re: [PHP] Mass Mailing

2002-12-21 Thread Jonathan Chum
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 w

RE: [PHP] Mass Mailing

2002-12-21 Thread Jonathan Chum
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




[PHP] Mass Mailing

2002-12-21 Thread Jonathan Chum
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




[PHP] XML-RPC, is this the best approach for something like this?

2002-12-01 Thread Jonathan Chum
Hi guys!

I'm wrapping up a web hosting control panel written in PHP that fills up a
queue with commands such as create web hosting account, or change password.

A Perl based CRON job on each server will query the database trying to
determine what tasks it needs to execute. The problem however is that these
jobs will run every 60s which isn't fast enough for my boss. He'd like to
see things happen instantly.

There are a few ways this could be accomplish that I could think of.

1) Write a daemon that queries the database for tasks only when the infinite
while loop determines that the master server sent a request to begin
querying the master database for tasks.
2) The CRON job could be set to run at a lower interval, maybe every 30s.
3) Write a deamon that opens a port using sockets to listen for commands and
executes.
4) Using XML-RPC, construct an encrypted payload across a SSL connection to
the remote server.

Some of the problems I'm facing is getting a response back from the server
in case there are any issues with account creation. At the moment, there is
a disconnection between the master database and the web hosting servers in
which if an error is generated, the user does not know believing everything
is okay and an email is dispatched to the admin to check out the problem.

I'm also faced with tasks that running on top of each other. Perhaps it took
the server 60s to create the hosting account because the load was incredibly
high. Then the second job starts up, which would be to delete the catch all
account. The catch all account does not exist, but only in the database it
does.

I think method 1 will fix the instant change account maintenance problem,
but I still can't get any responses back from the server if account creation
was not successful.

Method 2 will not fix the instant change, only making it quicker.

Method 3 will fix the instant change and responds back if there are issues

Method 4 sounds like the best method, yet I'm afraid of the script timing
out and permissions issue. I don't want the remote machine running PHP
that's parsing the XML payload to run with high level permissions and I hate
to compile another instance of PHP and Apache.

So I'm left with Method 3 with probably the best choice. Before I dive into
the world of socket development, is there any recommendations or feedback?



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




[PHP] Re: PHP Trouble-Ticket-Systems?

2002-12-01 Thread Jonathan Chum
I actually spent all day last Wednesday for looking for such a tool to
integrate into a web hosting control panel we've built, but there really
isn't a good one out there. PerlDesk is a free one that is template based,
yet it's lacking a few features. At work, we use Response Tracker v2 (RT)
which is also Perl based, but the template engine is nightmare to give it a
new look. It has everything you mention below, but the interface and
installation is the drawbacks.

So, I spent my Thanksgiving weekend working on PHP port of RT2 which at the
moment is able to authenticate technicians, create a new ticket,
reply/comment to tickets, activity logging, queue stats, and a few other
things.

I haven't done the client side yet, but shouldn't be too hard since the DB
schema is complete and I can safely reuse templates in the technician screen
for the client area with a small bit of changing out the WHERE clauses in
the SQL querying.

The DB layer is ADODB so it can be ported over to PostGreSQL later on.
Smarty is the template class I'm using with custom error pages on all
errors, warning, or notices.

Until the web interface is hardened, then I'll work on email parser to pipe
it into database and parse MIME attachments. . . I'd like to see it evolve
into something like cyracle.com where there is a knowledge base in which the
visitor can rummage through before submitting in a ticket.

"Thomas Seifert" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi folks,
>
> I already searched through the web but couldn't find any which provide the
features I want.
>
> What I would want to see in such a system:
> - adding TroubleTickets through webinterface or sending an email to an
support email-address
> - adding answers to troubletickets to their parent
> - nice admininterface to answer support-requests and add comments (not
sent to visitors)
> - open/close/stalled/bogus ... and so on tags for the system
> - ...
>
>
> So the question is, does anyone know any good
troubleticket/helpdesk-systems written in PHP?
>
>
> Thanks,
>
> Thomas



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




[PHP] Open Source Mailing Lists

2002-10-05 Thread Jonathan Chum

Hi Guys,

I'm looking for open source mailing lists. I'm aware of hotscripts.com and
the mailing lists listed there was not what I had in mind. What I'm looking
for is possible some code snippets or applications where the scripts handles
much like Mailman in which one person can post a new message to the list and
an email is emailed out to everyone. Anyone whose on that list can then
reply to that message via email, and all emails are tracked via the ID so
that it can be archived on the web.

I've coded part of one, but stumped on how the messages retain reply to
references in the header. The Reply-To field always reference back to the
Message-ID of the message as it left the server, not the ID when it was
received. I put this ID as part of the Reference field, but when replying in
Outlook, the Reference field does not stay in tack when it reaches the
server for parsing. It's like Outlook does not even attach the Reference
header even when the message when you are replying to has a Reference header
in it.

Any ideas?



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




[PHP] NNTP Indexing

2002-01-15 Thread Jonathan Chum

I'm in dire need of suggestions for reconstruction of a database that
contains USENET posts from a few groups on the server.

This is the structure:

CREATE TABLE /*!32300 IF NOT EXISTS*/ nntp (
  pid mediumint(10) NOT NULL auto_increment,
  aid mediumint(10) NOT NULL DEFAULT '0' ,
  from_name varchar(50) NOT NULL DEFAULT '' ,
  subject varchar(100) NOT NULL DEFAULT '' ,
  date int(11) NOT NULL DEFAULT '0' ,
  body text NOT NULL DEFAULT '' ,
  mid varchar(50) NOT NULL DEFAULT '' ,
  reference varchar(50) NOT NULL DEFAULT '' ,
  newsgroup varchar(50) NOT NULL DEFAULT '' ,
  tid varchar(50) NOT NULL DEFAULT '' ,
  viewed mediumint(10) NOT NULL DEFAULT '0' ,
  replies mediumint(3) NOT NULL DEFAULT '0' ,
  PRIMARY KEY (pid),
  INDEX nntp_reference_newsgroup (reference,newsgroup),
  INDEX nntp_mid_newsgroup_date (mid,newsgroup,date),
  INDEX nntp_mid (mid),
  INDEX nntp_date (date),
  INDEX nntp_reference_newsgroup_tid_date (reference,newsgroup,tid,date),
  INDEX tid (tid)
);

This table contains data from multiple groups on the server. Right now, the
amount of posts is reaching into 150K posts including full body. It's quite
slow with a simple query to count the total posts of a particular group from
a certain date:

SELECT count(pid) AS total FROM nntp WHERE reference = '' AND
newsgroup='macromedia.dreamweaver' AND date > '1008511669'

An Index was created on the WHERE clause so that it could find the info
fast, but it takes at least 30s to just query for the total row count.

So my question is what's the best way to reconstruct this table. One method
of handling was to seperate each group crawled into it's own table, but I am
thinking into teh future when I begin to have hundreds of USENET groups to
crawl and wouldn't want to maintain 100s of tables.

Another idea would be to seperate the body of the posts into a seperate
table. Any other ideas/suggestions?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Recursive Threading

2002-01-03 Thread Jonathan Chum

I'm using recursive threading for a simple thread board script, but the
problem is the # of queries needed to execute. That is, once given the main
thread post, it'll have to find all the posts where the parentID matches the
current ID, then requery again for each of the post.

So I'm trying to discover a way to limit the amount of querying, possibly
there is some type of algo I don't know about or a method using arrays. Any
wisdom on this is greatly appreciated.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP Bulletin Boards...how they work.

2001-12-03 Thread Jonathan Chum

If you are just starting into PHP, try some something more basic. If you
have some background into another language such as PERL, then you shouldn't
have too much trouble. However, if you insist to taking on a bulletin board
script for analyzing purposes, head over to hotscripts.com where I'm sure
there is a few tutorials and many boards from the simplistic recursive
wwwthreads style boards to the vertical setup like infopop and UBB.

I've coded up BlazeBoard script last year and I must say, that majority of
the work is getting the cool features rather than developing a foundation of
the board. All a board does is input/output data from the database. So first
step to take would be developing a core registration module, then utilizing
it, authenticate the user so they can post to a forum, then build the module
to retrieve the data.

Of course there are other factors to consider on the complexity of the
board, that is if you want to consider the ability to create more than one
board for a forum or be able to categorize it. These are really features,
and doesn't represent the core system of any board.

Regards,
Jonathan Chum

http://www.flaap.com
Flash resources


"Anthony Ritter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm using Windows 98 with Apache, mysql and PHP.
>
> I'm in the process of learning PHP and would like to find a few tutorials
on
> PHP/mysql bulletin boards.
>
> I know that there are a few that you can download but I am trying to find
a
> tutorial that will let me anylaze the syntax and logic of the code so that
I
> can understand and breakdown the steps in how a BB program works.
>
> Any URL's will be helpful.
>
> Thanking all in advance.
> Tony Ritter
>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] search engine submission

2001-09-24 Thread Jonathan Chum

I believe that he wants an automated URL submission script. I've seen one
that just been released like a week or two ago. It's good script from what I
remember looking at the code with "success" page verification. If I can find
the URL, I'll be sure to reply. I can't seem to find it my IE's history. I
think the Windows XP Pro upgrade on Win2k did something to the browser's
history.

I have ported my PERL submission script to PHP, however I'm waiting for a
particular feature in PHP, rather a function to be more "developed" before I
release my port.

"Jon Haworth" <[EMAIL PROTECTED]> wrote in message
67DF9B67CEFAD4119E4200D0B720FA3FB5F105@BOOTROS">news:67DF9B67CEFAD4119E4200D0B720FA3FB5F105@BOOTROS...
> You can find this code all over the web, an example of it can be seen at
> most search engines on the "Add a URL" page :-)
>
> What are you trying to do?
>
> Cheers
> Jon
>
>
> -Original Message-
> From: Krushna Kumar R [mailto:[EMAIL PROTECTED]]
> Sent: 24 September 2001 15:08
> To: [EMAIL PROTECTED]
> Subject: [PHP] search engine submission
>
>
> Hi,
>
> Can someone help me by where i could get some free code for search engine
> submission
>
> Regards
> Krushna Kumar
>
>
> **
> 'The information included in this Email is of a confidential nature and is
> intended only for the addressee. If you are not the intended addressee,
> any disclosure, copying or distribution by you is prohibited and may be
> unlawful. Disclosure to any party other than the addressee, whether
> inadvertent or otherwise is not intended to waive privilege or
confidentiality'
>
> **



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Forking in PHP

2001-09-13 Thread Jonathan Chum

I'm developing an app in PHP whereby I need to run simulataneous routines at
once, but have some sort of control on how many instances of the childs will
be spawned and died before another batch is started.

Basically, I'm thinking of using a for loop that loops. Let's say I have 20
loops that I need todo, but loop through and executing a system() 5 loops
then wait for 15s which should give it enough time for the script in the
system() to finish up and die. Then loop the next batch of 5 and so on.

I'm wondering whether this would work or not. Also, I'm wondering whether
there is a way todo this, similar to the forking in PERL. Any help would be
great!

Regards,
Jonathan Chum


A I S   M e d i a ,  I n c .
"We Build eBusinesses"
3541 Habersham at Northlake, Building E
Tucker, GA 30084
Tel: 678.382.2247 / Fax: 678.382.2471
http://www.aismedia.com / [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: "Push" Images When HTML is already outputted.

2001-09-13 Thread Jonathan Chum

Scratch the message. :) I was thinking of something totally different :)


"Jonathan Chum" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> In PERL, there is a way to push images even though the HTML is already
> outputted to the screen, therefore changing images, live. . . . An example
> would be this particular script:
>
> http://www.donerightscripts.com/cgi-bin/demos/sitesubmit/sitesubmitter.cgi
>
> I am wondering how could this be done with PHP.
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] "Push" Images When HTML is already outputted.

2001-09-13 Thread Jonathan Chum

In PERL, there is a way to push images even though the HTML is already
outputted to the screen, therefore changing images, live. . . . An example
would be this particular script:

http://www.donerightscripts.com/cgi-bin/demos/sitesubmit/sitesubmitter.cgi

I am wondering how could this be done with PHP.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Beginner's books?

2001-09-13 Thread Jonathan Chum

Core PHP Programming by Leon Atkins is an excellent book IMHO. Each function
comes with a clear cut example how to use it. I have the first edition and
right now, I'm considering to purchase the second edition since it covers
PHP 4. That was my first PHP book when I started PHP.

"Lrw" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> OK, here's a question that should just make me look like a newbie and not
an
> idiot:
>
> Anyone have any recommendations of good books for PHP beginners?
> Something that gives the basics in clear detail and as few errors in the
> examples as possible? =)
>
> I've found bad errors in Sam's "Teach Yourself ASP" for example.
>
> Thanks!
> Liam
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Left Join Across Two Databases

2001-04-04 Thread Jonathan Chum

I have one table on one database and another table on another
database. I want to perform a left join these two tables in MySQL. I
don't think it's possible, but cuious if there is a "method" that can
be coded in PHP to do this?

If you think there's is a problem with my schema, well the boss wants
to have the user data on another database totally seperated from
features of the portal. So I have a big problem on my hands.

Any help would be much grateful!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Running a script without flowing

2001-03-29 Thread Jonathan Chum

I'm not sure of the exact term, but what I want todo is run a function
in a loop so that it doesn't wait for the function to finish and goes
ahead and executes the next in loop.

For example:

5; $i++) {

run_this();

}

?>

run_this may contain some long mathematical computations that takes a
while, but I want the script to go ahead and continue with the script
while the script computates...

or better yet, executes a shell script that runs in the bg, but the
PHP can safely quit without waiting for results of the shell script.
Any ideas?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]