php-general Digest 3 Feb 2002 19:53:11 -0000 Issue 1150

Topics (messages 83291 through 83324):

Re: Mysql & php
        83291 by: Mike Frazer

Re: file validation
        83292 by: Mike Frazer
        83303 by: Lars Torben Wilson
        83317 by: Mike Frazer

Re: Why doesn't PHP have built-in support for dynamic image generation?
        83293 by: Ed Lazor
        83294 by: Weston Houghton
        83299 by: Victor Boivie
        83305 by: Christian Stocker

Re: Sending an e-mail to 1,000 people
        83295 by: B Richards
        83297 by: Manuel Lemos
        83298 by: Manuel Lemos

Yawn, good morning? night? Whateva! :)
        83296 by: jtjohnston

Re: Default mysql path
        83300 by: David Robley

Re: [PHP-INST] Default mysql path
        83301 by: David Robley

inserting jpeg images into a interbase database
        83302 by: Sonya Davey

Re: How to call method from another class
        83304 by: David Yee

Re: imagecopy  or why men don't use maps.
        83306 by: Chris Williams
        83324 by: hugh danaher

Secure User Auth
        83307 by: James Arthur
        83318 by: Viper
        83319 by: James Arthur
        83322 by: Viper

Convert PostgreSQL timestamp to nicer format
        83308 by: James Arthur

Re: [PHP-DB] PHP + Postgresql + Linux = Frustration
        83309 by: James Arthur

IP based redirection
        83310 by: Sweet Shikha
        83311 by: Sweet Shikha

Re: Adding 6 digits to a str?
        83312 by: John Lim

crypt/Password
        83313 by: Phil
        83314 by: Jeff Sheltren
        83315 by: Phil
        83316 by: Jim Winstead

