Re: [PHP] bulk emailer

2005-03-11 Thread Nicholas W . Miller
On Mar 11, 2005, at 2:34 PM, Richard Lynch wrote:
what i'm currently doing:
-using mysql_fetcharray() to loop through an array of query results
-for each iteration of the loop, get an email address from the 
current row
in the result set, and use it with the mail() function to send out an
individual email to that email address, then echo out a confirmation 
in
HTML so that the user will know that an email has been sent
-this is repeated for each email address found in the result set
problem with this is: with large result sets (some of my result sets 
come
up with a few thousand email addresses), users have to wait a long 
time
for the confirmation messages to print out to their browser, 
sometimes it
seems that not all the messages go through
Ye Gods!
The mail() function is designed for quickie one-off emails, not sending
out thousands.  Hell, it can't even handle dozens, not reliably, at 
least
not on some hardware/connections.
I have to disagree on this one.  I've used the method described above, 
pulling e-mails from a MySQL table, to send out to well over 10,000 
recipients with out error.  As a safeguard, I have the script write the 
id of each record that is e-mailed, so if the script does fail at some 
point I can easily find out where it left off and tweak the script to 
start there upon running it again.

I call the script from a browser and its written to print each address 
as it's sent.  It does take some time for the addresses to appear in 
the browser and the seem to come in batches of a couple hundred at a 
time, but it will eventually display all of the addresses with some 
patience.

Nicholas Miller
Intercast Media, Inc.
229 19th Ave.  Suite 4
San Francisco, CA  94121
415-379-9500
415-520-9501 (fax)
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] pulling content from a URL

2005-03-04 Thread Nicholas W . Miller
I'm writing a script that needs to put the contents of an external URL 
into a variable.  I need to include some sort of error checking that 
will kill this request if for some reason the URL request hangs for 
more then 15 seconds.  In researching this, I think the correct 
function to use is fsockopen, but I can't seem to get it to work.  Can 
someone verify if fsockopen is the best way to grab an external URL, 
but kill the request if it hangs for a certain amount of time ... and 
if so, show me some sample code on how to place this URL's contents 
into a variable that I can then parse.  The URL will be hard coded into 
the script, so I don't need a lot of error checking to insure correct 
URL format, etc.

Thanks,
Nicholas Miller
Intercast Media, Inc.
229 19th Ave.  Suite 4
San Francisco, CA  94121
415-379-9500
415-520-9501 (fax)
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Fwd: Re: [PHP] passing variables in javascript

2001-02-22 Thread Nicholas W. Miller

>  H ... is there anyway to do this without requiring the page 
>with the link to use PHP?
>
>>
>>You have to encode each part of the query string on the URL correctly:
>>
>>> . "&url=" .
>>urlencode("http://www.domain.com/biz/pubs.html#antitrust");
>>?>', 'email','width=410,height=435')">Emailthis
>>
>>
>>Cheers
>>
>>Simon Garner


-- 
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] passing variables in javascript

2001-02-22 Thread Nicholas W. Miller

I have a text link that is coded to open a PHP file in a popup window:

http://www.domain.com/biz/pubs.html#antitrust','email','width=410,height=435')">Emailthis
 
article

For some reason the $url variables cuts off the anchor, so I only get this:

$url = http://www.dttgfsi.com/ebiz/pubs_eviews.html

I have tried escaping it (\#antitrust), but the doesn't work.

Any suggestions would be appreciated ...

Nick



[PHP] connectivity test

2001-02-19 Thread Nicholas W. Miller

Is it possible to test a user's line speed with PHP?

I have a site with a lot of video.  Each clip has the standard 
28/56/128 speed choice.  I would like to offer the user an interface 
where they can test their line speed and get a suggestion on which 
file to view.

Any experience ... ideas?

Nick

-- 
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] pgp text formatting

2001-02-16 Thread Nicholas W. Miller

I sent this off a couple days ago, but did not see it on the list ...
please excuse the traffic if you are seeing this for a second time.

I am writing some code (PHP3/4 on Apache) that encrypts some text using
PGP and writes it to a log_file.  I am having problems getting the line
breaks to remain intact from the original unencrypted version to the
final decrypted version.

Here's my code:

// first I setup a variable with the message to be encrypted,
// note the line breaks

$msg = "
*   *   *   *   *   *   *   *   *   *

BILL TO:

$type_of_card  $card_number
$users_name ($expiration_date)

$b_first_name $b_last_name
$b_address_1
$b_address_2
$b_city, $b_state  $b_zip
$b_day_phone $b_night_phone
$b_email

*   *   *   *   *   *   *   *   *   *
";

// next I set the environment variable for PGPPATH

putenv("PGPPATH=/.pgp");

// then I place the message that is to be encrypted in a file

$fp = fopen("plaintxt", "w+");

fputs($fp, $msg);

fclose($fp);

// fyi ... if at this point, if I were to open the file plaintxt
// all of my line breaks would still be there

// next I encrypt the data and write it to a file called crypted

system("/usr/local/bin/pgpe -r [EMAIL PROTECTED] -o crypted -a
plaintxt");

unlink("plaintxt");

// now ... if at this point I were to open the file crypted and decrypt
it
// I would get my message in a long line with squares where every break
should be

// here's the method I use to get this crypted data added to my log file

$fd = fopen("crypted", "r");

$msg_crypted = fread($fd, filesize("crypted"));

fclose($fd);

unlink("crypted");

$order_log = fopen("order_log", "a");

fwrite($order_log, $msg_crypted);

fclose($order_log);

So, if anyone can help me figure out a way to keep these line breaks in
place all the way through to decryption, I would be VERY appreciative.
I know this is possible ... because, if I take the same message from my
code and place it in a text editor ... encrypt and decrypt it using my
desktop PGP software ... all of the line breaks remain intact.

Please help!

Thanks,

Nick



-- 
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] counting files

2001-02-16 Thread Nicholas W. Miller

I have a web page that displays an image.  I would like to randomize
which image it displays when the page loads.  Every possible image will
be the same dimensions and file format.  Each image will be named a
consecutive number begining with 1.

The code I am using is:

$number = rand(1, 10);

$file = $number . "." . "gif";

echo"";

I'm wondering if there is a way to count how many files are in the
random_images directory, so I can dynamically set the range of my
rand().  This way I can add images to the random_images directory
without having to increase the range in the php code.

Thanks!

Nick


-- 
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]