PEAR IMAGICK [WAS-> RANT: Why doesn't PHP have built-in support for dynamic]
        83320 by: Michael Kimsal
        83321 by: Christian Stocker

Talk with a remote script
        83323 by: Alex Shi

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 ---
Give us the exact error message, that probably will hold the answer.

Mike Frazer



"Uma Shankari T." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
>  Hello,
>
>   I am trying to connect php and mysql with the following syntax
>
>  mysql_connect("localhost","username","password");
>
>  But it is giving error NoMysql support.
>
> Also i have stored the files in another webserver and trying to connect
> the  mysql and php in the localhost it is working properly.but it is not
> working if i have tried to connect in the localhost itself
>
>
> Then where is the problem.......
>
>
> -Uma
>


--- End Message ---
--- Begin Message ---
A slightly less cumbersome method than the while() loop below would be a
foreach() loop:

function check_file($filename) {
    if (!$lines = file($filename)) {
        return false;
    }
      foreach ($lines as $line) {
        $num_pipes = substr_count($line, '|');
        if ($num_pipes < 2 || $num_pipes > 4) {
            return false;
        }
    }
    return true;
}

Same result, probably absolutely no measurable (and we're talking fractions
of microseconds here) difference in speed, but much easier to read.

Mike Frazer



"Lars Torben Wilson" <[EMAIL PROTECTED]> wrote in message
1012602758.3230.127.camel@ali">news:1012602758.3230.127.camel@ali...
> On Fri, 2002-02-01 at 14:02, toni baker wrote:
> > I would like to prevent users from uploading a file
> > that contains more than 4 pipes or less than 2 pipes.
> > The code below prevents users from uploading a file
> > containing more than 4 pipes, but not less than 2
> > pipes.  Should I use awk, ereg, or sed?  Thanks
>
> Unless you *have* to spawn processes to do this for you
> for some reason, you can keep things a lot simpler by
> doing it in PHP, something like this:
>
> <?php
> error_reporting(E_ALL);
>
> function check_file($filename) {
>     if (!$upload_file = file($filename)) {
>         return false;
>     }
>     while (list(, $line) = each($upload_file)) {
>         $num_pipes = substr_count($line, '|');
>         if ($num_pipes < 2 || $num_pipes > 4) {
>             return false;
>         }
>     }
>     return true;
> }
>
> $userfile = 'testpipes.txt';
> if (check_file($userfile)) {
>     echo "File passed.\n";
> } else {
>     echo "File failed.\n";
> }
>
> ?>
>
>
> Hope this helps,
>
> Torben
>
> > system ("/bin/cat $userfile|/bin/sed -n
> > 's/.*|.*|.*|.*|.*|/&/p'> pipes.txt;
> > $fd =fopen("pipes.txt", 'r');
> > $pipes5=fgets($fd,50);
> > echo ($pipes5);
> > fclose($fd);
> >
> > if ($pipes5) {
> >   print "wrong number of pipes";
> > }
> >
> > The uploaded file below should not pass but it does:
> >
> > aaaaa|bbbbb|ccccc|ddddd|eeeee
> > aaaaa|bbbbb|ccccc|
> > aaaaa|bbbbb|ccccc|ddddd
> > aaaaa|bbbbb
> > aaaaa|bbbbb|ccccc|ddddd|eeeee
>
> --
>  Torben Wilson <[EMAIL PROTECTED]>
>  http://www.thebuttlesschaps.com
>  http://www.hybrid17.com
>  http://www.inflatableeye.com
>  +1.604.709.0506
>


--- End Message ---
--- Begin Message ---
On Sun, 2002-02-03 at 02:35, Mike Frazer wrote:
> A slightly less cumbersome method than the while() loop below would be a
> foreach() loop:
> 
> function check_file($filename) {
>     if (!$lines = file($filename)) {
>         return false;
>     }
>       foreach ($lines as $line) {
>         $num_pipes = substr_count($line, '|');
>         if ($num_pipes < 2 || $num_pipes > 4) {
>             return false;
>         }
>     }
>     return true;
> }
> 
> Same result, probably absolutely no measurable (and we're talking fractions
> of microseconds here) difference in speed, but much easier to read.

That's a matter of opinion. In general, I've found while() to be 
10-20% faster than foreach(), and the only reason foreach() makes any 
sense to me is because I've got a perl background. The style issue
could be argued for days--go with what works for you.


Torben

> Mike Frazer
> 
> 
> 
> "Lars Torben Wilson" <[EMAIL PROTECTED]> wrote in message
> 1012602758.3230.127.camel@ali">news:1012602758.3230.127.camel@ali...
> > On Fri, 2002-02-01 at 14:02, toni baker wrote:
> > > I would like to prevent users from uploading a file
> > > that contains more than 4 pipes or less than 2 pipes.
> > > The code below prevents users from uploading a file
> > > containing more than 4 pipes, but not less than 2
> > > pipes.  Should I use awk, ereg, or sed?  Thanks
> >
> > Unless you *have* to spawn processes to do this for you
> > for some reason, you can keep things a lot simpler by
> > doing it in PHP, something like this:
> >
> > <?php
> > error_reporting(E_ALL);
> >
> > function check_file($filename) {
> >     if (!$upload_file = file($filename)) {
> >         return false;
> >     }
> >     while (list(, $line) = each($upload_file)) {
> >         $num_pipes = substr_count($line, '|');
> >         if ($num_pipes < 2 || $num_pipes > 4) {
> >             return false;
> >         }
> >     }
> >     return true;
> > }
> >
> > $userfile = 'testpipes.txt';
> > if (check_file($userfile)) {
> >     echo "File passed.\n";
> > } else {
> >     echo "File failed.\n";
> > }
> >
> > ?>
> >
> >
> > Hope this helps,
> >
> > Torben
> >
> > > system ("/bin/cat $userfile|/bin/sed -n
> > > 's/.*|.*|.*|.*|.*|/&/p'> pipes.txt;
> > > $fd =fopen("pipes.txt", 'r');
> > > $pipes5=fgets($fd,50);
> > > echo ($pipes5);
> > > fclose($fd);
> > >
> > > if ($pipes5) {
> > >   print "wrong number of pipes";
> > > }
> > >
> > > The uploaded file below should not pass but it does:
> > >
> > > aaaaa|bbbbb|ccccc|ddddd|eeeee
> > > aaaaa|bbbbb|ccccc|
> > > aaaaa|bbbbb|ccccc|ddddd
> > > aaaaa|bbbbb
> > > aaaaa|bbbbb|ccccc|ddddd|eeeee
> >
> > --
> >  Torben Wilson <[EMAIL PROTECTED]>
> >  http://www.thebuttlesschaps.com
> >  http://www.hybrid17.com
> >  http://www.inflatableeye.com
> >  +1.604.709.0506
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506

--- End Message ---
--- Begin Message ---
Your reply piqued my curiosity so I whipped together a script that times the
execution of a foreach(), a while() and a for() loop executing the same
commands.  The results were rather surprising in some ways but not really
overall.

The while() loop is, as you stated, is quicker than a foreach() loop.
However, the for() loop is the fastest of all three.  Below are the results
of three tests:

Timed foreach() loop: 0.00766 sec.
Timed while() loop: 0.00689 sec.
Timed for() loop: 0.00676 sec.

Timed foreach() loop: 0.00768 sec.
Timed while() loop: 0.00688 sec.
Timed for() loop: 0.00677 sec.

Timed foreach() loop: 0.00770 sec.
Timed while() loop: 0.00689 sec.
Timed for() loop: 0.00674 sec.

The loops were parsing the text in a text file.

Again, we're talking about going down to 13/100,000th-second as an average
speed gain with a for() loop over a while() loop.  The average difference
between foreach() and while() is considerably larger, approximately
79/100,000th.  But again, you'd have to run through the complete execution
of the loop (53 lines of text in the file) 1,266 times to lose a single
second between foreach() and while().  A minimal gain in speed; I was just
mentioning it because it's easier to read a foreach() loop.  But in all
fairness, because the for() loop was quickest, here is the code converted to
for():

function check_file($filename) {
    if (!$lines = file($filename)) {
        return false;
    }
    for ($i = 0; $ < sizeof($lines); $i++) {
        $num_pipes = substr_count($lines[$i], '|');
        if ($num_pipes < 2 || $num_pipes > 4) {
            return false;
        }
    }
    return true;
}


I performed the test purely out of curiosity, not pride :)  Thanks for the
idea though, it was interesting to see the results.

Mike Frazer

PS - If you'd like the code for my Timer class, email me off-list and I'll
send it to you.


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

I feel your pain - I've been dealing with the same thing this week.  I 
finally got the compile to complete and the system up and running, but it 
was painful.  It seemed like everything was finished, but I've noticed high 
server loads (.8), trouble accessing web pages (I tested using wget and it 
had to try 6 times to get the page and kept reporting EOF in headers), and 
my MySQL server keeps reporting errors communicating with the web server, 
and dropped connections to the MySQL server.  Safe to say, something didn't 
work and I need to start over and pray for the best.

Have you gotten it to work properly?  If so, what files did you use and 
what steps did you take in the install?

-Ed


At 11:24 PM 2/2/2002 -0800, Erica Douglass wrote:
>Forgive my grumpiness, but I've spent the last several hours trying to
>install GD, etc.
>
>Let's be honest. PHP needs built-in support for creating dynamic images. JSP
>already has this. Heck, you could even make it a configure option. As it
>stands now, you have to do the following:
>
>-- Install GD
>-- Install all of GD's numerous dependencies
>-- Install zlib
>-- Install freetype
>-- Install libttf
>
>THEN you have to compile PHP with all of the requisite options to enable GD
>here and Freetype there, and PHP often won't compile without specifying
>/path/to/various/options, so you have to dig around your system to find out
>where everything was installed. This results in a long and unwieldy
>configure statement which often does not work.
>
>PHP needs to have a simple configure option called --enable-dynamic-images
>or something similar. This should use built-in libraries that are downloaded
>with the PHP source to create PNG images. Images can then be created with
>standard PHP functions. This would be much more useful than relying on
>several third-party solutions which do not easily work with each other. This
>would also have the benefit of being more portable -- as I plan to release
>my code to several different people running different types of servers, I
>would like to minimize compatibility issues.
>
>If anyone has a better solution, feel free to email me. As it stands, I am
>very frustrated with this, and I haven't yet seen the light at the end of
>the tunnel.
>
>Thanks,
>Erica
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---

Anybody interested in working on a PEAR module to interface PHP with
something like ImageMagick directly? I would love to see it. Maybe if I am
unemployed long enough soon I can work on it myself. Not that I really want
that to happen...

I think that might be the best solution for PHP's lack of image
functionality though...

Wes



> Hi Erica,
> 
> I feel your pain - I've been dealing with the same thing this week.  I
> finally got the compile to complete and the system up and running, but it
> was painful.  It seemed like everything was finished, but I've noticed high
> server loads (.8), trouble accessing web pages (I tested using wget and it
> had to try 6 times to get the page and kept reporting EOF in headers), and
> my MySQL server keeps reporting errors communicating with the web server,
> and dropped connections to the MySQL server.  Safe to say, something didn't
> work and I need to start over and pray for the best.
> 
> Have you gotten it to work properly?  If so, what files did you use and
> what steps did you take in the install?
> 
> -Ed
> 
> 
> At 11:24 PM 2/2/2002 -0800, Erica Douglass wrote:
>> Forgive my grumpiness, but I've spent the last several hours trying to
>> install GD, etc.
>> 
>> Let's be honest. PHP needs built-in support for creating dynamic images. JSP
>> already has this. Heck, you could even make it a configure option. As it
>> stands now, you have to do the following:
>> 
>> -- Install GD
>> -- Install all of GD's numerous dependencies
>> -- Install zlib
>> -- Install freetype
>> -- Install libttf
>> 
>> THEN you have to compile PHP with all of the requisite options to enable GD
>> here and Freetype there, and PHP often won't compile without specifying
>> /path/to/various/options, so you have to dig around your system to find out
>> where everything was installed. This results in a long and unwieldy
>> configure statement which often does not work.
>> 
>> PHP needs to have a simple configure option called --enable-dynamic-images
>> or something similar. This should use built-in libraries that are downloaded
>> with the PHP source to create PNG images. Images can then be created with
>> standard PHP functions. This would be much more useful than relying on
>> several third-party solutions which do not easily work with each other. This
>> would also have the benefit of being more portable -- as I plan to release
>> my code to several different people running different types of servers, I
>> would like to minimize compatibility issues.
>> 
>> If anyone has a better solution, feel free to email me. As it stands, I am
>> very frustrated with this, and I haven't yet seen the light at the end of
>> the tunnel.
>> 
>> Thanks,
>> Erica
>> 
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
PEAR? I think it would be better if someone did a "real" PHP module for ImageMagick, 
just like PerlMagick is for Perl. There is one at http://php.chregu.tv/imagick/, but 
it's far from complete. If someone would like to help him with the project then it 
would be great.

ImageMagick is so much easier to install than GD, and it's a lot better too.

// Victor.

----- Original Message ----- 
From: "Weston Houghton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 03, 2002 8:45 AM
Subject: Re: [PHP] RANT: Why doesn't PHP have built-in support for dynamic image 
generation?


> 
> Anybody interested in working on a PEAR module to interface PHP with
> something like ImageMagick directly? I would love to see it. Maybe if I am
> unemployed long enough soon I can work on it myself. Not that I really want
> that to happen...
> 
> I think that might be the best solution for PHP's lack of image
> functionality though...
> 
> Wes
> 
> 
> 
> > Hi Erica,
> >
> > I feel your pain - I've been dealing with the same thing this week.  I
> > finally got the compile to complete and the system up and running, but it
> > was painful.  It seemed like everything was finished, but I've noticed high
> > server loads (.8), trouble accessing web pages (I tested using wget and it
> > had to try 6 times to get the page and kept reporting EOF in headers), and
> > my MySQL server keeps reporting errors communicating with the web server,
> > and dropped connections to the MySQL server.  Safe to say, something didn't
> > work and I need to start over and pray for the best.
> >
> > Have you gotten it to work properly?  If so, what files did you use and
> > what steps did you take in the install?
> >
> > -Ed
> >
> >
> > At 11:24 PM 2/2/2002 -0800, Erica Douglass wrote:
> >> Forgive my grumpiness, but I've spent the last several hours trying to
> >> install GD, etc.
> >>
> >> Let's be honest. PHP needs built-in support for creating dynamic images. JSP
> >> already has this. Heck, you could even make it a configure option. As it
> >> stands now, you have to do the following:
> >>
> >> -- Install GD
> >> -- Install all of GD's numerous dependencies
> >> -- Install zlib
> >> -- Install freetype
> >> -- Install libttf
> >>
> >> THEN you have to compile PHP with all of the requisite options to enable GD
> >> here and Freetype there, and PHP often won't compile without specifying
> >> /path/to/various/options, so you have to dig around your system to find out
> >> where everything was installed. This results in a long and unwieldy
> >> configure statement which often does not work.
> >>
> >> PHP needs to have a simple configure option called --enable-dynamic-images
> >> or something similar. This should use built-in libraries that are downloaded
> >> with the PHP source to create PNG images. Images can then be created with
> >> standard PHP functions. This would be much more useful than relying on
> >> several third-party solutions which do not easily work with each other. This
> >> would also have the benefit of being more portable -- as I plan to release
> >> my code to several different people running different types of servers, I
> >> would like to minimize compatibility issues.
> >>
> >> If anyone has a better solution, feel free to email me. As it stands, I am
> >> very frustrated with this, and I haven't yet seen the light at the end of
> >> the tunnel.
> >>
> >> Thanks,
> >> Erica
> >>
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
--- End Message ---
--- Begin Message ---
In <[EMAIL PROTECTED]>, Victor Boivie wrote:

> PEAR? I think it would be better if someone did a "real" PHP module for
> ImageMagick, just like PerlMagick is for Perl. There is one at
> http://php.chregu.tv/imagick/, but it's far from complete. If someone
> would like to help him with the project then it would be great.

yeah. do it :)

chregu
--- End Message ---
--- Begin Message ---
How many emails per hour can people generate on a typical dedicated server?
on qmail? on smtp?


----- Original Message -----
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: "Ed Lazor" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, February 02, 2002 9:09 PM
Subject: Re: [PHP] Re: Sending an e-mail to 1,000 people


> Hello,
>
> Ed Lazor wrote:
> >
> > At 06:25 PM 2/2/2002 -0500, Chris Cocuzzo wrote:
> > >Godamnit. Shut-up about this already for godsakes and answer the
> > >original question!!
> >
> > LOL  hehe good point Chris.
>
> Aleluia, somebody sensible! :-)
>
>
> > >"Ben Clumeck" <[EMAIL PROTECTED]> wrote in message
> > > > I would like to send an e-mail (the same e-mail) to 1,000 different
> > > > people.  I want each persons name to be in the "To:" field.  Is
there a
> > > way to
> > > > customize it to where it can say Dear____ (having a different
persons name
> > > > corresponding to an e-mail address) so that it looks customized.
> >
> > Ben, how you approach this will depend on how you have the data
> > stored.  Let's assume two things:  you have the e-mail addresses and
names
> > in a database and know how to retrieve and store them into the variables
> > $email and $name.  That said, create the body of your text:
> >
> > $body = "
> > Dear $name,
> >
> > Here are recent developments on our web site... etc.
> > ";
> >
> > Then use the mail function
(http://www.php.net/manual/en/function.mail.php)
> > to send the letter to the person like this:
> >
> > mail($email, "Site update", $body, "From:  [EMAIL PROTECTED]");
> >
> > The next thing you'll probably start wondering is how to send fancy
e-mail
> > instead of those generic text based ones...  PHPBuilder has an article
> > you'll want to check out located here:
> > http://www.phpbuilder.com/columns/kartic20000807.php3.
>
> I do not advice anybody to send personalized bulk mail, even less in
> PHP. It will take a lot of time to just queue the message in the local
> relay mail server and since each message has to be stored separately in
> the mail server queue disk consuming a lot of space.
>
> What I recommend is to just queue a single message with all recepients
> in Bcc:. This is better done with qmail using qmail-inject because you
> do not have to actually add Bcc: headers to the message, just the
> recipients addresses, one per line,  and then headers and the body of
> the message. You may want to try this class for composing and sending
> MIME messages. It has subclasses for queing with PHP mail function, SMTP
> server, sendmail and qmail.
>
> http://phpclasses.upperdesign.com/browse.html/package/9
>
> If you can use it, I recommend to use qmail because it is much faster
> than the other alternatives to queue message to be sent to many
> recipients and also provides very good means to figure exactly which
> addresses are bouncing your messages so you can process them eventually
> unsubscribing the users in question, thanks to its VERP capability
> (Variable Envelope Return Path). http://www.qmail.org/
>
> If you want to send messages regularly to the same group of users, I
> recommend that you use ezmlm-idx because it provides very efficient and
> secure way to handle subscriptions and messages bouncings.
> http://www.ezmlm.org/
>
> I don't recommend the patches of ezmlm that let it be interfaced with
> user lists maintained in MySQL or PostgreSQL. I doubt that those
> databases are faster to query than DJB's cdb user list databases. Also,
> I don't think that most people want the user to be deleted from a
> database if it's address is bouncing for too long (11 days).
>
> Anyway, you may want to look into this PHP web interface to create and
> setup options of ezmlm mailing lists. It also comes with a SOAP server
> interface that you can use to provide Web services to subscribe,
> unsubscriber, verify and count users in ezmlm mailing lists.
>
> http://phpclasses.upperdesign.com/browse.html/package/177
>
> Regards,
> Manuel Lemos
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

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

B Richards wrote:
> 
> How many emails per hour can people generate on a typical dedicated server?
> on qmail? on smtp?

It depends on many things. Anyway, queueing is one thing and delivering
is another. Queuing and delivering from the same machine is usually slow
because it requires the server to resolve the domain and connecting with
each recipient MX to deliver the messages. If the connection is slow,
everything is stalled.

For very large recipient lists like large mailing lists sites like
eGroups, the recommended setup is at least one server for queuing the
messages in one or many others. The queuing is best achieved using QMQP.
SMTP is too slow because it degrades queuing speed exponentially with
the number of recipients.

Anyway in a network with one server for queueing (where ezmlm was) and 8
servers for delivery, it could queue 10.000 messages per minute using
SMTP. With QMQP it would be much faster queueing because it would not
expand VERP addresses and would only queue one message in the delivery
servers.

The actual delivery it depends a lot on the Internet link you have and
the connectivity with the remote servers. Bouncing and hard to connect
servers make it very slow. That is why it is important to prune the
bouncing addresses from your mailing lists.

ezmlm process is reasonably good handling bounces but I would not
recommend starting a mailing list with a large number of subscribers
without first pruning it because the last retry message that is sent to
all bouncing addresses after 11 days (1.000.000 seconds) may choke your
queuing server because it send out individual messages and if there are
many bouncing addresses that can make your machine and network choke
with very high traffic.

Trust me, I had to put up with the embarrassment of choking a newsletter
server with 1/3 of near 300.000 subscribers of MTV Brasil newsletter!
Can you imagine almost 100.000 subscribers being mailed and bouncing at
the same time. (Gulp!) Living and learning. :-)


Regards,
Manuel Lemos
> 
> ----- Original Message -----
> From: "Manuel Lemos" <[EMAIL PROTECTED]>
> To: "Ed Lazor" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, February 02, 2002 9:09 PM
> Subject: Re: [PHP] Re: Sending an e-mail to 1,000 people
> 
> > Hello,
> >
> > Ed Lazor wrote:
> > >
> > > At 06:25 PM 2/2/2002 -0500, Chris Cocuzzo wrote:
> > > >Godamnit. Shut-up about this already for godsakes and answer the
> > > >original question!!
> > >
> > > LOL  hehe good point Chris.
> >
> > Aleluia, somebody sensible! :-)
> >
> >
> > > >"Ben Clumeck" <[EMAIL PROTECTED]> wrote in message
> > > > > I would like to send an e-mail (the same e-mail) to 1,000 different
> > > > > people.  I want each persons name to be in the "To:" field.  Is
> there a
> > > > way to
> > > > > customize it to where it can say Dear____ (having a different
> persons name
> > > > > corresponding to an e-mail address) so that it looks customized.
> > >
> > > Ben, how you approach this will depend on how you have the data
> > > stored.  Let's assume two things:  you have the e-mail addresses and
> names
> > > in a database and know how to retrieve and store them into the variables
> > > $email and $name.  That said, create the body of your text:
> > >
> > > $body = "
> > > Dear $name,
> > >
> > > Here are recent developments on our web site... etc.
> > > ";
> > >
> > > Then use the mail function
> (http://www.php.net/manual/en/function.mail.php)
> > > to send the letter to the person like this:
> > >
> > > mail($email, "Site update", $body, "From:  [EMAIL PROTECTED]");
> > >
> > > The next thing you'll probably start wondering is how to send fancy
> e-mail
> > > instead of those generic text based ones...  PHPBuilder has an article
> > > you'll want to check out located here:
> > > http://www.phpbuilder.com/columns/kartic20000807.php3.
> >
> > I do not advice anybody to send personalized bulk mail, even less in
> > PHP. It will take a lot of time to just queue the message in the local
> > relay mail server and since each message has to be stored separately in
> > the mail server queue disk consuming a lot of space.
> >
> > What I recommend is to just queue a single message with all recepients
> > in Bcc:. This is better done with qmail using qmail-inject because you
> > do not have to actually add Bcc: headers to the message, just the
> > recipients addresses, one per line,  and then headers and the body of
> > the message. You may want to try this class for composing and sending
> > MIME messages. It has subclasses for queing with PHP mail function, SMTP
> > server, sendmail and qmail.
> >
> > http://phpclasses.upperdesign.com/browse.html/package/9
> >
> > If you can use it, I recommend to use qmail because it is much faster
> > than the other alternatives to queue message to be sent to many
> > recipients and also provides very good means to figure exactly which
> > addresses are bouncing your messages so you can process them eventually
> > unsubscribing the users in question, thanks to its VERP capability
> > (Variable Envelope Return Path). http://www.qmail.org/
> >
> > If you want to send messages regularly to the same group of users, I
> > recommend that you use ezmlm-idx because it provides very efficient and
> > secure way to handle subscriptions and messages bouncings.
> > http://www.ezmlm.org/
> >
> > I don't recommend the patches of ezmlm that let it be interfaced with
> > user lists maintained in MySQL or PostgreSQL. I doubt that those
> > databases are faster to query than DJB's cdb user list databases. Also,
> > I don't think that most people want the user to be deleted from a
> > database if it's address is bouncing for too long (11 days).
> >
> > Anyway, you may want to look into this PHP web interface to create and
> > setup options of ezmlm mailing lists. It also comes with a SOAP server
> > interface that you can use to provide Web services to subscribe,
> > unsubscriber, verify and count users in ezmlm mailing lists.
> >
> > http://phpclasses.upperdesign.com/browse.html/package/177
> >
> > Regards,
> > Manuel Lemos
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Hello,

B Richards wrote:
> 
> How many emails per hour can people generate on a typical dedicated server?
> on qmail? on smtp?

It depends on many things. Anyway, queueing is one thing and delivering
is another. Queuing and delivering from the same machine is usually slow
because it requires the server to resolve the domain and connecting with
each recipient MX to deliver the messages. If the connection is slow,
everything is stalled.

For very large recipient lists like large mailing lists sites like
eGroups, the recommended setup is at least one server for queuing the
messages in one or many others. The queuing is best achieved using QMQP.
SMTP is too slow because it degrades queuing speed exponentially with
the number of recipients.

Anyway in a network with one server for queueing (where ezmlm was) and 8
servers for delivery, it could queue 10.000 messages per minute using
SMTP. With QMQP it would be much faster queueing because it would not
expand VERP addresses and would only queue one message in the delivery
servers.

The actual delivery it depends a lot on the Internet link you have and
the connectivity with the remote servers. Bouncing and hard to connect
servers make it very slow. That is why it is important to prune the
bouncing addresses from your mailing lists.

ezmlm process is reasonably good handling bounces but I would not
recommend starting a mailing list with a large number of subscribers
without first pruning it because the last retry message that is sent to
all bouncing addresses after 11 days (1.000.000 seconds) may choke your
queuing server because it send out individual messages and if there are
many bouncing addresses that can make your machine and network choke
with very high traffic.

Trust me, I had to put up with the embarrassment of choking a newsletter
server with 1/3 of near 300.000 subscribers of MTV Brasil newsletter!
Can you imagine almost 100.000 subscribers being mailed and bouncing at
the same time. (Gulp!) Living and learning. :-)


Regards,
Manuel Lemos
> 
> ----- Original Message -----
> From: "Manuel Lemos" <[EMAIL PROTECTED]>
> To: "Ed Lazor" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, February 02, 2002 9:09 PM
> Subject: Re: [PHP] Re: Sending an e-mail to 1,000 people
> 
> > Hello,
> >
> > Ed Lazor wrote:
> > >
> > > At 06:25 PM 2/2/2002 -0500, Chris Cocuzzo wrote:
> > > >Godamnit. Shut-up about this already for godsakes and answer the
> > > >original question!!
> > >
> > > LOL  hehe good point Chris.
> >
> > Aleluia, somebody sensible! :-)
> >
> >
> > > >"Ben Clumeck" <[EMAIL PROTECTED]> wrote in message
> > > > > I would like to send an e-mail (the same e-mail) to 1,000 different
> > > > > people.  I want each persons name to be in the "To:" field.  Is
> there a
> > > > way to
> > > > > customize it to where it can say Dear____ (having a different
> persons name
> > > > > corresponding to an e-mail address) so that it looks customized.
> > >
> > > Ben, how you approach this will depend on how you have the data
> > > stored.  Let's assume two things:  you have the e-mail addresses and
> names
> > > in a database and know how to retrieve and store them into the variables
> > > $email and $name.  That said, create the body of your text:
> > >
> > > $body = "
> > > Dear $name,
> > >
> > > Here are recent developments on our web site... etc.
> > > ";
> > >
> > > Then use the mail function
> (http://www.php.net/manual/en/function.mail.php)
> > > to send the letter to the person like this:
> > >
> > > mail($email, "Site update", $body, "From:  [EMAIL PROTECTED]");
> > >
> > > The next thing you'll probably start wondering is how to send fancy
> e-mail
> > > instead of those generic text based ones...  PHPBuilder has an article
> > > you'll want to check out located here:
> > > http://www.phpbuilder.com/columns/kartic20000807.php3.
> >
> > I do not advice anybody to send personalized bulk mail, even less in
> > PHP. It will take a lot of time to just queue the message in the local
> > relay mail server and since each message has to be stored separately in
> > the mail server queue disk consuming a lot of space.
> >
> > What I recommend is to just queue a single message with all recepients
> > in Bcc:. This is better done with qmail using qmail-inject because you
> > do not have to actually add Bcc: headers to the message, just the
> > recipients addresses, one per line,  and then headers and the body of
> > the message. You may want to try this class for composing and sending
> > MIME messages. It has subclasses for queing with PHP mail function, SMTP
> > server, sendmail and qmail.
> >
> > http://phpclasses.upperdesign.com/browse.html/package/9
> >
> > If you can use it, I recommend to use qmail because it is much faster
> > than the other alternatives to queue message to be sent to many
> > recipients and also provides very good means to figure exactly which
> > addresses are bouncing your messages so you can process them eventually
> > unsubscribing the users in question, thanks to its VERP capability
> > (Variable Envelope Return Path). http://www.qmail.org/
> >
> > If you want to send messages regularly to the same group of users, I
> > recommend that you use ezmlm-idx because it provides very efficient and
> > secure way to handle subscriptions and messages bouncings.
> > http://www.ezmlm.org/
> >
> > I don't recommend the patches of ezmlm that let it be interfaced with
> > user lists maintained in MySQL or PostgreSQL. I doubt that those
> > databases are faster to query than DJB's cdb user list databases. Also,
> > I don't think that most people want the user to be deleted from a
> > database if it's address is bouncing for too long (11 days).
> >
> > Anyway, you may want to look into this PHP web interface to create and
> > setup options of ezmlm mailing lists. It also comes with a SOAP server
> > interface that you can use to provide Web services to subscribe,
> > unsubscriber, verify and count users in ezmlm mailing lists.
> >
> > http://phpclasses.upperdesign.com/browse.html/package/177
> >
> > Regards,
> > Manuel Lemos
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Good day, morning, night? It's dark, so that makes it sleepy bye time.
Bit before I do, I'm trying to work this out.
I have a little bit of code to print Next n>> articles in my database.
Can someone help me straighten out these lines of code, pretty please
... before I go fleeping nuts :)

if(!$rendu)
{
$rendu = 0;
}
$nombre = 10;

$news = mysql_query("select * from $table ORDER by DT desc");
$num_rows = mysql_num_rows($news);

$nouveau = $rendu + $nombre;
if ($nouveau < $num_rows)
{
    if ($nombre < $num_rows)
    {
    $nouveau = $num_rows - $nombre;
    #when there are 23 articles, and I am number 20 on the screen, I
want to display the remaining 3, not ten.
    }
$myinsert  = " <font face=\"arial\" size=2><A
HREF=\"index.html?rendu=".$nouveau."\">Next ".$nouveau." Articles
&gt;&gt;</a></font>\n";

}

John

################################################################################

<?php

if(!$rendu)
{
$rendu = 0;
}
$nombre = 10;

################################################################
#$myconnection = mysql_pconnect($server,$user,$pass);
 $myconnection = mysql_connect($server,$user,$pass);

 mysql_select_db($db,$myconnection);

 $news = mysql_query("SHOW TABLE STATUS FROM ".$db." LIKE '$table'");
 while ($news_story = mysql_fetch_array($news))
  {
         $table_comment = $news_story['Comment'];
  }

$news = mysql_query("select * from $table ORDER by DT desc");
$num_rows = mysql_num_rows($news);

$news = mysql_query("select * from $table ORDER by DT desc LIMIT
$rendu,$nombre");

$old_WHO = "";

 while ($mydata = mysql_fetch_object($news))
      {
 $mydata->RQ = str_replace("\r", "", $mydata->RQ);
 $mydata->RQ = str_replace("\n", "<br>", $mydata->RQ);
 $mydata->RQ = str_replace("<br><br>", "<p>", $mydata->RQ);
 $mydata->CM = str_replace("\r", "", $mydata->CM);
 $mydata->CM = str_replace("\n", "<br>", $mydata->CM);
 $mydata->CM = str_replace("<br><br>", "<p>", $mydata->CM);

 ############### Display WHO Once ########
 if ($old_WHO != $mydata->WHO) #when WHO occurs the first time, echo it
once only.
        {
        $old_WHO = $mydata->WHO;
        $body .= "<b>From ".$mydata->WHO.":</b>";
        }
 ############## Description ###############
 if($mydata->RQ)
 $body .= "<ol>".$mydata->RQ."</ol>\n";
 ############## Description ###############
 if($mydata->CM)
 $body .= "<ol><small>".$mydata->DT." - <font
color=\"blue\"><i>".$mydata->CM."</i></font></small></ol><br>\n";

 }#end of while
 mysql_close($myconnection);


#####################################################
$nouveau = $rendu + $nombre;
if ($nouveau < $num_rows)
{
if ($nouveau < $num_rows)
{
$nouveau = $num_rows - $nouveau ;
}
$myinsert  = " <font face=\"arial\" size=2><A
HREF=\"index.html?rendu=".$nouveau."\">Next ".$nouveau." Articles
&gt;&gt;</a></font>\n";

}
#####################################################

echo "<h2 align=center>".$table_comment."</h2>
<ul>
<h3>$course_description</h3>
.. $myinsert<br>
.. $num_rows<br>
.. $nouveau = $rendu + $nombre<br>
if ($nouveau < $num_rows)<br>
<ol>
$body
</ol>
<hr>
</ul>";

?>

--- End Message ---
--- Begin Message ---
In article <Pine.LNX.4.21.0202030030140.29558-
[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> 
> 
> Hello,
> 
>   I have installed php and mysql in my machine.By default in which path
> php check for mysql
> 
> Anyone can know this tell to me as soon as possible

This question is a bit hard to answer without knowing what system 
(Windows, *nix etc) and how you installed - eg source. rpm, binary 
install.

-- 
David Robley
Temporary Kiwi!
--- End Message ---
--- Begin Message ---
In article <Pine.LNX.4.21.0202030112050.30779-
[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> 
> 
> 
> Actually i have stored mysql in my machine in /usr/lib/mysql
> 
>  when i am tried to connect it is giving this error.
> 
> nomysql support.From the prompt itself i can connect to mysql .using php
> script i can't connect.
> 
> While in the installtion also i have mentioned the path for mysql
> 
> I couldn't guess where is the error
> 
> 
> Can u guess where is the error?.
> 
> 
> If u came to know this tell me as soon as possible
> 
> -Uma
> 
> 
> On Sat, 2 Feb 2002, David Jackson wrote:
> 
> > should be /usr/local/mysql.
> > 
> > "Uma Shankari T." wrote:
> > > 
> > > Hello,
> > > 
> > >   I have installed php and mysql in my machine.By default in which path
> > > php check for mysql
> > > 
> > > Anyone can know this tell to me as soon as possible
> > > 
> > > -Uma

This seems to be an ongoing case of you aren't quite understanding or 
listening to what you are being advised. If in fact you have installed 
mysql in /usr/lib/mysql (which seems an odd place) then configuring php 
with

--with-mysql=/usr/lib/mysql

should work. And as I think you have been advised, looking at a script 
with phpinfo() in it should tell you what stuff your compile has 
successfully included.


-- 
David Robley
Temporary Kiwi!
--- End Message ---
--- Begin Message ---
Hi

1. Can anyone help with inserting jpeg  images into a interbase database
from a php page?
2. What does this  error message mean:
Warning: InterBase module: invalid blob id

3.Must the subtype be set to 0  or must it be user-defined in interbase?
 ie  User defined:     "JPEG" BLOB SUB_TYPE -2 SEGMENT SIZE 100,
4. Can the segment size be 100? What does the segment size refer to?
5. How do I display/output the images from the database on a php page.


Thanks!
Sonya

--- End Message ---
--- Begin Message ---
Thanks Joel.  I thought Sandeep meant I should create object A within object
B in order to refer to the method in object A, but I guess that won't work.

David

----- Original Message -----
From: "Joel Boonstra" <[EMAIL PROTECTED]>
To: "Sandeep Murphy" <[EMAIL PROTECTED]>
Cc: "'David Yee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, January 28, 2002 12:07 PM
Subject: RE: [PHP] How to call method from another class


> > first create an instance of class B like this...
> >
> > $test = new classB();
> >
> > Now, u can refer to any function or method of classB like this:
> >
> > $test->hello(); // where hello() is a method of classB..
>
> That's not what the original question was, though.  David (I think, unless
> I got my nested replies wrong), was looking to call a method of ClassA
> with an object of ClassB:
>
> > > If I have a PHP class (let's say it's called ClassA), how do I call a
> > > method from another class (ClassB) within ClassA?  Thanks.
>
> The answer to this question, unless my OOP theory is gone, is that you
> can't, unless ClassB is an extension of classA.
>
> So if you have:
>
> class ClassA {
>   // some vars
>   function get_contents() {
>     // some stuff
>     return $something;
>   }
> }
>
> and then:
>
> class ClassB extends ClassA {
>   // some vars
>   function display_contents() {
>     print $this->get_contents();
>   }
> }
>
> Then you're good.  Otherwise, I don't think it's possible...
>
> --
> [ joel boonstra | [EMAIL PROTECTED] ]
>
>

--- End Message ---
--- Begin Message ---
I think you might need to use

$source = ImageCreateFromJPEG('map1.jpg');

I've created several maps using this method, although I am using PNG. You
could see them at our web site but unfortunatly it's not parsing PHP
correctly. Something went wrong during migration, but might be fixed in a
couple of days.

"Hugh Danaher" <[EMAIL PROTECTED]> wrote in message
000801c1ac61$a1d858c0$0100007f@localhost">news:000801c1ac61$a1d858c0$0100007f@localhost...
Help!

I have an image file which is a map of the local area.  I want to put
symbols on the map at various points, but I first need to get the php image
function to work.
My site has imaging enabled and I can create graphs from scratch, but this
has stumped me so far.

Any help will be greatly appreciated.

Hugh

code? below:

$image=imagecreate(400,400);  // created image

                                        // source image info
$source="map1.jpg";
$imageinfo = getimagesize($source);
$source_00=0;                   //  origin (0,0)
$source_width=$imageinfo[0];
$source_height-$imageinfo[1];
$image_00=0;                   //  origin (0,0)


imagecopy($image,$source, $image_00, $image_00, $source_00, $source_00,
$source_width, $source_height);              / / this is line 36.



Warning: Supplied argument is not a valid Image resource in
/www/site.com/somepage.php on line 36




--- End Message ---
--- Begin Message ---
Chris,
Thank you for your help.  I actually found an example on web monkey late
last night for .gif and made the translation to .jpg.  However, whatever
color text I use, it turns out gray.  Any help here would go down nicely.

Hugh


----- Original Message -----
From: "Chris Williams" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 03, 2002 8:29 AM
Subject: [PHP] Re: imagecopy or why men don't use maps.


> I think you might need to use
>
> $source = ImageCreateFromJPEG('map1.jpg');
>
> I've created several maps using this method, although I am using PNG. You
> could see them at our web site but unfortunatly it's not parsing PHP
> correctly. Something went wrong during migration, but might be fixed in a
> couple of days.
>
> "Hugh Danaher" <[EMAIL PROTECTED]> wrote in message
> 000801c1ac61$a1d858c0$0100007f@localhost">news:000801c1ac61$a1d858c0$0100007f@localhost...
> Help!
>
> I have an image file which is a map of the local area.  I want to put
> symbols on the map at various points, but I first need to get the php
image
> function to work.
> My site has imaging enabled and I can create graphs from scratch, but this
> has stumped me so far.
>
> Any help will be greatly appreciated.
>
> Hugh
>
> code? below:
>
> $image=imagecreate(400,400);  // created image
>
>                                         // source image info
> $source="map1.jpg";
> $imageinfo = getimagesize($source);
> $source_00=0;                   //  origin (0,0)
> $source_width=$imageinfo[0];
> $source_height-$imageinfo[1];
> $image_00=0;                   //  origin (0,0)
>
>
> imagecopy($image,$source, $image_00, $image_00, $source_00, $source_00,
> $source_width, $source_height);              / / this is line 36.
>
>
>
> Warning: Supplied argument is not a valid Image resource in
> /www/site.com/somepage.php on line 36
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

I have a web site that needs a secure login system.

Users of the system can SSH in to the server, and POP, IMAP, Postgres and 
other services are provided, and I'd like the users to be able to log in to 
the site - obviously as securely as possible. Maybe using SSL + sessions?

I have not used SSL or HTTPS before, and certainly not with PHP. Can anyone 
give me any suggestions?

Thanks

--jaa

--- End Message ---
--- Begin Message ---
Well it depends what you want to do, Do they need to just get into the app or 
do they need to have different access levels? If they dont need access levels 
just use htaccess that should work out fine.

-=>Adam<=-

Quoting James Arthur <[EMAIL PROTECTED]>:

> Hi
> 
> I have a web site that needs a secure login system.
> 
> Users of the system can SSH in to the server, and POP, IMAP, Postgres and 
> other services are provided, and I'd like the users to be able to log in to
> 
> the site - obviously as securely as possible. Maybe using SSL + sessions?
> 
> I have not used SSL or HTTPS before, and certainly not with PHP. Can anyone
> 
> give me any suggestions?
> 
> Thanks
> 
> --jaa
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 




-----------------------------------------
http://www.2ghz.net/
Welcome To the Future
--- End Message ---
--- Begin Message ---
On Sunday 03 Feb 2002 17:43, Viper wrote:
> Well it depends what you want to do, Do they need to just get into the app
> or do they need to have different access levels? If they dont need access
> levels just use htaccess that should work out fine.
>

htaccess isn't secure enough, since it sends the password in plain text to 
the server. Besides, the users already have accounts on the server, so it 
would make more sense to authenticate against an existing system, like 
IMAP/POP3. Doing that's easy enough, and also has the side effect that when 
they log in it tells them whether they have new mail or not.

The problem is finding a way to enter login details that does not send the 
password across the internet in plain text mode. The only way seems to use 
SSL, but I don't know how to implement it.

--jaa
--- End Message ---
--- Begin Message ---
It wont matter if it is sent in clear text because at that point you are over 
https/SSL. The entire stream is encrypted. I understand the need for using the 
existing system. I think LDAP does look like a good way to go. 

-=>Adam<=-

Quoting James Arthur <[EMAIL PROTECTED]>:

> On Sunday 03 Feb 2002 17:43, Viper wrote:
> > Well it depends what you want to do, Do they need to just get into the
> app
> > or do they need to have different access levels? If they dont need access
> > levels just use htaccess that should work out fine.
> >
> 
> htaccess isn't secure enough, since it sends the password in plain text to 
> the server. Besides, the users already have accounts on the server, so it 
> would make more sense to authenticate against an existing system, like 
> IMAP/POP3. Doing that's easy enough, and also has the side effect that when
> 
> they log in it tells them whether they have new mail or not.
> 
> The problem is finding a way to enter login details that does not send the 
> password across the internet in plain text mode. The only way seems to use 
> SSL, but I don't know how to implement it.
> 
> --jaa
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 




-----------------------------------------
http://www.2ghz.net/
Welcome To the Future
--- End Message ---
--- Begin Message ---
Hi

How can I convert the PostgreSQL timestamp to several strings? This sort of 
thing:

array($hour,$minute,$second,$day,$month,$year) = convert($timestamp)

Thanks

--jaa

--- End Message ---
--- Begin Message ---
> >
> >Is there an easy way to do this sort of stuff on Linux or is it better to
> >just buy off the shelf products that work?

Hi

I hate to do the "my distro is better than yours" thing, but typing "apt-get 
install postgresql postgresql-client apache php4 php4-pgsql" at the command 
line on a Debian system will download and install it all automatically for 
you. Just configure the postgres settings to how you want them, edit the 
php.ini and httpd.conf files and that's it.

I run a debian-based system at home with postgresql, apache and PHP4, and 
I've also set up web servers with this configuration on Debian boxes. If 
you're looking for ease-of-maintainence of a Linux server, then Debian is 
really the one you want to look at.

--jaa

--- End Message ---
--- Begin Message ---
Could you please tell us:We would like to redirect the
user based on their
Country so we are collecting their IP address. We have
used SmartRedirect PHP software to do this but on some
of our ISP it is not working, it shows you are from
unknown country. We are located at New Delhi, India.
Could you please tell us how we can do this in
smartand effective way.

Thanks,

Shikha

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com
--- End Message ---
--- Begin Message ---

Could you please tell us:

We would like to redirect the user based on their
Country so we are collecting their IP address. We have
used SmartRedirect PHP software to do this but on some
of our ISP it is not working, it shows you are from
unknown country. We are located at New Delhi, India.

Could you please tell us how we can do this in smart
and effective way.

Thanks,

Shikha

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com
--- End Message ---
--- Begin Message ---
Try http://php.net/str_pad

Andy <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi guys,
>
> I am trying to force a int to be 8 digits. If it is only 3 dig filling the
> first ones with 0.
>
> Anyhow I tryed it with type casting, but it does not matter what I try, I
> always get an addition.
>
> E.g:
>   $member_id is: 136
>    should be: 00000136
>
> Here is the code, which is still returning 136:
>
>    for($i=0;$i<count($member_id);$i++){
>        $length = strlen($member_id[$i]);
>
>         settype ($member_id[$i], "string");
>         $zero = '0';
>         settype ($zero, "string");
>
>         $member_id[$i] = $zero + $member_id[$i];
>         echo $member_id[$i];
>    }
>
> Does anybody know how to solve this thing??
>
> Thanx Andy
>
>
>
>


--- End Message ---
--- Begin Message ---
Hi there,
I'm creating a user/password table that will use either Mysql Password or
PHP Crypt function to encrypt the data. I know these functions are non
reversible for good reason, but how do I deal with a situation where I want
to email out a forgotton password? How can I get the passwrd back to a form
recognisable to the user?
Thanx in advance
Phil


--- End Message ---
--- Begin Message ---
What you could do is send a newly generated password to them, and then 
allow them to change the password on your site to something easier to 
remember...

Jeff

At 11:56 PM 2/3/2002 +0800, Phil wrote:
>Hi there,
>I'm creating a user/password table that will use either Mysql Password or
>PHP Crypt function to encrypt the data. I know these functions are non
>reversible for good reason, but how do I deal with a situation where I want
>to email out a forgotton password? How can I get the passwrd back to a form
>recognisable to the user?
>Thanx in advance
>Phil


--- End Message ---
--- Begin Message ---
Thanx, sounds like the way to go.
Still curious though whether there is anyway at all to get the original
password back to the user?

Jeff Sheltren <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What you could do is send a newly generated password to them, and then
> allow them to change the password on your site to something easier to
> remember...
>
> Jeff
>
> At 11:56 PM 2/3/2002 +0800, Phil wrote:
> >Hi there,
> >I'm creating a user/password table that will use either Mysql Password or
> >PHP Crypt function to encrypt the data. I know these functions are non
> >reversible for good reason, but how do I deal with a situation where I
want
> >to email out a forgotton password? How can I get the passwrd back to a
form
> >recognisable to the user?
> >Thanx in advance
> >Phil
>
>


--- End Message ---
--- Begin Message ---
Phil <[EMAIL PROTECTED]> wrote:
> Thanx, sounds like the way to go.
> Still curious though whether there is anyway at all to get the original
> password back to the user?

not without storing it unencrypted or cracking the password with a
dictionary attack. as you said, the php crypt() function and mysql's
password() function are one-way algorithms.

jim
--- End Message ---
--- Begin Message ---
Weston Houghton wrote:

> Anybody interested in working on a PEAR module to interface PHP with
> something like ImageMagick directly? I would love to see it. Maybe if I am
> unemployed long enough soon I can work on it myself. Not that I really want
> that to happen...
> 
> I think that might be the best solution for PHP's lack of image
> functionality though...
> 
> Wes
> 

Someone seems to have started this, although I'm not sure
why he's not going more object-based.


http://pear.php.net/manual/en/packages.imagick.php

I would prefer something like

$i = new Imagick();
$i->read("file");

instead of
$i= imagick_create();
imagick_read($i,"file");

Also, it's 'experimental' so might not have 100% of what you're looking 
for yet.

--- End Message ---
--- Begin Message ---
In <[EMAIL PROTECTED]>, Michael Kimsal wrote:

> Weston Houghton wrote:
> 
>> Anybody interested in working on a PEAR module to interface PHP with
>> something like ImageMagick directly? I would love to see it. Maybe if I
>> am unemployed long enough soon I can work on it myself. Not that I
>> really want that to happen...
>> 
>> I think that might be the best solution for PHP's lack of image
>> functionality though...
>> 
>> Wes
>> 
>> 
> Someone seems to have started this, although I'm not sure why he's not
> going more object-based.
> 
> 
> http://pear.php.net/manual/en/packages.imagick.php
> 
> I would prefer something like
> 
> $i = new Imagick();
> $i->read("file");
> 
> instead of
> $i= imagick_create();
> imagick_read($i,"file");

it's open source. just do it more object orientated ... and i'm sure the
author (me...) will be very happy to impelement it ;)

honestly, OO-Interface was and still is planned, but i think
more functionality is  much more needed at the moment than an oo
interface. it was my first extension, so i wanted to keep it simple for
the beginning.

but if someone else likes to implement it earlier, i'm the last, who has
a problem with that (and don't expect 00 soon from me ...)

chregu
--- End Message ---
--- Begin Message ---
Hi all,

I would like to know that, in php how to call a remote script, get return 
value from that script and, pass parameters to that script?

And one more question: can I throw a php script to linux background,
or preferably use perl script for background running instead?

Thanks for answers in advance!

Alex

--- End Message ---

Reply via email to