OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Thu Jan 23 2003 - 01:35:25 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 23 Jan 2003 07:35:25 -0000 Issue 1839

    Topics (messages 132664 through 132758):

    Re: A Licensing Question
            132664 by: John Wells
            132670 by: Chris Shiflett
            132673 by: John Wells
            132676 by: Peter Hutnick

    Re: backslash t
            132665 by: Chris Shiflett
            132666 by: Chris Hayes
            132669 by: bbonkosk.tampabay.rr.com
            132722 by: 1LT John W. Holmes

    Email Problems
            132667 by: Gary

    Re: changing a key in an array
            132668 by: Brent Baisley

    Re: last time, I promise...is this possible???
            132671 by: Edward Peloke

    Re: Quick Question about Template Parsers
            132672 by: Brent Baisley

    $object->function($parameter)->function();
            132674 by: Chris McCluskey
            132684 by: Greg Beaver

    Custom Error pages in IIS
            132675 by: 1LT John W. Holmes
            132686 by: Didier McGillis
            132717 by: 1LT John W. Holmes

    Returning a value from a recursive function
            132677 by: Andy Crain
            132687 by: Brian T. Allen
            132706 by: Andy Crain

    Browser language problem
            132678 by: John M

    Possible values for get_browser()->css
            132679 by: Liam.Gibbs.dfait-maeci.gc.ca

    Re: HELP HELP on a file parser
            132680 by: 1LT John W. Holmes
            132681 by: Didier McGillis
            132682 by: 1LT John W. Holmes
            132683 by: 1LT John W. Holmes

    Is there a way to undo the md5() encryption??
            132685 by: Scott Fletcher
            132688 by: Brad Pauly
            132689 by: Rick Emery
            132691 by: Scott Fletcher
            132698 by: Scott Fletcher
            132702 by: Peter Hutnick
            132754 by: rush

    Re: Simple E-mail Question
            132690 by: Aquarion
            132692 by: Aquarion
            132693 by: Aquarion
            132694 by: 1LT John W. Holmes
            132697 by: Aquarion
            132700 by: Aquarion
            132701 by: Aquarion

    writing a newsletter program in php?
            132695 by: Mark C
            132705 by: Manuel Lemos
            132739 by: Justin French

    Re: MySQL 4.0 + PHP 4
            132696 by: Georg Richter
            132713 by: 1LT John W. Holmes

    inserting date
            132699 by: Diana Castillo

    Reading Directory in reverse
            132703 by: Bob Irwin
            132704 by: Jim Lucas

    NEED HELP URGENTLY
            132707 by: Dale
            132708 by: Timothy Hitchens \(HiTCHO\)
            132711 by: John Wells
            132712 by: Leif K-Brooks
            132716 by: 1LT John W. Holmes

    Rather complex regular expression for the preg_match_all function
            132709 by: Andreas Sheriff

    a simple getenv question....
            132710 by: Bruce Douglas
            132714 by: Jim Lucas
            132715 by: Timothy Hitchens \(HiTCHO\)
            132718 by: Bruce Douglas
            132719 by: Timothy Hitchens \(HiTCHO\)
            132720 by: Bruce Douglas

    Jasper Reports and PHP
            132721 by: John Wells

    Re: How to implement this by php Session
            132723 by: 1LT John W. Holmes
            132729 by: Henry

    pear timezone class newbie help
            132724 by: Gijs Hubben

    THANK YOU FOR THE HELP
            132725 by: Dale

    Saving files
            132726 by: Sabina Alejandr Schneider
            132727 by: 1LT John W. Holmes

    htpasswd
            132728 by: Kris
            132758 by: Evan Nemerson

    continue after break
            132730 by: Reymond
            132741 by: 1LT John W. Holmes
            132742 by: Dan Lowe
            132745 by: Reymond
            132746 by: Dan Lowe
            132748 by: Leif K-Brooks

    POST vs GET method
            132731 by: Bob Lockie
            132740 by: 1LT John W. Holmes

    ? in URLS.
            132732 by: Simon Angell
            132734 by: John Nichel

    SMTP, mail() and piping directly into Sendmail, which is better?
            132733 by: Jonathan Chum
            132744 by: Jonathan Chum
            132747 by: Manuel Lemos

    Generating a range of IP address
            132735 by: rdkurth.starband.net
            132750 by: Tom Rogers

    chown()
            132736 by: Urb LeJeune
            132751 by: Evan Nemerson

    total file size
            132737 by: Victor
            132752 by: Evan Nemerson

    Re: PHP & Sessions generates Segment Faults
            132738 by: Justin French

    Re: Mass Mailing
            132743 by: Jonathan Chum
            132757 by: Evan Nemerson

    Re: Why PHP doesn't work with Apache2?
            132749 by: Jean-Christian Imbeault
            132753 by: Rasmus Lerdorf
            132755 by: Jean-Christian Imbeault
            132756 by: Rasmus Lerdorf

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    Peter Hutnick said:
    >> Yeah...that's really what I'm wondering. If I have my own code, but
    >> make function calls and the like to script libraries licensed under
    >> the GPL, does it mean my code will have to be GPL'd as well?
    >
    > In a word, yes.

    Even if the script libraries are themselves just PHP scripts...not any
    binary code being linked into the interpreter? I'm still unclear here.

    >> Say, for instance, that I use a GPL'd library that provides a class
    >> called myGPLClass. If I create instances of myGPLClass in my own
    >> scripts, does that make my code in violation of the GPL?
    >
    > No. Use is not restricted in any way by the GPL. In fact, you needn't
    > even /agree/ to the GPL in order to use GPLed software in any way you'd
    > like, only to (re)distribute it.

    Hmmm....now I think I understand what you mean, but if I consider it in
    the context of my question and with your above statement, it seems
    contradictory. I don't think it's that you're misunderstanding me...I
    think it's me misunderstanding you ;-).

    Let me lay it out:

    Say you create a set of class libraries, called PeterLib, and release it
    under the GPL. I download these libraries...like what you've done...and
    decide to use them in my development. Your library makes available a
    class called FooBar that I really like, and I decide to make use of it in
    a number of my own files.

    So, one of the core files in my application contains:

    <?
        require_once("/PeterLib/FooBar.inc");

        $myObj = new FooBar();

        $myObj->getFoo();

        $myObj->printBar();

    ?>

    Now, futher assume that I want to sell my application under my own
    company's license and I label all my files as such, but still retain your
    GPL license it the PeterLib files. I rush to market and have an
    overwhelming amount of customers in the first month.

    Four issues:
    1. Have I violated the GPL by distributing your code with my "propietary",
    non-open source app? I'm still distributing source, but my specific files
    (including a few that call PeterLib classes) are not GPL'd.

    2. If I decided to only distribute my own source for money under my own
    propietary license, but told my customers that in order for my application
    to function correctly, they'd need to download PeterLib. Is this a
    violation?

    3. If the above are considered violations, I assume only using libraries
    licensed under licenses like the LGPL or PHP would make it safe for me to
    redistribute with my proprietary app?

    4. How do the above change if/when I decide to encode my self-written
    files with Zend Encoder?

    Thanks very much for all your input. Very helpful. I really appreciate it.

    John

    attached mail follows:


    John,

    I am not an expert of copyright law and licenses, but this
    URL might help you answer some of your questions:

    http://www.gnu.org/licenses/gpl-faq.html

    Specifically, look at the questions under the heading,
    "Combining work with code released under the GPL", as they
    seem to be exactly what you are asking.

    Chris

    attached mail follows:


    Chris,

    Sheesh. I'd read it about 5 times but revisited just now. Somehow I
    missed the key phrase "which are themselves interpreted.".

    Here's the full relevant excerpt:

    "Another similar and very common case is to provide libraries with the
    interpreter which are themselves interpreted. For instance, Perl comes
    with many Perl modules, and a Java implementation comes with many Java
    classes. These libraries and the programs that call them are always
    dynamically linked together.

    A consequence is that if you choose to use GPL'd Perl modules or Java
    classes in your program, you must release the program in a GPL-compatible
    way, regardless of the license used in the Perl or Java interpreter that
    the combined Perl or Java program will run on. "

    That answers my question. If following the scenario I described
    previously, my code would have to be GPL'd as well.

    Thanks!
    John

    attached mail follows:


    John Wells said:
    > Peter Hutnick said:
    >>> Yeah...that's really what I'm wondering. If I have my own code, but
    >>> make function calls and the like to script libraries licensed under
    >>> the GPL, does it mean my code will have to be GPL'd as well?
    >>
    >> In a word, yes.
    >
    > Even if the script libraries are themselves just PHP scripts...not any
    > binary code being linked into the interpreter? I'm still unclear here.

    Makes no difference. If you think about it, the GPL applies equally to
    binary programs and the source code that produces them . . . so an
    interpreted language is like the first part without the second.

    >>> Say, for instance, that I use a GPL'd library that provides a class
    >>> called myGPLClass. If I create instances of myGPLClass in my own
    >>> scripts, does that make my code in violation of the GPL?
    >>
    >> No. Use is not restricted in any way by the GPL. In fact, you
    >> needn't even /agree/ to the GPL in order to use GPLed software in any
    >> way you'd like, only to (re)distribute it.
    >
    > Hmmm....now I think I understand what you mean, but if I consider it in
    > the context of my question and with your above statement, it seems
    > contradictory. I don't think it's that you're misunderstanding me...I
    > think it's me misunderstanding you ;-).

    Perhaps I read "use" more literally than you meant it. You can USE a
    GPLed lib any way you want. If you want to DISTRIBUTE a program (to
    include a script) that uses a GPLed library you must do so under the terms
    of the GPL.

    If that isn't completely clear, read on.

    > Let me lay it out:
    >
    > Say you create a set of class libraries, called PeterLib, and release it
    > under the GPL. I download these libraries...like what you've done...and
    > decide to use them in my development. Your library makes available a
    > class called FooBar that I really like, and I decide to make use of it
    > in a number of my own files.
    >
    > So, one of the core files in my application contains:
    >
    > <?
    > require_once("/PeterLib/FooBar.inc");
    >
    > $myObj = new FooBar();
    >
    > $myObj->getFoo();
    >
    > $myObj->printBar();
    >
    > ?>

    You may do that.

    > Now, futher assume that I want to sell my application under my own
    > company's license and I label all my files as such, but still retain
    > your GPL license it the PeterLib files. I rush to market and have an
    > overwhelming amount of customers in the first month.
    >
    > Four issues:
    > 1. Have I violated the GPL by distributing your code with my
    > "propietary", non-open source app? I'm still distributing source, but
    > my specific files (including a few that call PeterLib classes) are not
    > GPL'd.

    Maybe. It depends on what "my own company's" license says. Specifically,
    if it is a "GPL compatible" license, then no. For a list of
    known-compatible licenses see
    http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses.

    In practice when you say "my own company's license" you probably mean a
    proprietary license. That would be a violation.

    > 2. If I decided to only distribute my own source for money under my own
    > propietary license, but told my customers that in order for my
    > application to function correctly, they'd need to download PeterLib. Is
    > this a violation?

    I don't think that there is any way to be absolutely sure about that
    without being sued. If you win, no. If you lose, yes ;-)

    It /sounds/ like a loophole, since 1. you don't agree to the GPL to write
    your program and 2. you don't distribute the GPLed code.

    I think in all likelihood you would lose. Your program would be seen as a
    derivative work.

    > 3. If the above are considered violations, I assume only using
    > libraries licensed under licenses like the LGPL or PHP would make it
    > safe for me to redistribute with my proprietary app?

    Right. This (should be)/is a conscious decision that is made by the
    library's developer. If they want to let you link at will they use the
    LGPL, if they want to extend the copyleft to linking programs they use the
    GPL.

    > 4. How do the above change if/when I decide to encode my self-written
    > files with Zend Encoder?

    This is an obfuscation utility? If so, the GPL excludes obfuscated source
    code as "qualifying" as source code for the purpose of license compliance.

    "Accompany it with the complete corresponding machine-readable source
    code, which must be distributed under the terms of Sections 1 and 2 above
    on a medium customarily used for software interchange"

    I.e. you can't give someone a printout of source code or an image of the
    source code, you can't provide it on 1/4 inch tape or a stack of punch
    cards, and you can't run the code through an "optimizer" or obfuscater
    first.

    > Thanks very much for all your input. Very helpful. I really appreciate
    > it.

    Glad to help.

    -Peter

    attached mail follows:


    --- Jan Grafström <janlillemanshus.com> wrote:
    > I want php to print " \tab"

    echo " \\tab";

    Chris

    attached mail follows:


    At 20:19 22-1-03, you wrote:
    >Hi,
    >
    >I want php to print " \tab"
    >but when I do, I only get "ab" as output.
    >How do I keep the \t?

    Jan, between "double quotes", several things are translated
    this becomes
    \t a tab
    \r a carriage return
    \n a newline
    \" "
    \\ \
    There are more, see the documentation.

    So to type \tab
    use
        ' \tab ' (note that these are 'single quotes')
    or
        " \\tab "

    attached mail follows:


    You need to escape the '/' with a '/', as it is a special character.
    So, anytime you run into an issue where it looks like PHP is trying to
    interpret something you just want it to print. The best first guess is to
    try and escape it.

    Just Thought I would offer a little more explaination.

    > --- Jan Grafström <janlillemanshus.com> wrote:
    > > I want php to print " \tab"
    >
    > echo " \\tab";
    >
    > Chris
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >

    attached mail follows:


    > I want php to print " \tab"
    > but when I do, I only get "ab" as output.
    > How do I keep the \t?

    \t is a tab character. If you looked in your source code, you'd see a
    tab there. Use "\\tab"

    ---John W. Holmes...

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

    attached mail follows:


    Hi,
           Can anyone tell me what may be wrong with my email configuration? I
    am using Microsoft Outlook with a Microsoft Exchange Server. My PHP programs
    can no longer send emails. They were able to before, seems like it stopped
    about a month ago. I don't believe I have changed anything. And it's not
    only PHP, I'm also having trouble with other programming languages where I
    did not before.

    PHP4.0

    attached mail follows:


    I'm not sure how you are creating your array, but your resulting array
    would look something like this:

    Array
    (
       [name1]=>namevalue1
       [a1]=>Array
            (
            [k1]=>value1
            [k2]=>value2
            )
       [name2]=>namevalue2
       [a2]=>Array
            (...

    You end up with a two dimensional array (avoiding the columns term) that
    contains a name value and a values array for each entry.

    On Wednesday, January 22, 2003, at 01:22 PM, David T-G wrote:

    > Can you show me how? Currently I have
    >
    > Array
    > (
    > [a1] => Array
    > (
    > [k1] => value1
    > [k2] => value2
    > )
    > [a2] => Array
    > (
    > [k1] => value1
    > [k2] => value2
    > )
    > )
    >
    > and now I'll want to add a 'name' thingie (I daren't call it a
    > column :-)
    > so that I can change it at will ... but where and how do I add it?
    >
    >

    --
    Brent Baisley
    Systems Architect
    Landover Associates, Inc.
    Search & Advisory Services for Advanced Technology Environments
    p: 212.759.6400/800.759.0577
    

    attached mail follows:


    Not getting any responses so should I will plow through it, just wanted to try one more time.

    -----Original Message----- From: Edward Peloke [mailto:epelokeechoman.com] Sent: Wednesday, January 22, 2003 10:20 AM To: php-generallists.php.net Subject: RE: [PHP] Is this just not possible?? ..create new odbc connection..please help

    yep, I am trying to come up with a way to get data out of an access db on the users machine and load it into the mysql db on the server. The only thing I can think of is have the user upload their db, php then creates a datasource, pumps over the data, deletes the db and datasource. My only problem with this method is if the db is large it may take them a while to upload it. Any other suggestions are greatly welcomed. I want it to be a 'one click' for the users so I don't want to ask them to export it to another format before uploading.

    Thanks, Eddie

    -----Original Message----- From: Jason k Larson [mailto:jlarsoncandlefire.org] Sent: Wednesday, January 22, 2003 9:47 AM To: Edward Peloke Cc: php-generallists.php.net Subject: Re: [PHP] Is this just not possible?? ..create new odbc connection..please help

    Are you wanting to have PHP dynamically create ODBC datasources instead of creating them via the typical Control Panel method?

    If so, and if possible, would be tricky, but I'll bet it can be done.

    Regards, Jason k Larson

    Edward Peloke wrote: > Thanks Jason, > > I know how to connect to an odbc datasource but will this function also > allow me to create one? > > Thanks, > Eddie > > -----Original Message----- > From: Jason k Larson [mailto:jlarsoncandlefire.org] > Sent: Wednesday, January 22, 2003 9:38 AM > To: Edward Peloke > Cc: php-generallists.php.net > Subject: Re: [PHP] Is this just not possible?? ..create new odbc > connection..please help > > > http://www.php.net/manual/en/function.odbc-connect.php > > Edward Peloke wrote: > >>Haven't had a single response so I am not sure if this isn't possible or >>just really easy and something I should already know. >> >>Thanks, >>Eddie

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

    attached mail follows:


    Sure, you could do it any way you want. One way or another you need to get it into a variable, so how you get the template there doesn't really have any affect on your replace function.

    I'm using the file based template so it's easy for users to modify. I "read" the template file into the output buffer, then store the buffer into a variable and clear the buffer: ob_start(); include("templateFile.tpl"); $tpl_content = ob_get_contents(); ob_end_clean();

    The template is now stored in the $tpl_content variable. You could just as easily pull the template from a database. For the template file I place "data tags" in it that I do a search and replace on. Some common "tags" I use: {::PageTitle::}, {::MainData::},{::NavBar::}

    You should try to use str_replace instead of ereg_replace since it's faster. Both support arrays for the search and replace part, so you can use one line of code to do 30, 40 or whatever replaces. I create an array of my data tags and another array of the matching data, then do: str_replace($tagArray,$dataArray,$formTemplate);

    I can then provide a user who knows HTML a list of data tags (the contract) that they can place in a template anyway they want. The whole idea is to separate your data from your code from you presentation.

    Hope that helps.

    On Wednesday, January 22, 2003, at 01:06 PM, Jim Lucas wrote:

    > In general, how do most template parsers work? > > do they read the file into a variable and do something > to the effect of preg_replace() to element that is found? > > and if so, could you replace the step of reading the file > into a variable with getting the template data out of a database? > > WARNING... more questions to come... > > Jim >

    --
    Brent Baisley
    Systems Architect
    Landover Associates, Inc.
    Search & Advisory Services for Advanced Technology Environments
    p: 212.759.6400/800.759.0577
    

    attached mail follows:


    Hi there, I've been using PHP for about 2 years now and absolutely love it! Our company uses it as our main development language, so far though, there is one thing that has been annoying me for a while now.. the following line of code will not work: $object->function1($parameter)->function2(); I receive a parse error when i try to call another function off of the object that function1 returns. I know this is possible in java: object.function1(parameter).function2(); VB: object.function1(paremeter).function2 and i'm sure C++, although i'm not too familiar with that language. My question is, will or is there any support for this kind of call in PHP? or is there another way that i should be doing it? as for now, here is my work around: $tmp =& $object->function1($parameter); $tmp->function2(); Thank you in advance! -Chris

    ----------------------------------- _ _ _ _ |'|(_)|_)(_)|_(_)`-, * * * ------------------------------------ Chris McCluskey Web Applications Engineer Modulus, LLC 1720 Willow Creek Circle, Suite 520 Eugene, OR 97402 Email: chrismodulusgroup.com Voice: +1 (541) 434-1024 Web..: http://www.modulusgroup.com <http://www.modulusgroup.com/> ============================================ The contents of this transmission may be confidential in nature and should be directed only to the person to whom it is addressed. Do not read, copy, or disseminate this material unless you are the intended recipient. If this transmission reached you in error, please forward the e-mail to the sender to advise, then destroy the transmission you received. Thank you.

    attached mail follows:


    Hi Chris,

    Zend Engine 2.0 supports this syntax, and will be included with PHP 5. You can read all about zend 2 and its other improvements at http://www.zend.com

    Greg

    --
    phpDocumentor
    http://www.phpdoc.org
    

    "Chris McCluskey" <chrismodulusgroup.com> wrote in message news:92BC9A90F2D7FD41AD97761F7E522C28064F8Cnx-enterprise.modulusgroup.com.. . Hi there, I've been using PHP for about 2 years now and absolutely love it! Our company uses it as our main development language, so far though, there is one thing that has been annoying me for a while now.. the following line of code will not work:

    $object->function1($parameter)->function2();

    I receive a parse error when i try to call another function off of the object that function1 returns. I know this is possible in java:

    object.function1(parameter).function2();

    VB:

    object.function1(paremeter).function2

    and i'm sure C++, although i'm not too familiar with that language.

    My question is, will or is there any support for this kind of call in PHP? or is there another way that i should be doing it? as for now, here is my work around:

    $tmp =& $object->function1($parameter); $tmp->function2();

    Thank you in advance!

    -Chris

    ----------------------------------- _ _ _ _ |'|(_)|_)(_)|_(_)`-, * * * ------------------------------------ Chris McCluskey Web Applications Engineer Modulus, LLC 1720 Willow Creek Circle, Suite 520 Eugene, OR 97402 Email: chrismodulusgroup.com Voice: +1 (541) 434-1024 Web..: http://www.modulusgroup.com <http://www.modulusgroup.com/> ====================== The contents of this transmission may be confidential in nature and should be directed only to the person to whom it is addressed. Do not read, copy, or disseminate this material unless you are the intended recipient. If this transmission reached you in error, please forward the e-mail to the sender to advise, then destroy the transmission you received. Thank you.

    attached mail follows:


    Is anyone using PHP to create custom error pages in IIS. I want to modify the 403 error page to do a redirect to HTTPS if it was requested with HTTP. I had someone try it, but they said it didn't work. I'm at work now and don't have a box to try it on until I get home. Does anyone have this working out there, so I know whether or not to spend my time on it?? Any pointers? Thanks for any info.

    ---John Holmes...

    attached mail follows:


    Have you tried http://www.iis-resource.com, they have some good resources.

    >From: "1LT John W. Holmes" <holmes072000charter.net> >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> >To: <php-generallists.php.net> >Subject: [PHP] Custom Error pages in IIS >Date: Wed, 22 Jan 2003 15:08:58 -0500 > >Is anyone using PHP to create custom error pages in IIS. I want to modify >the 403 error page to do a redirect to HTTPS if it was requested with HTTP. >I had someone try it, but they said it didn't work. I'm at work now and >don't have a box to try it on until I get home. Does anyone have this >working out there, so I know whether or not to spend my time on it?? Any >pointers? Thanks for any info. > >---John Holmes... > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

    attached mail follows:


    No biggie, but you forgot an 's' on the address:

    http://www.iis-resources.com, in case anyone was having trouble getting there.

    Thank you for the link, though.

    ---John W. Holmes...

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

    > -----Original Message----- > From: Didier McGillis [mailto:codesmokerhotmail.com] > Sent: Wednesday, January 22, 2003 4:42 PM > To: holmes072000charter.net; php-generallists.php.net > Subject: Re: [PHP] Custom Error pages in IIS > > Have you tried http://www.iis-resource.com, they have some good resources. > > > > > > > >From: "1LT John W. Holmes" <holmes072000charter.net> > >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> > >To: <php-generallists.php.net> > >Subject: [PHP] Custom Error pages in IIS > >Date: Wed, 22 Jan 2003 15:08:58 -0500 > > > >Is anyone using PHP to create custom error pages in IIS. I want to modify > >the 403 error page to do a redirect to HTTPS if it was requested with > HTTP. > >I had someone try it, but they said it didn't work. I'm at work now and > >don't have a box to try it on until I get home. Does anyone have this > >working out there, so I know whether or not to spend my time on it?? Any > >pointers? Thanks for any info. > > > >---John Holmes... > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > _________________________________________________________________ > Add photos to your e-mail with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Everyone,

    I'm stumped by this, even after searching the archives and the web, although I admit the solution likely is something very obvious.

    I've written a function to build a string of "breadcrumb" links for a web site directory similar to Yahoo, etc. It queries a categories table recursively until it reaches the root category, building a string of categories from the current category all the way back up to root. The function seems to work fine if I output directly from it using echo, but if I instead try to return the string to the global scope and then echo it, I get nothing. The line where I use echo/return is indicated below.

    Thanks,

    Andy

    function breadcrumbs($category_id=0,$mode='linked'){

    global $id_array,$name_array;

    static $counter = 0;

    if ($category_id == 0) {

    //once we're down to the root, build a return string

    if ($mode == 'linked') {

    $output = '<A HREF="' . $_SERVER['PHP_SELF'] . '">HOME</A>';

    } else {

    $output = 'HOME';

    }

    while($counter > 0){

    if ($mode == 'linked') {

    $output .= ' > <A HREF="' . $_SERVER['PHP_SELF'] . '?category_id=' . array_pop($id_array) . '">' . array_pop($name_array) . '</A>';

    } else {

    $output .= ' > ' . array_pop($name_array);

    }

    $counter--;

    }

    return $output; /*<--------HERE: IF I SUBSTITUTE "ECHO" FOR "RETURN", EVERYTHING WORKS; BUT WITH "RETURN", IT DOESN'T WORK*/

    } else {

    $sql = 'SELECT category_id, parent_cat, category_name FROM web_categories WHERE category_id = ' . $category_id;

    $result = safe_query($sql);

    while($query_data = mysql_fetch_assoc($result)){

    $id_array[$counter] = $query_data['category_id'];

    $name_array[$counter] = $query_data['category_name'];

    //now, move one step up and make the current category the previous parent

    $category_id = $query_data['parent_cat'];

    $counter++;

    breadcrumbs($category_id,$mode);

    }

    }

    }

    $show = breadcrumbs(9);

    echo $show;

    attached mail follows:


    I think it will work if you return true, and just modify the global variable (not try to output it).

    Then output it (or capture it to begin with ($total_count = OneHundred();) after the function is called.

    You could also pass the variable, rather than making it global (OneHundred("0") initially, and OneHundred($count) from within the function).

    For instance:

    <?php

    function OneHundred(){ global $count;

    if($count < 100){ $count++; OneHundred(); } return true; }

    OneHundred();

    echo $count;

    ?>

    Hope that helps, Brian

    > -----Original Message----- > From: Andy Crain [mailto:apcrainfuse.net] > Sent: Wednesday, January 22, 2003 1:23 PM > To: php-generallists.php.net > Subject: [PHP] Returning a value from a recursive function > > > Everyone, > > I'm stumped by this, even after searching the archives and the web, > although I admit the solution likely is something very obvious. > > > > I've written a function to build a string of "breadcrumb" links for a > web site directory similar to Yahoo, etc. It queries a > categories table > recursively until it reaches the root category, building a string of > categories from the current category all the way back up to root. The > function seems to work fine if I output directly from it > using echo, but > if I instead try to return the string to the global scope and > then echo > it, I get nothing. The line where I use echo/return is > indicated below. > > Thanks, > > Andy > > > > function breadcrumbs($category_id=0,$mode='linked'){ > > global $id_array,$name_array; > > > > static $counter = 0; > > > > if ($category_id == 0) { > > //once we're down to the root, build a return string > > if ($mode == 'linked') { > > $output = '<A HREF="' . $_SERVER['PHP_SELF'] . '">HOME</A>'; > > } else { > > $output = 'HOME'; > > } > > while($counter > 0){ > > if ($mode == 'linked') { > > $output .= ' > <A HREF="' . $_SERVER['PHP_SELF'] . > '?category_id=' . array_pop($id_array) . '">' . > array_pop($name_array) > . '</A>'; > > } else { > > $output .= ' > ' . array_pop($name_array); > > } > > $counter--; > > } > > return $output; /*<--------HERE: IF I SUBSTITUTE "ECHO" FOR > "RETURN", EVERYTHING WORKS; BUT WITH "RETURN", IT DOESN'T WORK*/ > > } else { > > $sql = 'SELECT category_id, parent_cat, category_name FROM > web_categories WHERE category_id = ' . $category_id; > > $result = safe_query($sql); > > while($query_data = mysql_fetch_assoc($result)){ > > $id_array[$counter] = $query_data['category_id']; > > $name_array[$counter] = $query_data['category_name']; > > //now, move one step up and make the current category the > previous parent > > $category_id = $query_data['parent_cat']; > > $counter++; > > breadcrumbs($category_id,$mode); > > } > > } > > } > > > > $show = breadcrumbs(9); > > echo $show; > >

    attached mail follows:


    Thanks very much, Brian. Your response helped me find the answer. On the recursive call to breadcrumbs(), the function wasn't actually returning anything to itself. I replaced "breadcrumbs()" with "return breadcrumbs()" and everything now works.

    > -----Original Message----- > From: Brian T. Allen [mailto:briangzmarketing.com] > Sent: Wednesday, January 22, 2003 4:47 PM > To: 'Andy Crain'; php-generallists.php.net > Subject: RE: [PHP] Returning a value from a recursive function > > I think it will work if you return true, and just modify the global > variable (not try to output it). > > Then output it (or capture it to begin with ($total_count = > OneHundred();) after the function is called. > > You could also pass the variable, rather than making it global > (OneHundred("0") initially, and OneHundred($count) from within the > function). > > For instance: > > <?php > > function OneHundred(){ > global $count; > > if($count < 100){ > $count++; > OneHundred(); > } > > return true; > } > > OneHundred(); > > echo $count; > > ?> > > > Hope that helps, > Brian > > > -----Original Message----- > > From: Andy Crain [mailto:apcrainfuse.net] > > Sent: Wednesday, January 22, 2003 1:23 PM > > To: php-generallists.php.net > > Subject: [PHP] Returning a value from a recursive function > > > > > > Everyone, > > > > I'm stumped by this, even after searching the archives and the web, > > although I admit the solution likely is something very obvious. > > > > > > > > I've written a function to build a string of "breadcrumb" links for a > > web site directory similar to Yahoo, etc. It queries a > > categories table > > recursively until it reaches the root category, building a string of > > categories from the current category all the way back up to root. The > > function seems to work fine if I output directly from it > > using echo, but > > if I instead try to return the string to the global scope and > > then echo > > it, I get nothing. The line where I use echo/return is > > indicated below. > > > > Thanks, > > > > Andy > > > > > > > > function breadcrumbs($category_id=0,$mode='linked'){ > > > > global $id_array,$name_array; > > > > > > > > static $counter = 0; > > > > > > > > if ($category_id == 0) { > > > > //once we're down to the root, build a return string > > > > if ($mode == 'linked') { > > > > $output = '<A HREF="' . $_SERVER['PHP_SELF'] . '">HOME</A>'; > > > > } else { > > > > $output = 'HOME'; > > > > } > > > > while($counter > 0){ > > > > if ($mode == 'linked') { > > > > $output .= ' > <A HREF="' . $_SERVER['PHP_SELF'] . > > '?category_id=' . array_pop($id_array) . '">' . > > array_pop($name_array) > > . '</A>'; > > > > } else { > > > > $output .= ' > ' . array_pop($name_array); > > > > } > > > > $counter--; > > > > } > > > > return $output; /*<--------HERE: IF I SUBSTITUTE "ECHO" FOR > > "RETURN", EVERYTHING WORKS; BUT WITH "RETURN", IT DOESN'T WORK*/ > > > > } else { > > > > $sql = 'SELECT category_id, parent_cat, category_name FROM > > web_categories WHERE category_id = ' . $category_id; > > > > $result = safe_query($sql); > > > > while($query_data = mysql_fetch_assoc($result)){ > > > > $id_array[$counter] = $query_data['category_id']; > > > > $name_array[$counter] = $query_data['category_name']; > > > > //now, move one step up and make the current category the > > previous parent > > > > $category_id = $query_data['parent_cat']; > > > > $counter++; > > > > breadcrumbs($category_id,$mode); > > > > } > > > > } > > > > } > > > > > > > > $show = breadcrumbs(9); > > > > echo $show; > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hello,

    I have the code below, but it doesn't work. I see the message "It is an array" but nothing else. What can be the problem? How can I get the actual browser language?

    I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on.

    Thanks!

    <?php global $HTTP_ACCEPT_LANGUAGE; $arr_lang = preg_split('/(\s*,\s*)/', $HTTP_ACCEPT_LANGUAGE); if (is_array($arr_lang)) { echo "It is an array"; $lang_first = strtolower((trim(strval($arr_lang[0])))); echo $lang_first; $lang_first = substr($lang_first, 0, 2); $lang = $lang_first; echo $lang; } ?>

    attached mail follows:


    When I run, $r = get_browser(); and take a look at the css value, I get 2. I would have figured that it could only be 0 (not supported) or 1 (supported). What are the possible values for get_browser()'s css, and what do those values mean?

    attached mail follows:


    Okay, if I understand everything correctly, something like this may work, if you can get around the issue of your file sizes being so large, and you can deal with the amount of memory this is going to eat up, and you realize that Perl is probably better suited to the job...

    //read numbers $numbers = file("in.txt");

    //read all lines from log file $fp = fopen("file.log","r"); $log_file = fread($fp,filesize("file.log"));

    //match lines of log_file that start with 'code' //and match number preg_match_all("/^(code.*number=([0-9]+).*)$/m",$log_file,$matches);

    //put matches into an array such as // $array[code] = number $x=0; foreach($mathes[1] as $code) { $number = $matches[2][$x++]; $log_file_array[$code] = $number; }

    //compute intersection of log file array //and numbers array $intersect = array_intersect($log_file_array,$numbers);

    //flip the log array, so you now have //an array full of the lines in the log //file that matches a number in the in.txt file $answer = array_flip($intersect);

    Hope that works... I can't test it. There are many ways you can do this...

    --John Holmes... ----- Original Message ----- From: "Didier McGillis" <codesmokerhotmail.com> To: <holmes072000charter.net> Sent: Tuesday, January 21, 2003 5:49 PM Subject: Re: [PHP] HELP HELP on a file parser

    > Sorry should have done this. > > in.txt (there will be 470 of these #'s) - it uses these numbers to check > against the chek.txt file > 455784 > 455785 > 455786 > 455787 > 455788 > > check.txt - after it checks this file where number=389487 a number from > in.txt, if it does it writes that to another file > not on q/n2 24 Sat Nov 12 00:27:34 2002 > 3 129 code=001;number=389487;name=Blah L > McBlah;type=5;big_number=888888888;time=09;min=2004; > > > found.txt gets written to either in this format > not on q/n2 24 Sat Nov 12 00:27:34 2002 > 3 129 code=001;number=389487;name=Blah L > McBlah;type=5;big_number=888888888;time=09;min=2004; > or this format > code=001;number=389487;name=Blah L > McBlah;type=5;big_number=888888888;time=09;min=2004 > > hope that helps. > > > >From: "1LT John W. Holmes" <holmes072000charter.net> > >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> > >To: "Didier McGillis" <codesmokerhotmail.com>, <php-generallists.php.net> > >Subject: Re: [PHP] HELP HELP on a file parser > >Date: Tue, 21 Jan 2003 17:33:36 -0500 > > > > > I need some help, I think this is probably really simple and I was > >wondering > > > if anyone had some code I could use to help me write this. > > > > > > I need a page to parse a text file with a list of numbers, and then take > > > those numbers and parse another file with over 7MB of information and to > > > look for those numbers and then to pull out the matches. Now the file > >that > > > its looking through each record that has a number in it is in a specific > > > format with a beginnning and an end. > > > >Can you give a short example of each file and what you want to match in > >each? > > > >---John Holmes... > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > _________________________________________________________________ > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail >

    attached mail follows:


    Fixed a couple of things in the code. Pretty good for psudo code. :)

    But I get this error when running.

    Warning: Argument #1 to array_intersect() is not an array in /home/httpd/vhosts/mccullough-net.com/httpdocs/GH/parse2.php on line 27

    Warning: Wrong datatype in array_flip() call in /home/httpd/vhosts/mccullough-net.com/httpdocs/GH/parse2.php on line 32

    code below. any thoughts on what might be choking it.

    <? //read numbers $numbers = file("bad.txt");

    //read all lines from log file $fp = fopen("file2.log","r"); $log_file = fread($fp,filesize("file2.log"));

    $results = fopen ("results.txt", "w");

    //match lines of log_file that start with 'code' //and match number preg_match_all("/^(code.*number=([0-9]+).*)$/m",$log_file,$matches);

    //put matches into an array such as // $array[code] = number $x=0; foreach($matches[1] as $code) { $number = $matches[2][$x++]; $log_file_array[$code] = $number; }

    //compute intersection of log file array //and numbers array $intersect = array_intersect($log_file_array[$code],$numbers);

    //flip the log array, so you now have //an array full of the lines in the log //file that matches a number in the in.txt file $answer = array_flip($intersect); fwrite ($results, $answer);

    >From: "1LT John W. Holmes" <holmes072000charter.net> >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> >To: "Didier McGillis" <codesmokerhotmail.com> >CC: <php-generallists.php.net> >Subject: Re: [PHP] HELP HELP on a file parser >Date: Wed, 22 Jan 2003 16:07:17 -0500 > >Okay, if I understand everything correctly, something like this may work, >if >you can get around the issue of your file sizes being so large, and you can >deal with the amount of memory this is going to eat up, and you realize >that >Perl is probably better suited to the job... > >//read numbers >$numbers = file("in.txt"); > >//read all lines from log file >$fp = fopen("file.log","r"); >$log_file = fread($fp,filesize("file.log")); > >//match lines of log_file that start with 'code' >//and match number >preg_match_all("/^(code.*number=([0-9]+).*)$/m",$log_file,$matches); > >//put matches into an array such as >// $array[code] = number >$x=0; >foreach($mathes[1] as $code) >{ > $number = $matches[2][$x++]; > $log_file_array[$code] = $number; >} > >//compute intersection of log file array >//and numbers array >$intersect = array_intersect($log_file_array,$numbers); > >//flip the log array, so you now have >//an array full of the lines in the log >//file that matches a number in the in.txt file >$answer = array_flip($intersect); > >Hope that works... I can't test it. There are many ways you can do this... > >--John Holmes... >----- Original Message ----- >From: "Didier McGillis" <codesmokerhotmail.com> >To: <holmes072000charter.net> >Sent: Tuesday, January 21, 2003 5:49 PM >Subject: Re: [PHP] HELP HELP on a file parser > > > > Sorry should have done this. > > > > in.txt (there will be 470 of these #'s) - it uses these numbers to check > > against the chek.txt file > > 455784 > > 455785 > > 455786 > > 455787 > > 455788 > > > > check.txt - after it checks this file where number=389487 a number from > > in.txt, if it does it writes that to another file > > not on q/n2 24 Sat Nov 12 00:27:34 2002 > > 3 129 code=001;number=389487;name=Blah L > > McBlah;type=5;big_number=888888888;time=09;min=2004; > > > > > > found.txt gets written to either in this format > > not on q/n2 24 Sat Nov 12 00:27:34 2002 > > 3 129 code=001;number=389487;name=Blah L > > McBlah;type=5;big_number=888888888;time=09;min=2004; > > or this format > > code=001;number=389487;name=Blah L > > McBlah;type=5;big_number=888888888;time=09;min=2004 > > > > hope that helps. > > > > > > >From: "1LT John W. Holmes" <holmes072000charter.net> > > >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> > > >To: "Didier McGillis" <codesmokerhotmail.com>, ><php-generallists.php.net> > > >Subject: Re: [PHP] HELP HELP on a file parser > > >Date: Tue, 21 Jan 2003 17:33:36 -0500 > > > > > > > I need some help, I think this is probably really simple and I was > > >wondering > > > > if anyone had some code I could use to help me write this. > > > > > > > > I need a page to parse a text file with a list of numbers, and then >take > > > > those numbers and parse another file with over 7MB of information >and >to > > > > look for those numbers and then to pull out the matches. Now the >file > > >that > > > > its looking through each record that has a number in it is in a >specific > > > > format with a beginnning and an end. > > > > > >Can you give a short example of each file and what you want to match in > > >each? > > > > > >---John Holmes... > > > > > > > > >-- > > >PHP General Mailing List (http://www.php.net/) > > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > _________________________________________________________________ > > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > > http://join.msn.com/?page=features/junkmail > >

    _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

    attached mail follows:


    $intersect = array_intersect($log_file_array[$code],$numbers);

    should be

    $intersect = array_intersect($log_file_array,$numbers);

    ---John Holmes...

    ----- Original Message ----- From: "Didier McGillis" <codesmokerhotmail.com> To: <php-generallists.php.net> Sent: Wednesday, January 22, 2003 4:23 PM Subject: Re: [PHP] HELP HELP on a file parser

    > Fixed a couple of things in the code. Pretty good for psudo code. :) > > But I get this error when running. > > Warning: Argument #1 to array_intersect() is not an array in > /home/httpd/vhosts/mccullough-net.com/httpdocs/GH/parse2.php on line 27 > > Warning: Wrong datatype in array_flip() call in > /home/httpd/vhosts/mccullough-net.com/httpdocs/GH/parse2.php on line 32 > > code below. any thoughts on what might be choking it. > > <? > //read numbers > $numbers = file("bad.txt"); > > //read all lines from log file > $fp = fopen("file2.log","r"); > $log_file = fread($fp,filesize("file2.log")); > > $results = fopen ("results.txt", "w"); > > //match lines of log_file that start with 'code' > //and match number > preg_match_all("/^(code.*number=([0-9]+).*)$/m",$log_file,$matches); > > //put matches into an array such as > // $array[code] = number > $x=0; > foreach($matches[1] as $code) > { > $number = $matches[2][$x++]; > $log_file_array[$code] = $number; > } > > //compute intersection of log file array > //and numbers array > $intersect = array_intersect($log_file_array[$code],$numbers); > > //flip the log array, so you now have > //an array full of the lines in the log > //file that matches a number in the in.txt file > $answer = array_flip($intersect); > fwrite ($results, $answer); > > > > > > >From: "1LT John W. Holmes" <holmes072000charter.net> > >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> > >To: "Didier McGillis" <codesmokerhotmail.com> > >CC: <php-generallists.php.net> > >Subject: Re: [PHP] HELP HELP on a file parser > >Date: Wed, 22 Jan 2003 16:07:17 -0500 > > > >Okay, if I understand everything correctly, something like this may work, > >if > >you can get around the issue of your file sizes being so large, and you can > >deal with the amount of memory this is going to eat up, and you realize > >that > >Perl is probably better suited to the job... > > > >//read numbers > >$numbers = file("in.txt"); > > > >//read all lines from log file > >$fp = fopen("file.log","r"); > >$log_file = fread($fp,filesize("file.log")); > > > >//match lines of log_file that start with 'code' > >//and match number > >preg_match_all("/^(code.*number=([0-9]+).*)$/m",$log_file,$matches); > > > >//put matches into an array such as > >// $array[code] = number > >$x=0; > >foreach($mathes[1] as $code) > >{ > > $number = $matches[2][$x++]; > > $log_file_array[$code] = $number; > >} > > > >//compute intersection of log file array > >//and numbers array > >$intersect = array_intersect($log_file_array,$numbers); > > > >//flip the log array, so you now have > >//an array full of the lines in the log > >//file that matches a number in the in.txt file > >$answer = array_flip($intersect); > > > >Hope that works... I can't test it. There are many ways you can do this... > > > >--John Holmes... > >----- Original Message ----- > >From: "Didier McGillis" <codesmokerhotmail.com> > >To: <holmes072000charter.net> > >Sent: Tuesday, January 21, 2003 5:49 PM > >Subject: Re: [PHP] HELP HELP on a file parser > > > > > > > Sorry should have done this. > > > > > > in.txt (there will be 470 of these #'s) - it uses these numbers to check > > > against the chek.txt file > > > 455784 > > > 455785 > > > 455786 > > > 455787 > > > 455788 > > > > > > check.txt - after it checks this file where number=389487 a number from > > > in.txt, if it does it writes that to another file > > > not on q/n2 24 Sat Nov 12 00:27:34 2002 > > > 3 129 code=001;number=389487;name=Blah L > > > McBlah;type=5;big_number=888888888;time=09;min=2004; > > > > > > > > > found.txt gets written to either in this format > > > not on q/n2 24 Sat Nov 12 00:27:34 2002 > > > 3 129 code=001;number=389487;name=Blah L > > > McBlah;type=5;big_number=888888888;time=09;min=2004; > > > or this format > > > code=001;number=389487;name=Blah L > > > McBlah;type=5;big_number=888888888;time=09;min=2004 > > > > > > hope that helps. > > > > > > > > > >From: "1LT John W. Holmes" <holmes072000charter.net> > > > >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> > > > >To: "Didier McGillis" <codesmokerhotmail.com>, > ><php-generallists.php.net> > > > >Subject: Re: [PHP] HELP HELP on a file parser > > > >Date: Tue, 21 Jan 2003 17:33:36 -0500 > > > > > > > > > I need some help, I think this is probably really simple and I was > > > >wondering > > > > > if anyone had some code I could use to help me write this. > > > > > > > > > > I need a page to parse a text file with a list of numbers, and then > >take > > > > > those numbers and parse another file with over 7MB of information > >and > >to > > > > > look for those numbers and then to pull out the matches. Now the > >file > > > >that > > > > > its looking through each record that has a number in it is in a > >specific > > > > > format with a beginnning and an end. > > > > > > > >Can you give a short example of each file and what you want to match in > > > >each? > > > > > > > >---John Holmes... > > > > > > > > > > > >-- > > > >PHP General Mailing List (http://www.php.net/) > > > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > _________________________________________________________________ > > > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > > > http://join.msn.com/?page=features/junkmail > > > > > > _________________________________________________________________ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    > $answer = array_flip($intersect); > fwrite ($results, $answer);

    That won't work, either. It'll write "Array" to your file, probably.

    You'll want this:

    $answer = array_flip($intersect); $results_file = implode("\n",$answer); fwrite($results,$results_file);

    ---John Holmes...

    ----- Original Message ----- From: "Didier McGillis" <codesmokerhotmail.com> To: <php-generallists.php.net> Sent: Wednesday, January 22, 2003 4:23 PM Subject: Re: [PHP] HELP HELP on a file parser

    > Fixed a couple of things in the code. Pretty good for psudo code. :) > > But I get this error when running. > > Warning: Argument #1 to array_intersect() is not an array in > /home/httpd/vhosts/mccullough-net.com/httpdocs/GH/parse2.php on line 27 > > Warning: Wrong datatype in array_flip() call in > /home/httpd/vhosts/mccullough-net.com/httpdocs/GH/parse2.php on line 32 > > code below. any thoughts on what might be choking it. > > <? > //read numbers > $numbers = file("bad.txt"); > > //read all lines from log file > $fp = fopen("file2.log","r"); > $log_file = fread($fp,filesize("file2.log")); > > $results = fopen ("results.txt", "w"); > > //match lines of log_file that start with 'code' > //and match number > preg_match_all("/^(code.*number=([0-9]+).*)$/m",$log_file,$matches); > > //put matches into an array such as > // $array[code] = number > $x=0; > foreach($matches[1] as $code) > { > $number = $matches[2][$x++]; > $log_file_array[$code] = $number; > } > > //compute intersection of log file array > //and numbers array > $intersect = array_intersect($log_file_array[$code],$numbers); > > //flip the log array, so you now have > //an array full of the lines in the log > //file that matches a number in the in.txt file

    > > > > > > >From: "1LT John W. Holmes" <holmes072000charter.net> > >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> > >To: "Didier McGillis" <codesmokerhotmail.com> > >CC: <php-generallists.php.net> > >Subject: Re: [PHP] HELP HELP on a file parser > >Date: Wed, 22 Jan 2003 16:07:17 -0500 > > > >Okay, if I understand everything correctly, something like this may work, > >if > >you can get around the issue of your file sizes being so large, and you can > >deal with the amount of memory this is going to eat up, and you realize > >that > >Perl is probably better suited to the job... > > > >//read numbers > >$numbers = file("in.txt"); > > > >//read all lines from log file > >$fp = fopen("file.log","r"); > >$log_file = fread($fp,filesize("file.log")); > > > >//match lines of log_file that start with 'code' > >//and match number > >preg_match_all("/^(code.*number=([0-9]+).*)$/m",$log_file,$matches); > > > >//put matches into an array such as > >// $array[code] = number > >$x=0; > >foreach($mathes[1] as $code) > >{ > > $number = $matches[2][$x++]; > > $log_file_array[$code] = $number; > >} > > > >//compute intersection of log file array > >//and numbers array > >$intersect = array_intersect($log_file_array,$numbers); > > > >//flip the log array, so you now have > >//an array full of the lines in the log > >//file that matches a number in the in.txt file > >$answer = array_flip($intersect); > > > >Hope that works... I can't test it. There are many ways you can do this... > > > >--John Holmes... > >----- Original Message ----- > >From: "Didier McGillis" <codesmokerhotmail.com> > >To: <holmes072000charter.net> > >Sent: Tuesday, January 21, 2003 5:49 PM > >Subject: Re: [PHP] HELP HELP on a file parser > > > > > > > Sorry should have done this. > > > > > > in.txt (there will be 470 of these #'s) - it uses these numbers to check > > > against the chek.txt file > > > 455784 > > > 455785 > > > 455786 > > > 455787 > > > 455788 > > > > > > check.txt - after it checks this file where number=389487 a number from > > > in.txt, if it does it writes that to another file > > > not on q/n2 24 Sat Nov 12 00:27:34 2002 > > > 3 129 code=001;number=389487;name=Blah L > > > McBlah;type=5;big_number=888888888;time=09;min=2004; > > > > > > > > > found.txt gets written to either in this format > > > not on q/n2 24 Sat Nov 12 00:27:34 2002 > > > 3 129 code=001;number=389487;name=Blah L > > > McBlah;type=5;big_number=888888888;time=09;min=2004; > > > or this format > > > code=001;number=389487;name=Blah L > > > McBlah;type=5;big_number=888888888;time=09;min=2004 > > > > > > hope that helps. > > > > > > > > > >From: "1LT John W. Holmes" <holmes072000charter.net> > > > >Reply-To: "1LT John W. Holmes" <holmes072000charter.net> > > > >To: "Didier McGillis" <codesmokerhotmail.com>, > ><php-generallists.php.net> > > > >Subject: Re: [PHP] HELP HELP on a file parser > > > >Date: Tue, 21 Jan 2003 17:33:36 -0500 > > > > > > > > > I need some help, I think this is probably really simple and I was > > > >wondering > > > > > if anyone had some code I could use to help me write this. > > > > > > > > > > I need a page to parse a text file with a list of numbers, and then > >take > > > > > those numbers and parse another file with over 7MB of information > >and > >to > > > > > look for those numbers and then to pull out the matches. Now the > >file > > > >that > > > > > its looking through each record that has a number in it is in a > >specific > > > > > format with a beginnning and an end. > > > > > > > >Can you give a short example of each file and what you want to match in > > > >each? > > > > > > > >---John Holmes... > > > > > > > > > > > >-- > > > >PHP General Mailing List (http://www.php.net/) > > > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > _________________________________________________________________ > > > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > > > http://join.msn.com/?page=features/junkmail > > > > > > _________________________________________________________________ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi! Is there a way to do the decryption of the encrypted data with the use of md5()??

    attached mail follows:


    > Hi! Is there a way to do the decryption of the encrypted data with the use > of md5()??

    Nope. md5 is a one way function.

    http://www.faqs.org/faqs/cryptography-faq/part07/

    Brad

    attached mail follows:


    No. md5() is not an encryption, it's a hash. ----- Original Message ----- From: "Scott Fletcher" <scottabcoa.com> To: <> Sent: Wednesday, January 22, 2003 3:47 PM Subject: [PHP] Is there a way to undo the md5() encryption??

    Hi! Is there a way to do the decryption of the encrypted data with the use of md5()??

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

    attached mail follows:


    Darn!! There's no way to undo it. So, I can't use this method of encryption for my other project. In that case, I'll live.....

    "Scott Fletcher" <scottabcoa.com> wrote in message news:20030122214206.71829.qmailpb1.pair.com... > Hi! Is there a way to do the decryption of the encrypted data with the use > of md5()?? > >

    attached mail follows:


    I had it figured out!! Don't need to decrypt it. Instead, I can encrypt the account number by javascript. Grab the unencrypted account number. Put it into two variable, encrypt the first one with PHP and match it by Javascript. If accept then I use the 2nd variable to grab the data from the data and put it into the sessions. This will take care of the problem with my other project....

    Cheers!!!!!

    Thanks, Scott F.

    "Brad Pauly" <bradrobinsontech.com> wrote in message news:1043271786.1236.34.camelearth... > > Hi! Is there a way to do the decryption of the encrypted data with the use > > of md5()?? > > Nope. md5 is a one way function. > > http://www.faqs.org/faqs/cryptography-faq/part07/ > > Brad >

    attached mail follows:


    Scott Fletcher said: > Darn!! There's no way to undo it. So, I can't use this method of > encryption for my other project. In that case, I'll live.....

    Lemme guess? Was it going to be a revolutionary compression program that can compress any file to 128 bits?

    In all seriousness, the output of MD5 is not encrypted, it is a digest. That, BTW, is what the D stands for.

    -Peter

    attached mail follows:


    "Scott Fletcher" <scottabcoa.com> wrote in message news:20030122214206.71829.qmailpb1.pair.com... > Hi! Is there a way to do the decryption of the encrypted data with the use > of md5()??

    nope, that's way it is called one-way function. But if you could, I assume it would be worth a big pile of money ;).

    rush

    --
    http://www.templatetamer.org/
    

    > >

    attached mail follows:


    In article <3E2EAF18.9090908optonline.net>, Scott Saraniero wrote: > Hi, > > I'm using this line to send an e-mail with info: > > mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders); > > If I want to add mail recipients, or cc, or bcc, how would I do this?

    add "cc: foobar.baz\n" etc. to your $mailheaders

    -- 
    Aquarion, http://www.aquarionics.com, aquarionsuespammers.org
    Happiness is good health and a bad memory.
    		-- Ingrid Bergman
    

    attached mail follows:


    In article <3E2EAF18.9090908optonline.net>, Scott Saraniero wrote: > Hi, > > I'm using this line to send an e-mail with info: > > mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders); > > If I want to add mail recipients, or cc, or bcc, how would I do this?

    add "cc: foobar.baz\n" etc. to your $mailheaders

    -- 
    Aquarion, http://www.aquarionics.com, aquarionsuespammers.org
    Happiness is good health and a bad memory.
    		-- Ingrid Bergman
    

    attached mail follows:


    In article <3E2EAF18.9090908optonline.net>, Scott Saraniero wrote: > Hi, > > I'm using this line to send an e-mail with info: > > mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders); > > If I want to add mail recipients, or cc, or bcc, how would I do this?

    add "cc: foobar.baz\n" etc. to your $mailheaders

    -- 
    Aquarion, http://www.aquarionics.com, aquarionsuespammers.org
    Happiness is good health and a bad memory.
    		-- Ingrid Bergman
    

    attached mail follows:


    > > I'm using this line to send an e-mail with info: > > > > mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders); > > > > If I want to add mail recipients, or cc, or bcc, how would I do this? > > add "cc: foobar.baz\n" etc. to your $mailheaders

    Use \r\n to separate headers, not just \n.

    ---John Holmes...

    attached mail follows:


    In article <3E2EAF18.9090908optonline.net>, Scott Saraniero wrote: > Hi, > > I'm using this line to send an e-mail with info: > > mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders); > > If I want to add mail recipients, or cc, or bcc, how would I do this?

    add "cc: foobar.baz\n" etc. to your $mailheaders

    -- 
    Aquarion, http://www.aquarionics.com, aquarionsuespammers.org
    Happiness is good health and a bad memory.
    		-- Ingrid Bergman
    

    attached mail follows:


    In article <3E2EAF18.9090908optonline.net>, Scott Saraniero wrote: > Hi, > > I'm using this line to send an e-mail with info: > > mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders); > > If I want to add mail recipients, or cc, or bcc, how would I do this?

    add "cc: foobar.baz\n" etc. to your $mailheaders

    -- 
    Aquarion, http://www.aquarionics.com, aquarionsuespammers.org
    Happiness is good health and a bad memory.
    		-- Ingrid Bergman
    

    attached mail follows:


    In article <3E2EAF18.9090908optonline.net>, Scott Saraniero wrote: > Hi, > > I'm using this line to send an e-mail with info: > > mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders); > > If I want to add mail recipients, or cc, or bcc, how would I do this?

    add "cc: foobar.baz\n" etc. to your $mailheaders

    -- 
    Aquarion, http://www.aquarionics.com, aquarionsuespammers.org
    Happiness is good health and a bad memory.
    		-- Ingrid Bergman
    

    attached mail follows:


    Hi,

    I'm new to php (ok new, try 3 days ;), althought, I'm finding it fun, I 'm trying to think of a project to do, to get me more into it.

    And after having a discussion with a friend and also setting up several Mailman mailing lists for people that want to compose HTML mails and post them as newsletters, it got me thinking, would I be able to create a similar program to mailman in php?

    So admins just login to the list. copy and past the html into a text box and php then renders it for a preview, then if they like it, they click send, this send queries the database and sends it to all the people list to receive mail on that list.

    I would assume that the sending could be handed off somehow to sendmail/postfix?

    The list front end would also hold list preferances as well, for subscribers and admins, basically I want to mimik Mailman, but in php and be able to render previews of mails first, basically it will be a newsletter program, rather than a mailing list one, which is where Mailman falls over.

    Cheers

    Mark

    -- 
    To steal ideas from one person is plagiarism;
    to steal from many is research.
    

    attached mail follows:


    Hello,

    On 01/22/2003 08:15 PM, Mark C wrote: > I'm new to php (ok new, try 3 days ;), althought, I'm finding it fun, I > 'm trying to think of a project to do, to get me more into it. > > And after having a discussion with a friend and also setting up several > Mailman mailing lists for people that want to compose HTML mails and > post them as newsletters, it got me thinking, would I be able to create > a similar program to mailman in php? > > So admins just login to the list. copy and past the html into a text box > and php then renders it for a preview, then if they like it, they click > send, this send queries the database and sends it to all the people list > to receive mail on that list. > > I would assume that the sending could be handed off somehow to > sendmail/postfix?

    Yes, but you are recommend to set sendmail with the appropriate queuing flags so it does not stall your PHP script while attempting to deliver to every subscribers and instead just queue the messages without delay.

    In that case you may want to try this class for composing and sending messages, that has a sub-class for sending using sendmail program directly. It already comes with options that let you tell to just queue the messages without delay as needed.

    http://www.phpclasses.org/mimemessage

    > The list front end would also hold list preferances as well, for > subscribers and admins, > basically I want to mimik Mailman, but in php and be able to render > previews of mails first, basically it will be a newsletter program, > rather than a mailing list one, which is where Mailman falls over.

    Yes, but keep in mind that besides composing and sending messages, you also have to take care of creating subscriber records, validating subscriber addresses, handling bounces, handling unsubscriptions, etc... and dedicating mailing list manager programs already do that.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    Yes, this is a reasonable candidate for a PHP project, however:

    1. why reinvent the wheel?

    2. There are some serious issues with using PHP's mail() command:

    a) large mailing lists will time out on individual emails

    b) the alternative to a is to use Bcc. Your ISP will probably set the maximum to 100 emails in a Bcc, which throws that idea out the window

    c) the alternative to a and b seems to be injecting emails directly into the mail que with sendmail, and all sorts of stuff I haven't looked into yet.

    There is a class (not not a tutorial, a class in OOP way) on phpclasses.org which offers (what seems to be) every answer to the above issues, but I've never used it, and it's OOP nature may be a complex way to get into PHP.

    There are literally 100's of threads about mailing lists in the archives.

    Justin

    on 23/01/03 9:15 AM, Mark C (gen-listsblueyonder.co.uk) wrote:

    > Hi, > > I'm new to php (ok new, try 3 days ;), althought, I'm finding it fun, I > 'm trying to think of a project to do, to get me more into it. > > And after having a discussion with a friend and also setting up several > Mailman mailing lists for people that want to compose HTML mails and > post them as newsletters, it got me thinking, would I be able to create > a similar program to mailman in php? > > So admins just login to the list. copy and past the html into a text box > and php then renders it for a preview, then if they like it, they click > send, this send queries the database and sends it to all the people list > to receive mail on that list. > > I would assume that the sending could be handed off somehow to > sendmail/postfix? > > The list front end would also hold list preferances as well, for > subscribers and admins, > basically I want to mimik Mailman, but in php and be able to render > previews of mails first, basically it will be a newsletter program, > rather than a mailing list one, which is where Mailman falls over. > > Cheers > > Mark >

    attached mail follows:


    On Wednesday 22 January 2003 18:52, 1LT John W. Holmes wrote:

    > There's really no change from the PHP side. PHP just sends the data and > receives something back The only change in PHP is that mysql_connect() now > supports additional flags to connect over SSL.

    Nope, I only forgot to remove a constant. SSL support will be available in PHP 5 (new mysql extension).

    Regards

    Georg

    attached mail follows:


    > On Wednesday 22 January 2003 18:52, 1LT John W. Holmes wrote: > > > There's really no change from the PHP side. PHP just sends the data and > > receives something back The only change in PHP is that mysql_connect() > now > > supports additional flags to connect over SSL. > > Nope, I only forgot to remove a constant. SSL support will be available in > PHP 5 (new mysql extension). > > Regards > > Georg

    Ah, man... Now you made my article in the last issue of PHP|Architect incorrect! :)

    Oh well, I guess we'll have to wait.

    ---John W. Holmes...

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

    attached mail follows:


    When I insert a date into Mysql it has to be in year/month/day format or else it wont go in right. how do I convert my date variable which is in month /day /year format into year/month/day format?

    --
    Productos de salud:
    http://www.nvtechnologies.com/hgh
    

    attached mail follows:


    Hi Guys,

    Does anyone happen to know why the below code reads the directory in reverse alphabetical order? Not a major problem - easy enough to whack it in an array and sort it, but annoying nonetheless.

    $default_dir = "../screenshots";

    if (!($dp = opendir($default_dir))) die("cannot open $default_dir"); while($file = readdir($dp)) if($file != '.' && $file != '..') echo"<a href='opendir.php?opendir=$file'>$file</a><BR>"; closedir($dp);

    Best Regards Bob Irwin Server Admin & Web Programmer Planet Netcom

    attached mail follows:


    is it on a unix system?

    if so, do an ls on the system and you will see that the files are listed in that order.

    it is the order in which they were copied to the directory.

    try going through a loop before you run your main loop, create an array() then sort that with some sorting functions and you'll have it.

    Jim ----- Original Message ----- From: "Bob Irwin" <bobstaff.pnc.com.au> To: <php-generallists.php.net> Sent: Wednesday, January 22, 2003 3:03 PM Subject: [PHP] Reading Directory in reverse

    > Hi Guys, > > Does anyone happen to know why the below code reads the directory in reverse > alphabetical order? Not a major problem - easy enough to whack it in an > array and sort it, but annoying nonetheless. > > > $default_dir = "../screenshots"; > > if (!($dp = opendir($default_dir))) die("cannot open $default_dir"); > while($file = readdir($dp)) > if($file != '.' && $file != '..') echo"<a > href='opendir.php?opendir=$file'>$file</a><BR>"; > closedir($dp); > > Best Regards > Bob Irwin > Server Admin & Web Programmer > Planet Netcom > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    I SETUP THE PHP PARSE ENGINE ON ABOUT A YEAR AGO ON ONE OF MY WEB SERVERS AND EVERYTHING WORKED JUST FINE. I, HOWEVER, RECENTLY ACQUIRED A NEW SERVER AND TRIED TO SETUP PHP AGAIN ON IIS 5.0 ON A WIN 2K SERVER PLATFORM. EVERYTHING SEEMS TO BE WORKING CORRECTLY, BUT FOR SOME REASONS WHEN I TRY TO ACCESS ANY VARIABLES PASSED FROM A HTML FORM, I ALWAYS GET AN ERROR.

    FOR EXAMPLE IF I HAVE A FORM THAT PASSES THE VARIABLE $ACTION I GET THE FOLLOW ERROR WHEN I TRY TO ACCESS THE SAME VARIABLE IN PHP PAGE:

    Notice: Undefined variable: action in C:\...\otelzoo.com\cust_care.php on line 9

    I HAVE REINSTALLED THE PHP PARSER THREE TIMES NOW AND I HAVE HAD NO LUCK IN GETTING RID OF THIS PROBLEM. I KNOW MOST PEOPLE WILL JUMP TO THE CONCLUSION THAT THERE IS A SIMPLE ERROR IN THE ACTUAL SOURCE CODE ITSELF, BUT I PROMISE YOU THAT I HAVE BEEN PROGRAMMING IN THIS LANGUAGE FOR AT LEAST TWO YEARS AND I AM 100% SURE THAT I AM PASSING THE VARIABLE CORRECTLY.

    PLEASE HELP.

    THANK YOU. - DALE

    attached mail follows:


    Global Variables are turned off!!! check php.ini!!

    Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: timhitcho.com.au

    > -----Original Message----- > From: Dale [mailto:DaleHershhotmail.com] > Sent: Thursday, 23 January 2003 10:02 AM > To: php-generallists.php.net > Subject: [PHP] NEED HELP URGENTLY > > > I SETUP THE PHP PARSE ENGINE ON ABOUT A YEAR AGO ON ONE OF MY > WEB SERVERS AND EVERYTHING WORKED JUST FINE. I, HOWEVER, > RECENTLY ACQUIRED A NEW SERVER AND TRIED TO SETUP PHP AGAIN > ON IIS 5.0 ON A WIN 2K SERVER PLATFORM. EVERYTHING SEEMS TO > BE WORKING CORRECTLY, BUT FOR SOME REASONS WHEN I TRY TO > ACCESS ANY VARIABLES PASSED FROM A HTML FORM, I ALWAYS GET AN ERROR. > > FOR EXAMPLE IF I HAVE A FORM THAT PASSES THE VARIABLE $ACTION > I GET THE FOLLOW ERROR WHEN I TRY TO ACCESS THE SAME VARIABLE > IN PHP PAGE: > > Notice: Undefined variable: action in > C:\...\otelzoo.com\cust_care.php on line 9 > > I HAVE REINSTALLED THE PHP PARSER THREE TIMES NOW AND I HAVE > HAD NO LUCK IN GETTING RID OF THIS PROBLEM. I KNOW MOST > PEOPLE WILL JUMP TO THE CONCLUSION THAT THERE IS A SIMPLE > ERROR IN THE ACTUAL SOURCE CODE ITSELF, BUT I PROMISE YOU > THAT I HAVE BEEN PROGRAMMING IN THIS LANGUAGE FOR AT LEAST > TWO YEARS AND I AM 100% SURE THAT I AM PASSING THE VARIABLE CORRECTLY. > > PLEASE HELP. > > THANK YOU. > - DALE > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    AND PLEASE STOP YELLING!!!!!!!!

    HiTCHO said: > Global Variables are turned off!!! check php.ini!! > > > > Timothy Hitchens (HiTCHO) > Open Source Consulting > e-mail: timhitcho.com.au > >> -----Original Message----- >> From: Dale [mailto:DaleHershhotmail.com] >> Sent: Thursday, 23 January 2003 10:02 AM >> To: php-generallists.php.net >> Subject: [PHP] NEED HELP URGENTLY >> >> >> I SETUP THE PHP PARSE ENGINE ON ABOUT A YEAR AGO ON ONE OF MY >> WEB SERVERS AND EVERYTHING WORKED JUST FINE. I, HOWEVER, >> RECENTLY ACQUIRED A NEW SERVER AND TRIED TO SETUP PHP AGAIN >> ON IIS 5.0 ON A WIN 2K SERVER PLATFORM. EVERYTHING SEEMS TO >> BE WORKING CORRECTLY, BUT FOR SOME REASONS WHEN I TRY TO >> ACCESS ANY VARIABLES PASSED FROM A HTML FORM, I ALWAYS GET AN ERROR. >> >> FOR EXAMPLE IF I HAVE A FORM THAT PASSES THE VARIABLE $ACTION >> I GET THE FOLLOW ERROR WHEN I TRY TO ACCESS THE SAME VARIABLE >> IN PHP PAGE: >> >> Notice: Undefined variable: action in >> C:\...\otelzoo.com\cust_care.php on line 9 >> >> I HAVE REINSTALLED THE PHP PARSER THREE TIMES NOW AND I HAVE >> HAD NO LUCK IN GETTING RID OF THIS PROBLEM. I KNOW MOST >> PEOPLE WILL JUMP TO THE CONCLUSION THAT THERE IS A SIMPLE >> ERROR IN THE ACTUAL SOURCE CODE ITSELF, BUT I PROMISE YOU >> THAT I HAVE BEEN PROGRAMMING IN THIS LANGUAGE FOR AT LEAST >> TWO YEARS AND I AM 100% SURE THAT I AM PASSING THE VARIABLE CORRECTLY. >> >> PLEASE HELP. >> >> THANK YOU. >> - DALE >> >> >> >> >> -- >> 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

    attached mail follows:


    First of all, you don't need to type in all caps like that. I thought this was the Nigerian Scam for a minute there! :-) Anyway, in PHP 4.2+, the php.ini setting register_globals is off by default. You'll need to either turn it on, or start using the newer $_POST superglobal array. For more information, take a look at http://www.php.net/manual/en/security.registerglobals.php.

    Dale wrote:

    >I SETUP THE PHP PARSE ENGINE ON ABOUT A YEAR AGO ON ONE OF MY WEB SERVERS >AND EVERYTHING WORKED JUST FINE. I, HOWEVER, RECENTLY ACQUIRED A NEW SERVER >AND TRIED TO SETUP PHP AGAIN ON IIS 5.0 ON A WIN 2K SERVER PLATFORM. >EVERYTHING SEEMS TO BE WORKING CORRECTLY, BUT FOR SOME REASONS WHEN I TRY TO >ACCESS ANY VARIABLES PASSED FROM A HTML FORM, I ALWAYS GET AN ERROR. > >FOR EXAMPLE IF I HAVE A FORM THAT PASSES THE VARIABLE $ACTION I GET THE >FOLLOW ERROR WHEN I TRY TO ACCESS THE SAME VARIABLE IN PHP PAGE: > >Notice: Undefined variable: action in C:\...\otelzoo.com\cust_care.php on >line 9 > >I HAVE REINSTALLED THE PHP PARSER THREE TIMES NOW AND I HAVE HAD NO LUCK IN >GETTING RID OF THIS PROBLEM. I KNOW MOST PEOPLE WILL JUMP TO THE CONCLUSION >THAT THERE IS A SIMPLE ERROR IN THE ACTUAL SOURCE CODE ITSELF, BUT I PROMISE >YOU THAT I HAVE BEEN PROGRAMMING IN THIS LANGUAGE FOR AT LEAST TWO YEARS AND >I AM 100% SURE THAT I AM PASSING THE VARIABLE CORRECTLY. > >PLEASE HELP. > >THANK YOU. >- DALE > > > > > >

    -- 
    The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
    

    attached mail follows:


    And then read some articles or news on the language you've been "programming in for two years"

    ---John Holmes...

    > -----Original Message----- > From: Timothy Hitchens (HiTCHO) [mailto:hitchophp.net] > Sent: Wednesday, January 22, 2003 6:58 PM > To: 'Dale'; php-generallists.php.net > Subject: RE: [PHP] NEED HELP URGENTLY > > Global Variables are turned off!!! check php.ini!! > > > > Timothy Hitchens (HiTCHO) > Open Source Consulting > e-mail: timhitcho.com.au > > > -----Original Message----- > > From: Dale [mailto:DaleHershhotmail.com] > > Sent: Thursday, 23 January 2003 10:02 AM > > To: php-generallists.php.net > > Subject: [PHP] NEED HELP URGENTLY > > > > > > I SETUP THE PHP PARSE ENGINE ON ABOUT A YEAR AGO ON ONE OF MY > > WEB SERVERS AND EVERYTHING WORKED JUST FINE. I, HOWEVER, > > RECENTLY ACQUIRED A NEW SERVER AND TRIED TO SETUP PHP AGAIN > > ON IIS 5.0 ON A WIN 2K SERVER PLATFORM. EVERYTHING SEEMS TO > > BE WORKING CORRECTLY, BUT FOR SOME REASONS WHEN I TRY TO > > ACCESS ANY VARIABLES PASSED FROM A HTML FORM, I ALWAYS GET AN ERROR. > > > > FOR EXAMPLE IF I HAVE A FORM THAT PASSES THE VARIABLE $ACTION > > I GET THE FOLLOW ERROR WHEN I TRY TO ACCESS THE SAME VARIABLE > > IN PHP PAGE: > > > > Notice: Undefined variable: action in > > C:\...\otelzoo.com\cust_care.php on line 9 > > > > I HAVE REINSTALLED THE PHP PARSER THREE TIMES NOW AND I HAVE > > HAD NO LUCK IN GETTING RID OF THIS PROBLEM. I KNOW MOST > > PEOPLE WILL JUMP TO THE CONCLUSION THAT THERE IS A SIMPLE > > ERROR IN THE ACTUAL SOURCE CODE ITSELF, BUT I PROMISE YOU > > THAT I HAVE BEEN PROGRAMMING IN THIS LANGUAGE FOR AT LEAST > > TWO YEARS AND I AM 100% SURE THAT I AM PASSING THE VARIABLE CORRECTLY. > > > > PLEASE HELP. > > > > THANK YOU. > > - DALE > > > > > > > > > > -- > > 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

    attached mail follows:


    Hi,

    I'm trying to construct a regular expression to find HTML open tags without closing tags up to another of the same HTML open tag or a closing tag of a different type that's no enclosed in the implied closing tag optional HTML tag (for example <p> doesn't require a closing tag. The closing tag is implied and so is its body).

    For example, the HTML snippet:

    <html><head><title>Test HTML</title></head> <body> <p><font>This tag is ok<br></font></p> <font><p>I want to find this p tag<br> and up to the next opening p tag<br> <b>test<br></b></font> <p>I want to find this one too </body>

    I don't want to find <p> tags with a complete structure. ex: <p>This is a &lt;p&gt; tag with a complete structure</p>

    Instead, I want to find the <p> tag with no closing tag, up to the next <p> tag or a closing tag of any type that doesn't have an opening tag after the initial <p> found (not including this orphaned closing tag)

    Andreas Sheriff

    attached mail follows:


    Hi...

    A simple question... In the following code:

    <?

    $ip = getenv("REMOTE_ADDR");

    echo " ip = ".$ip;

    echo " ip = " . getenv("REMOTE_ADDR");

    echo " ip = " . getenv('REMOTE_ADDR');

    echo " ip = ". $REMOTE_ADDR; <------

    ?>

    I can only seem to get the last line to display the correct value. It's as if I can't seem to get/return any of the SERVER environment variables using the getenv() function....

    I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0.

    I've checked through the PHP.INI file, but couldn't seem to find why this might be occuring. Any help/assistance would be appreciated.....

    thanks

    bruce bedouglasearthlink.net

    attached mail follows:


    just copied your code and it worked fine for me.

    system: Apache 1.3.26 PHP 4.2.2

    I would look into apache 2.0 and the env vars that are available from it.

    ----- Original Message ----- From: "Bruce Douglas" <bedouglasearthlink.net> To: <php-generallists.php.net> Sent: Wednesday, January 22, 2003 3:57 PM Subject: [PHP] a simple getenv question....

    > Hi... > > A simple question... In the following code: > > <? > > $ip = getenv("REMOTE_ADDR"); > > echo " ip = ".$ip; > > echo " ip = " . getenv("REMOTE_ADDR"); > > echo " ip = " . getenv('REMOTE_ADDR'); > > echo " ip = ". $REMOTE_ADDR; <------ > > ?> > > I can only seem to get the last line to display the correct value. It's as > if I can't seem to get/return any of the SERVER environment variables using > the getenv() function.... > > I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0. > > I've checked through the PHP.INI file, but couldn't seem to find why this > might be occuring. Any help/assistance would be appreciated..... > > thanks > > bruce > bedouglasearthlink.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    The simplest way to start looking would be phpinfo() page for starters.

    Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: timhitcho.com.au

    > -----Original Message----- > From: Jim Lucas [mailto:phplistzonedzero.net] > Sent: Thursday, 23 January 2003 10:15 AM > To: Bruce Douglas; php-generallists.php.net > Subject: Re: [PHP] a simple getenv question.... > > > just copied your code and it worked fine for me. > > system: Apache 1.3.26 > PHP 4.2.2 > > I would look into apache 2.0 and the env vars that are > available from it. > > > ----- Original Message ----- > From: "Bruce Douglas" <bedouglasearthlink.net> > To: <php-generallists.php.net> > Sent: Wednesday, January 22, 2003 3:57 PM > Subject: [PHP] a simple getenv question.... > > > > Hi... > > > > A simple question... In the following code: > > > > <? > > > > $ip = getenv("REMOTE_ADDR"); > > > > echo " ip = ".$ip; > > > > echo " ip = " . getenv("REMOTE_ADDR"); > > > > echo " ip = " . getenv('REMOTE_ADDR'); > > > > echo " ip = ". $REMOTE_ADDR; <------ > > > > ?> > > > > I can only seem to get the last line to display the correct value. > > It's as if I can't seem to get/return any of the SERVER environment > > variables > using > > the getenv() function.... > > > > I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0. > > > > I've checked through the PHP.INI file, but couldn't seem to > find why > > this might be occuring. Any help/assistance would be > appreciated..... > > > > thanks > > > > bruce > > bedouglasearthlink.net > > > > > > > > -- > > 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 >

    attached mail follows:


    phpinfo() returns everything as expected.. but not having the code .. i don't know what internal method it uses to access the information...

    but thanks...

    -bruce

    -----Original Message----- From: Timothy Hitchens (HiTCHO) [mailto:hitchophp.net] Sent: Wednesday, January 22, 2003 4:18 PM To: 'Jim Lucas'; 'Bruce Douglas'; php-generallists.php.net Subject: RE: [PHP] a simple getenv question....

    The simplest way to start looking would be phpinfo() page for starters.

    Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: timhitcho.com.au

    > -----Original Message----- > From: Jim Lucas [mailto:phplistzonedzero.net] > Sent: Thursday, 23 January 2003 10:15 AM > To: Bruce Douglas; php-generallists.php.net > Subject: Re: [PHP] a simple getenv question.... > > > just copied your code and it worked fine for me. > > system: Apache 1.3.26 > PHP 4.2.2 > > I would look into apache 2.0 and the env vars that are > available from it. > > > ----- Original Message ----- > From: "Bruce Douglas" <bedouglasearthlink.net> > To: <php-generallists.php.net> > Sent: Wednesday, January 22, 2003 3:57 PM > Subject: [PHP] a simple getenv question.... > > > > Hi... > > > > A simple question... In the following code: > > > > <? > > > > $ip = getenv("REMOTE_ADDR"); > > > > echo " ip = ".$ip; > > > > echo " ip = " . getenv("REMOTE_ADDR"); > > > > echo " ip = " . getenv('REMOTE_ADDR'); > > > > echo " ip = ". $REMOTE_ADDR; <------ > > > > ?> > > > > I can only seem to get the last line to display the correct value. > > It's as if I can't seem to get/return any of the SERVER environment > > variables > using > > the getenv() function.... > > > > I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0. > > > > I've checked through the PHP.INI file, but couldn't seem to > find why > > this might be occuring. Any help/assistance would be > appreciated..... > > > > thanks > > > > bruce > > bedouglasearthlink.net > > > > > > > > -- > > 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 >

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

    attached mail follows:


    Do this:

    <?php

    print_r($_SERVER);

    ?>

    If what you want is here this just use: $_SERVER['REMOTE_ADDR'] etc

    You will need to have a look at the source of the output as the rendered view will look a little strange.

    Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: timhitcho.com.au

    > -----Original Message----- > From: Bruce Douglas [mailto:bedouglasearthlink.net] > Sent: Thursday, 23 January 2003 10:33 AM > To: php-generallists.php.net > Subject: RE: [PHP] a simple getenv question.... > > > phpinfo() returns everything as expected.. but not having the > code .. i don't know what internal method it uses to access > the information... > > but thanks... > > -bruce > > > -----Original Message----- > From: Timothy Hitchens (HiTCHO) [mailto:hitchophp.net] > Sent: Wednesday, January 22, 2003 4:18 PM > To: 'Jim Lucas'; 'Bruce Douglas'; php-generallists.php.net > Subject: RE: [PHP] a simple getenv question.... > > > The simplest way to start looking would be phpinfo() page for > starters. > > > Timothy Hitchens (HiTCHO) > Open Source Consulting > e-mail: timhitcho.com.au > > > -----Original Message----- > > From: Jim Lucas [mailto:phplistzonedzero.net] > > Sent: Thursday, 23 January 2003 10:15 AM > > To: Bruce Douglas; php-generallists.php.net > > Subject: Re: [PHP] a simple getenv question.... > > > > > > just copied your code and it worked fine for me. > > > > system: Apache 1.3.26 > > PHP 4.2.2 > > > > I would look into apache 2.0 and the env vars that are > available from > > it. > > > > > > ----- Original Message ----- > > From: "Bruce Douglas" <bedouglasearthlink.net> > > To: <php-generallists.php.net> > > Sent: Wednesday, January 22, 2003 3:57 PM > > Subject: [PHP] a simple getenv question.... > > > > > > > Hi... > > > > > > A simple question... In the following code: > > > > > > <? > > > > > > $ip = getenv("REMOTE_ADDR"); > > > > > > echo " ip = ".$ip; > > > > > > echo " ip = " . getenv("REMOTE_ADDR"); > > > > > > echo " ip = " . getenv('REMOTE_ADDR'); > > > > > > echo " ip = ". $REMOTE_ADDR; <------ > > > > > > ?> > > > > > > I can only seem to get the last line to display the > correct value. > > > It's as if I can't seem to get/return any of the SERVER > environment > > > variables > > using > > > the getenv() function.... > > > > > > I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0. > > > > > > I've checked through the PHP.INI file, but couldn't seem to > > find why > > > this might be occuring. Any help/assistance would be > > appreciated..... > > > > > > thanks > > > > > > bruce > > > bedouglasearthlink.net > > > > > > > > > > > > -- > > > 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 > > > > > -- > 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 >

    attached mail follows:


    Timothy,

    Thanks for your input.. but I was trying to get a better understanding as to why the getenv() function was apparently not returning the SERVER environment vars.....

    thanks

    -bruce

    -----Original Message----- From: Timothy Hitchens (HiTCHO) [mailto:hitchophp.net] Sent: Wednesday, January 22, 2003 4:39 PM To: 'Bruce Douglas'; php-generallists.php.net Subject: RE: [PHP] a simple getenv question....

    Do this:

    <?php

    print_r($_SERVER);

    ?>

    If what you want is here this just use: $_SERVER['REMOTE_ADDR'] etc

    You will need to have a look at the source of the output as the rendered view will look a little strange.

    Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: timhitcho.com.au

    > -----Original Message----- > From: Bruce Douglas [mailto:bedouglasearthlink.net] > Sent: Thursday, 23 January 2003 10:33 AM > To: php-generallists.php.net > Subject: RE: [PHP] a simple getenv question.... > > > phpinfo() returns everything as expected.. but not having the > code .. i don't know what internal method it uses to access > the information... > > but thanks... > > -bruce > > > -----Original Message----- > From: Timothy Hitchens (HiTCHO) [mailto:hitchophp.net] > Sent: Wednesday, January 22, 2003 4:18 PM > To: 'Jim Lucas'; 'Bruce Douglas'; php-generallists.php.net > Subject: RE: [PHP] a simple getenv question.... > > > The simplest way to start looking would be phpinfo() page for > starters. > > > Timothy Hitchens (HiTCHO) > Open Source Consulting > e-mail: timhitcho.com.au > > > -----Original Message----- > > From: Jim Lucas [mailto:phplistzonedzero.net] > > Sent: Thursday, 23 January 2003 10:15 AM > > To: Bruce Douglas; php-generallists.php.net > > Subject: Re: [PHP] a simple getenv question.... > > > > > > just copied your code and it worked fine for me. > > > > system: Apache 1.3.26 > > PHP 4.2.2 > > > > I would look into apache 2.0 and the env vars that are > available from > > it. > > > > > > ----- Original Message ----- > > From: "Bruce Douglas" <bedouglasearthlink.net> > > To: <php-generallists.php.net> > > Sent: Wednesday, January 22, 2003 3:57 PM > > Subject: [PHP] a simple getenv question.... > > > > > > > Hi... > > > > > > A simple question... In the following code: > > > > > > <? > > > > > > $ip = getenv("REMOTE_ADDR"); > > > > > > echo " ip = ".$ip; > > > > > > echo " ip = " . getenv("REMOTE_ADDR"); > > > > > > echo " ip = " . getenv('REMOTE_ADDR'); > > > > > > echo " ip = ". $REMOTE_ADDR; <------ > > > > > > ?> > > > > > > I can only seem to get the last line to display the > correct value. > > > It's as if I can't seem to get/return any of the SERVER > environment > > > variables > > using > > > the getenv() function.... > > > > > > I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0. > > > > > > I've checked through the PHP.INI file, but couldn't seem to > > find why > > > this might be occuring. Any help/assistance would be > > appreciated..... > > > > > > thanks > > > > > > bruce > > > bedouglasearthlink.net > > > > > > > > > > > > -- > > > 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 > > > > > -- > 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 >

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

    attached mail follows:


    Anyone tried to use Jasper Reports with PHP? Jasper is a java reporting tool, but I need an os alternative to Crystal Reports and am hoping it might fit the bill.

    I *think* I could integrate Jasper into my app fairly well with PHP's ability to call Java classes, but wanted to hear from anyone else with experience in this area.

    Thanks, John

    attached mail follows:


    When someone logs in, save their ID somewhere. If they try to log in again, check where you save the names and see if it's there.

    Checking my crystal ball, though, you're going to run into problems. What if I log in, accidentally close my window, and then go back to try and log in again. Odds are your "security" feature will not allow me to log in, because it thinks I already am.

    Bottom line, why worry about it?

    ---John W. Holmes...

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

    > -----Original Message----- > From: Henry [mailto:henrycafelab.com] > Sent: Wednesday, January 22, 2003 12:00 PM > To: php-generallists.php.net; shiflettphp.net; php-generalgremlins.biz > Subject: Re: [PHP] How to implement this by php Session > > absolutely! > Sorry for my english first, what I want to do is make sure one account can > login in at the same time, > is there any mechanism in PHP can slove it? or I have to use external > program (daemon what I develop) > to do so? the way I imagination is list below does that work or you have > smarter solution? > > ----- Original Message ----- > From: "Jason Wong" <php-generalgremlins.biz> > To: <php-generallists.php.net> > Sent: Thursday, January 23, 2003 12:32 AM > Subject: Re: [PHP] How to implement this by php Session > > > > On Thursday 23 January 2003 00:26, Chris Shiflett wrote: > > > --- Henry <henrycafelab.com> wrote: > > > > I'd like to implement ONE USER SIGNIN at the same time, > > > > the way I consider about is below: > > > > 1 record the sessionId and userId in some media(db), > > > > then we'll know who is login and who is not > > > > 2 use a demon program to determine whole sessionId > > > > which is live and correspond to db's data if some > > > > session is dead then demon program will remove from db > > > > > > > > that's what I think, does it work? or anybody has real > > > > exprience about it? if my idea work, how to get whole > > > > live sessionId from webserver(apache+php)? > > > > > > I honestly cannot understand exactly what you are asking, > > > but are you certain it is different from just using PHP's > > > sessions? It sounds to me like it is the same thing. > > > > Sounds as if he wants to ensure that only one (active?) login (per > account? or > > per application?) is allowed at any one time. > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.biz > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > /* > > Hug me now, you mad, impetuous fool!! > > Oh wait... > > I'm a computer, and you're a person. It would never work out. > > Never mind. > > */ > > > > > > -- > > 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

    attached mail follows:


    HI Chirs: thanks for your reply and opinion, so you mean I can know the alive session by reading /tmp ? I think that's only problem I want to know cause I affraid that I can't hold the dead or alive of session OK, I'll try to trace session by reading /tmp directory thanks a lot -----Original Message----- From: Chris Shiflett [mailto:shiflettphp.net] Sent: Thursday, January 23, 2003 2:54 AM To: Henry; php-generallists.php.net; php-generalgremlins.biz Subject: Re: [PHP] How to implement this by php Session --- Henry <henrycafelab.com> wrote: > what I want to do is make sure one account can login > in at the same time I understand now, with Jason's help. > is there any mechanism in PHP can slove it? Well, not exactly. You see, this is a rather strange restriction (or seems strange to me at least). There are two different data stores in a typical session management environment: 1. Session data store. This is all of those /tmp/sess* files if you are using the default setup. 2. User (or client) data store. This is where you would keep persistent data, such as username and password. You could store a login indicator in the user data store, so that when a user logs in, you make sure this flag is not set (else deny their login) and set it if it is not. This would work for a lot of cases, but it has a few notable problems: 1. It is not atomic. Under heavy load, you can experience synchronization problems where multiple clients check the flag, see that it is not set, and all try to set it. This is a rather unlikely prolem, but it is something to consider. 2. How do you know that someone is logged in? For example, if I login to your site (and you set my login flag to 1), how much inactivity will you tolerate before you consider me no longer logged in? Do you consider me logged in as long as I have a session record? What if I accidentally close my browser and go back to your site (and am not recognized due to my cookie being lost). Will you not allow me to log back in to your site until my login flag times out? I think this seems like a bad idea, but you might try this idea to see if it works well enough for you. Good luck. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Can anyone supply me with some general example code that shows how to use the functions of PEAR Timezone.php ? I can't seem to figure it out.

    thanks Gijs

    attached mail follows:


    I apologize for the caps. The suggested fix seems to have resolved all problems. I appreciate the fast response.

    Thank you.

    Sincerely, Dale

    attached mail follows:


    Hello to everybody!!! I'm writing to know if somebody knows a way to obtain the paht to save a file in the computer from a button, like the <input type=file> tag, but for saving a file. Thank you very much for your help!! I'll really appreciate the answerd.

    _________________________________________________________________

    Tutopia - Acceso a Internet rápido, fácil y a los mejores precios. http://www.tutopia.com

    attached mail follows:


    > Hello to everybody!!! I'm writing to know if somebody > knows a way to obtain the paht to save a file in the > computer from a button, like the <input type=file> tag, > but for saving a file. Thank you very much for your help!! > I'll really appreciate the answerd.

    I couldn't find "paht" on websters.com.

    You'll need to send the appropriate headers to tell the browser you're sending an attachment and it should prompt the user to save the file.

    This question is answered all the time, search the archives for the examples.

    ---John W. Holmes...

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

    attached mail follows:


    Hi

    I've built a secure site. After the user has chosen a valid username and password I want my script to run htpasswd on the .htpasswd file in the directory. The script can run htpasswd as it doesn't have permission. What is the safest way to do this? Should I chmod htpasswd or is there a better option for this whole thing??

    Thanks

    Kris

    attached mail follows:


    Don't chmod .htpasswd- _huge_ security risk... Will your server allow you to have suid scripts??? If so, you can just write a little wrapper and make it suid. If you do that, I'd also reccomend using an extension other than PHP, and/or placing it outside your web root. Wouldn't want people adding themselves...

    I'd reccomend not using .htaccess at all, and just whip up a system using a real database, wth the real work done in PHP. htaccess just isn't designed to be dynamic.

    On Wednesday 22 January 2003 06:56 pm, Kris wrote: > Hi > > I've built a secure site. After the user has chosen a valid username and > password I want my script to run htpasswd on the .htpasswd file in the > directory. The script can run htpasswd as it doesn't have permission. > What is the safest way to do this? > Should I chmod htpasswd or is there a better option for this whole thing?? > > Thanks > > Kris

    attached mail follows:


    Hi everyone,

    I made a while loop and i'd like to know how to continue looping after I break it, and . Here is my script : I found just break looping on my page, can't continue :(

    <? while ($row = mysql_fetch_array($myquery)){ ?> <tr> <td class="subtitle" width="50%"> <?=$row['field1']?> </td> <?break;?> <td rowspan="2" valign="top" align="right"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <TD><image src="blabla.jpg"></td> </tr> </table> </td> </tr> <?continue;?> <tr> <td class="body" width="50%"> <p align="justify"><?=$row['field2']?></p> </td> </tr> <? } ?>

    attached mail follows:


    The solution is to take out your break... why is it there??

    ---John W. Holmes...

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

    > -----Original Message----- > From: Reymond [mailto:reymondunri.ac.id] > Sent: Wednesday, January 22, 2003 10:45 PM > To: php-generallists.php.net > Subject: [PHP] continue after break > > Hi everyone, > > I made a while loop and i'd like to know how to continue looping after I > break it, and . Here is my script : > I found just break looping on my page, can't continue :( > > <? > while ($row = mysql_fetch_array($myquery)){ > ?> > <tr> > <td class="subtitle" width="50%"> > <?=$row['field1']?> > </td> > <?break;?> > <td rowspan="2" valign="top" align="right"> > > <table border="0" cellpadding="0" > cellspacing="0"> > <tr> > <TD><image src="blabla.jpg"></td> > </tr> > </table> > </td> > </tr> > <?continue;?> > > <tr> > <td class="body" width="50%"> > <p align="justify"><?=$row['field2']?></p> > </td> > </tr> > <? > } > ?> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    On Wednesday, January 22, 2003, at 10:44 PM, Reymond wrote:

    > Hi everyone, > > I made a while loop and i'd like to know how to continue looping after > I > break it, and . Here is my script : > I found just break looping on my page, can't continue :(

    break ends a loop. That's what it does. If you don't want to end a loop, don't call break.

    Take a look at your code; it boils down to this:

    while (...) { break; continue; }

    Generally speaking you would break or continue based on some condition. Your usage as shown below doesn't make any sense to me. Perhaps you need to re-read the documentation on while, break and continue.

    http://www.php.net/manual/en/control-structures.while.php http://www.php.net/manual/en/control-structures.break.php http://www.php.net/manual/en/control-structures.continue.php

    > > <? > while ($row = mysql_fetch_array($myquery)){ > ?> > <tr> > <td class="subtitle" width="50%"> > <?=$row['field1']?> > </td> > <?break;?> > <td rowspan="2" valign="top" align="right"> > > <table border="0" cellpadding="0" > cellspacing="0"> > <tr> > <TD><image src="blabla.jpg"></td> > </tr> > </table> > </td> > </tr> > <?continue;?> > > <tr> > <td class="body" width="50%"> > <p align="justify"><?=$row['field2']?></p> > </td> > </tr> > <? > } > ?> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I have put Image inside of my loop... <TD><image src="blabla.jpg"></td> and that image located between <?$row['field1?> and <?$row['field2']?>

    I want the image not doing loop too. cause i just need one image.., I just do looping for my data: <?$row['field1?> and <?$row['field2']?>

    <? while ($row = mysql_fetch_array($myquery)){ ?> <tr> <td class="subtitle" width="50%"> <?=$row['field1']?> </td> <?break;?> <td rowspan="2" valign="top" align="right">

    <table border="0" cellpadding="0" cellspacing="0"> <tr> <TD><image src="blabla.jpg"></td> </tr> </table> </td> </tr> <?continue;?>

    <tr> <td class="body" width="50%"> <p align="justify"><?=$row['field2']?></p> </td> </tr> <? } ?>

    John W. Holmes writes:

    > The solution is to take out your break... why is it there?? > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > >> -----Original Message----- >> From: Reymond [mailto:reymondunri.ac.id] >> Sent: Wednesday, January 22, 2003 10:45 PM >> To: php-generallists.php.net >> Subject: [PHP] continue after break >> >> Hi everyone, >> >> I made a while loop and i'd like to know how to continue looping after > I >> break it, and . Here is my script : >> I found just break looping on my page, can't continue :( >> >> <? >> while ($row = mysql_fetch_array($myquery)){ >> ?> >> <tr> >> <td class="subtitle" width="50%"> >> <?=$row['field1']?> >> </td> >> <?break;?> >> <td rowspan="2" valign="top" align="right"> >> >> <table border="0" cellpadding="0" >> cellspacing="0"> >> <tr> >> <TD><image src="blabla.jpg"></td> >> </tr> >> </table> >> </td> >> </tr> >> <?continue;?> >> >> <tr> >> <td class="body" width="50%"> >> <p align="justify"><?=$row['field2']?></p> >> </td> >> </tr> >> <? >> } >> ?> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    You are misunderstanding how break and continue work. When you call break, the loop ends. When you call continue, the loop starts over, skipping the part between continue and the end of the loop.

    When you call break, you're ending the loop. You never even get as far as continue (let alone as far as the second <TD> block).

    On Thursday, January 23, 2003, at 12:02 AM, Remon Redika wrote:

    > I have put Image inside of my loop... <TD><image src="blabla.jpg"></td> > and that image located between <?$row['field1?> and <?$row['field2']?> > I want the image not doing loop too. cause i just need one image.., > I just do looping for my data: > <?$row['field1?> and <?$row['field2']?> > <? > while ($row = mysql_fetch_array($myquery)){ > ?> > <tr> > <td class="subtitle" width="50%"> > <?=$row['field1']?> > </td> > <?break;?> > <td rowspan="2" valign="top" align="right"> > <table border="0" cellpadding="0" cellspacing="0"> > <tr> > <TD><image src="blabla.jpg"></td> > </tr> > </table> > </td> > </tr> > <?continue;?> > <tr> > <td class="body" width="50%"> > <p align="justify"><?=$row['field2']?></p> > </td> > </tr> > <? > } > ?> > > John W. Holmes writes: >> The solution is to take out your break... why is it there?? ---John >> W. Holmes... PHP Architect - A monthly magazine for PHP >> Professionals. Get your copy >> today. http://www.phparch.com/ >>> -----Original Message----- >>> From: Reymond [mailto:reymondunri.ac.id] >>> Sent: Wednesday, January 22, 2003 10:45 PM >>> To: php-generallists.php.net >>> Subject: [PHP] continue after break Hi everyone, I made a while loop >>> and i'd like to know how to continue looping after >> I >>> break it, and . Here is my script : >>> I found just break looping on my page, can't continue :( <? >>> while ($row = mysql_fetch_array($myquery)){ >>> ?> >>> <tr> >>> <td class="subtitle" width="50%"> >>> <?=$row['field1']?> >>> </td> >>> <?break;?> >>> <td rowspan="2" valign="top" align="right"> <table >>> border="0" cellpadding="0" >>> cellspacing="0"> >>> <tr> >>> <TD><image src="blabla.jpg"></td> >>> </tr> >>> </table> >>> </td> >>> </tr> >>> <?continue;?> <tr> >>> <td class="body" width="50%"> >>> <p align="justify"><?=$row['field2']?></p> >>> </td> >>> </tr> >>> <? >>> } >>> ?> -- >>> 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

    attached mail follows:


    Then just don't have the image inside the loop...

    Remon Redika wrote:

    > I have put Image inside of my loop... <TD><image src="blabla.jpg"></td> > and that image located between <?$row['field1?> and <?$row['field2']?> > I want the image not doing loop too. cause i just need one image.., > I just do looping for my data: > <?$row['field1?> and <?$row['field2']?> > <? > while ($row = mysql_fetch_array($myquery)){ > ?> > <tr> > <td class="subtitle" width="50%"> > <?=$row['field1']?> > </td> > <?break;?> > <td rowspan="2" valign="top" align="right"> > <table border="0" cellpadding="0" cellspacing="0"> > <tr> > <TD><image src="blabla.jpg"></td> > </tr> > </table> > </td> > </tr> > <?continue;?> > <tr> > <td class="body" width="50%"> > <p align="justify"><?=$row['field2']?></p> > </td> > </tr> > <? > } > ?> > > John W. Holmes writes: > >> The solution is to take out your break... why is it there?? >> ---John W. Holmes... >> PHP Architect - A monthly magazine for PHP Professionals. Get your copy >> today. http://www.phparch.com/ >> >>> -----Original Message----- >>> From: Reymond [mailto:reymondunri.ac.id] >>> Sent: Wednesday, January 22, 2003 10:45 PM >>> To: php-generallists.php.net >>> Subject: [PHP] continue after break >>> Hi everyone, >>> I made a while loop and i'd like to know how to continue looping after >> >> I >> >>> break it, and . Here is my script : >>> I found just break looping on my page, can't continue :( >>> <? >>> while ($row = mysql_fetch_array($myquery)){ >>> ?> >>> <tr> >>> <td class="subtitle" width="50%"> >>> <?=$row['field1']?> >>> </td> >>> <?break;?> >>> <td rowspan="2" valign="top" align="right"> >>> <table border="0" cellpadding="0" >>> cellspacing="0"> >>> <tr> >>> <TD><image src="blabla.jpg"></td> >>> </tr> >>> </table> >>> </td> >>> </tr> >>> <?continue;?> >>> <tr> >>> <td class="body" width="50%"> >>> <p align="justify"><?=$row['field2']?></p> >>> </td> >>> </tr> >>> <? >>> } >>> ?> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >> > >

    -- 
    The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
    

    attached mail follows:


    PHP Version 4.3.0

    Apache 2.0.43

    I am having a problem with a post method.

    GET method: _REQUEST['name']=value _GET['name']=value _POST['name']=

    POST method: _REQUEST['name']=valuename=value _GET['name']= _POST['name']=valuename=value

    I assumed that by using _REQUEST that I could use either a POST or GET method on the form. I can't, so does this seem right? The extra name=value seems like it shouldn't be there.

    -- 
    ----------------------------------------
    Sent from Mozilla and GNU/Linux.
    Powered by an AMD processor.
    

    attached mail follows:


    Pretty sure this is an Apache2/PHP bug. It was discussed on here in the past few days.

    ---John W. Holmes...

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

    > -----Original Message----- > From: Bob Lockie [mailto:bjlockielockie.ca] > Sent: Wednesday, January 22, 2003 10:33 PM > To: php-general Mailing List > Subject: [PHP] POST vs GET method > > > PHP Version 4.3.0 > > > Apache 2.0.43 > > > > I am having a problem with a post method. > > GET method: > _REQUEST['name']=value > _GET['name']=value > _POST['name']= > > POST method: > _REQUEST['name']=valuename=value > _GET['name']= > _POST['name']=valuename=value > > I assumed that by using _REQUEST that I could use either a POST or GET > method on the form. > I can't, so does this seem right? > The extra name=value seems like it shouldn't be there. > > > > -- > ---------------------------------------- > Sent from Mozilla and GNU/Linux. > Powered by an AMD processor. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi All. I am currently playing with sripts, and have come across a problem, that i can't slove. (i am a novice - lol). The script requires a URL to grab data from. The URL has a ? in it, and testing the script it grabs the base data of the URL, but not the essential data i need, which is only brought up with what comes after the ? in the URL. now i figure it has something to do with the ? in the URL but i can't seem to fix it myself.

    Thanks

    --
    

    Cheers --------------------------------- Simon Angell Canberra, ACT www.canberra-wx.com --------------------------------------------- Proud member of the Australian Severe Weather Association. www.severeweather.asn.au --------------------------------------------------------------

    attached mail follows:


    Everything after the question mark is a query string. Say you have this...

    http://www.mydomain.com/index.php?var1=value1&var2=value2&var3=something-else

    to access these values in your script...

    $_GET['var1'] $_GET['var2'] $_GET['var3']

    In other words, if I want to print out the value of var2 on the page....

    echo ( "This is var2 : " . $_GET['var2'] );

    Will print this out to the browser....

    This is var2 : value2

    HTH

    Simon Angell wrote: > Hi All. > I am currently playing with sripts, and have come across a problem, that i > can't slove. (i am a novice - lol). > The script requires a URL to grab data from. The URL has a ? in it, and > testing the script it grabs the base data of the URL, but not the essential > data i need, which is only brought up with what comes after the ? in the > URL. now i figure it has something to do with the ? in the URL but i can't > seem to fix it myself. > > Thanks > > -- > > Cheers > --------------------------------- > Simon Angell > Canberra, ACT > www.canberra-wx.com > --------------------------------------------- > Proud member of the > Australian Severe Weather Association. > www.severeweather.asn.au > -------------------------------------------------------------- > > >

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

    attached mail follows:


    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?

    attached mail follows:


    Ignore this post, I got my answers from the archives :) "Jonathan Chum" <jchumjps.net> wrote in message news:20030123034839.16754.qmailpb1.pair.com... > 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? > >

    attached mail follows:


    Hello,

    On 01/23/2003 01:48 AM, Jonathan Chum wrote: > 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()

    People that say that are either Windows users or have no idea how mail works. Only on Windows the mail() function relays messages to a SMTP server. Under Unix/Linux mail just calls the sendmail program piping the message data to the standard input like with popen and 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?

    Forget relaying on a SMTP server even when it is the local server. Relaying via SMTP just does the same thing as piping data to sendmail except that it takes a longer trip by establishing a TCP connection to the SMTP server.

    To make relaying faster, it is better to call sendmail directly passing the necessary switches to make it just accept the message without any delay so it will free your PHP script. Delivery will happen next time it will run the queue.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    I need a way to add a range of IPaddress to a databases the example below work as long as the last numbers in the IPaddress are equal length like three numbers or two or one. If the first IPaddress has 1 number and the second has two or three numbers the script will not work. $ip1=230.234.234.4 This will work $ip2=230.234.234.9

    $ip1=230.234.234.4 This will not work $ip2=230.234.234.25

    $ip1=230.234.234.25 This will not work $ip2=230.234.234.126

    $ip1=trim($ip1); $ip2=trim($ip2); $ip = $ip1; while ($ip <= $ip2){ $query = "insert into ipaddress(ip)values ('$ip')"; $Result = safe_query($query); $ip++; }

    -- 
    Best regards,
     rdkurth                          mailto:rdkurthstarband.net
    

    attached mail follows:


    Hi,

    Thursday, January 23, 2003, 2:10:05 PM, you wrote:

    rsn> I need a way to add a range of IPaddress to a databases the rsn> example below work as long as the last numbers in the IPaddress rsn> are equal length like three numbers or two or one. If the first rsn> IPaddress has 1 number and the second has two or three numbers the rsn> script will not work. rsn> $ip1=230.234.234.4 This will work rsn> $ip2=230.234.234.9

    rsn> $ip1=230.234.234.4 This will not work rsn> $ip2=230.234.234.25

    rsn> $ip1=230.234.234.25 This will not work rsn> $ip2=230.234.234.126

    rsn> $ip1=trim($ip1); rsn> $ip2=trim($ip2); rsn> $ip = $ip1; rsn> while ($ip <= $ip2){ rsn> $query = "insert into ipaddress(ip)values ('$ip')"; rsn> $Result = safe_query($query); rsn> $ip++; rsn> }

    rsn> -- rsn> Best regards, rsn> rdkurth mailto:rdkurthstarband.net

    you will need to split the last bit and treat it as a number to increment it properly, something like

    list($ip4,$ip3,$ip2,$ip1) = split('.',$ip1); list$ip8,$ip7,$ip6,$ip5) = split('.',$ip2); $ip = intval($ip1); $endip = intval($ip5); while($ip < $endip){ $storeip = $ip4.'.'.$ip3.'.'.$ip2.'.'.$ip; //store it $ip ++; } There are probably other ways but you get the idea

    -- 
    regards,
    Tom
    

    attached mail follows:


    Has anyone had success in changing the ownership of a directory for within a PHP script? I am running as root an have tries exec() passthru() `` back ticks system()

    This works fine in a Perl script:

    `chown egovdemo:nobody /home/e-govdemo/htdocs`;

    They are back ticks. Same line in the PHP script does nothing.

    Any insight would be appreciated.

    Urb

    attached mail follows:


    what does posix_getlogin() return? perhaps you aren't really running the script as root...

    On Wednesday 22 January 2003 08:05 pm, Urb LeJeune wrote: > Has anyone had success in changing the ownership of a directory > for within a PHP script? I am running as root an have tries > exec() > passthru() > `` back ticks > system() > > This works fine in a Perl script: > > `chown egovdemo:nobody /home/e-govdemo/htdocs`; > > They are back ticks. Same line in the PHP script does nothing. > > Any insight would be appreciated. > > Urb

    attached mail follows:


    Is there a way to find out total upload file size from a file uploaded though an html form? I figure if I know the total size, then I can just consistently poke at the file being uploaded and math a progress bar for the file being uploaded, of course, this all hangs upon the ability of getting the total file size BEFORE it is uploaded. It IS possible I have seen it done with JSP; anybody can help me with this? Thanks

    - Vic

    ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca

    attached mail follows:


    I can't think of a way to do this via PHP only- I'm pretty sure the file is sent in the POST request, therefore the page has not begun to output anything. Perhaps when you saw it done it was a java applet running in the browser?

    On Wednesday 22 January 2003 08:10 pm, Victor wrote: > Is there a way to find out total upload file size from a file uploaded > though an html form? I figure if I know the total size, then I can just > consistently poke at the file being uploaded and math a progress bar for > the file being uploaded, of course, this all hangs upon the ability of > getting the total file size BEFORE it is uploaded. It IS possible I have > seen it done with JSP; anybody can help me with this? Thanks > > - Vic > > ______________________________________________________________________ > Post your free ad now! http://personals.yahoo.ca

    attached mail follows:


    I can say with near certainty that there is a problem with the session handler you've chosen, for you to be getting these segfaults. As I pointed out, and as you've stated, if the sessions work fine with the 'files' handler type, then the issue must be with the alternate handler.

    So, if you wrote it yourself, perhaps it's got a bug. If it's a library script, perhaps it has a bug, or has a FAQ, or some support.

    There's also the option that there's a bug with PHP in this/these version(s) which is causing the problems.

    Is there a reason why you can't just use 'files'???

    Justin French

    on 23/01/03 3:17 AM, Blaster (blasterblaster.nu) wrote:

    > Hey, I'm back =) > > I was unable to get it to run, I've setup the most basic session handler i > could think of, a simple counter, > if any of you could test it, I'd be very thankful, the URL is > http://fatboy.blaster.nu/~blaster/sess_test/ > > Now, it does not "cut" the content, not sure why it doesn't do that, but > I'm pretty sure it generates segment faults, > cause at several occations when you click Destroy Session and then return, > it will display "Cannot find server" in > MSIE, and I've checked with my sniffer, Apache simply closes the TCP > connection as soon as my request is sent > which probably means the child handling my request segment faulted. > > Still, if ANYONE has ANYTHING on Segment faults with PHP session, I'd like > to hear about it, I'm willing to try pretty > much anything! > > I've already tried several different DB libs and Session handler libs, I'm > aware of the "MM" lib which many have had > problems with before, I don't use that. > > One thing that really bugs me though, is that if I don't touch the > "session.save_handler" option and leave it to "files", > EVERYTHING works just great! This kinda makes me think all the DB libs I > have tried is invalid, but that cannot possible > be the case, I've even tried PEAR sessionlib, which is coded by a team > supported by the PHP group (?). Is it possible > that the way PHP handles the "files" session and "user" sessions is > different? Like, they patched one of the methods but > forgot to fix the "user" mode? :) > > Also, while searching google, I came across a very interesting URL, > http://www.phpbuilder.com/mail/php-developer-list/200001/0600.php > > However, the BUG description ID to http://bugs.php.net/ seems to be > invalid, it only takes me to the frontpage, and > searching for it gives me nothing, is this bug fixed? If so, in what version? > > Thanks for your time, again, anything related to PHP session and possible > segment faults is MUCH appreciated! > > At 21:15 2003-01-21 +1100, you wrote: >> I don't really have an answer... try to get the REALLY basic session example >> from the manual to work... this will ruke out your save handler and all >> sorts of other stuff, if you're still getting the errors with basic code and >> default handlers. >> >> Justin >> >> >> on 21/01/03 9:01 PM, Blaster (blasterblaster.nu) wrote: >> >>> Okay, I'm not using "mm" as my session handler, in PHP.ini, I still have >>> "files", >>> but in my script, I temporariliy modify this with >>> >>> if (!ini_set("session.save_handler", "user")) >>> echo("Unable to switch to Session User mode."); >>> >>> if (!session_set_save_handler("db_session_open", "db_session_close", >>> "db_session_read", "db_session_write", "db_session_destroy", >>> "db_session_garbage")) >>> echo("Unable to init custom session handlers!"); >>> >>> These are my own handlers, working with MySQL. >>> >>> I have however also tried setting it to user and only doing the >>> "session_set_save_handler()" part, but gives me random segment faults >>> either way. The strange part >>> is that it doesn't always crash, i can view the same page 10 times, and it >>> only segment faults on one of the views,.. how is this possible? >>> >>> Please advice =) >>> >>> At 12:51 2003-01-21 +1100, you wrote: >>>> Hi, >>>> >>>> I had this problem a few weeks back. The host changed the sessions from >>>> 'mm' to 'files' in php.ini and restarted, and all was ok... >>>> >>>> not sure of the reasons behind the faults, but I had this EXACT problem >>>> (with standard session stuff). >>>> >>>> >>>> Justin >>>> >>>> >>>> on 21/01/03 2:29 AM, Blaster (blasterblaster.nu) wrote: >>>> >>>>> Hi >>>>> >>>>> OS: Debian Linux (Woody), kernel 2.2.20 >>>>> PHP: v4.1.2 >>>>> >>>>> I'm having some troubles with my sessions, when the page is sent to the >>>>> visitor, it sometimes stops after ½ the page or so. 90% of the times, it >>>>> works perfectly >>>>> to visit the page, so this appears to be totally random. However, I have >>>>> reason to believe it has something to do with my sessions, I have >> written a >>>>> custom session >>>>> lib which works with MySQL, and then set it up with >>>> session_set_save_handler() >>>>> >>>>> Now, I checked the error logs of my Apache HTTP, and it's filled with >>>>> [Mon Jan 20 15:20:54 2003] [notice] child pid 19500 exit signal >>>>> Segmentation fault (11) >>>>> [Mon Jan 20 15:20:54 2003] [notice] child pid 19399 exit signal >>>>> Segmentation fault (11) >>>>> FATAL: emalloc(): Unable to allocate -916562933 bytes >>>>> [Mon Jan 20 15:21:02 2003] [notice] child pid 19499 exit signal >>>>> Segmentation fault (11) >>>>> [Mon Jan 20 15:21:20 2003] [notice] child pid 19401 exit signal >>>>> Segmentation fault (11) >>>>> [Mon Jan 20 15:21:32 2003] [notice] child pid 19514 exit signal >>>>> Segmentation fault (11) >>>>> [Mon Jan 20 15:21:35 2003] [notice] child pid 19403 exit signal >>>>> Segmentation fault (11) >>>>> >>>>> The reason to why I'm sure it's PHP is the "emalloc()" line, which >> I'm told >>>>> only can be generated by PHP. Now, I'm wondering if this is a know >> bug, or >>>>> am I doing >>>>> something wrong? >>>>> >>>>> In short: >>>>> The content stream (HTML stream) is interrupted, probably because of a >>>>> segment fault caused by PHP Session functions. Is there a way to work >>>>> around this bug >>>>> without performing a complete upgrade? If this has already been fixed >> in a >>>>> newer version, which version do I need to get? 4.3.0 is not really an >>>>> option to me, since >>>>> I'm running APT-GET, their latest version is 4.1.2 (stable) and 4.2.6 >>>>> (unstable) (or something) >>>>> >>>>> Code I use to setup the sessions: >>>>> session_start(); >>>>> session_register("SESSION"); >>>>> >>>>> if (!isset($SESSION)) { >>>>> $SESSION = array(); >>>>> $SESSION["submitdata"] = array(); >>>>> $SESSION["addr"] = $REMOTE_ADDR; >>>>> $SESSION["user"] = user_auth($_COOKIE['replayuser'], >>>>> $_COOKIE['replaypass']); >>>>> } >>>>> >>>>> # Prevent Session hi-jacking, only allow people from the IP who >> created the >>>>> session, or else >>>>> # re-auth user >>>>> if ($SESSION["addr"] != $REMOTE_ADDR) { >>>>> $SESSION["user"] = user_auth($_COOKIE['replayuser'], >>>> $_COOKIE['replaypass']); >>>>> $SESSION["addr"] = $REMOTE_ADDR; >>>>> } >>>>> >>>>> A quick reply is appreciated! Thanks in advance >>>>> >>>>> >>>>> -- >>>>> PHP General Mailing List (http://www.php.net/) >>>>> To unsubscribe, visit: http://www.php.net/unsub.php >>>>> >>>>> --- >>>>> [This E-mail scanned for viruses] >>>>> >>>>> >>> >>> --- >>> [This E-mail scanned for viruses] >>> >>> > > --- > [This E-mail scanned for viruses] > >

    attached mail follows:


    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" <mlemosacm.org> wrote in message news:20021222195208.97940.qmailpb1.pair.com... > 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 best.

    :) Sounds good, definately going with Qmail on this project...

    > > and run it every hour. > > With qmail you do not have to run the queue like sendmail. You just > inject the messages and it will deliver them when possible.

    If it delivers when possible, won't the server flake if it get's 100,000 emails inject into Qmail? If I was to use your class and loop through 100,000 emails into Qmail, will Qmail attempt all at once?

    > > 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 > > Of course all e-mail is delivered to each recipient via SMTP, but that > you can relay to your local mailer. > > > > 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 > > That would be a good idea if you have messages to be sent to many > recipients of the same domain but in reality it is more problematic. > Some servers indeed reject messages to be sent many recipients at once. > Although that is not illegal, it is a pattern of spamming. Another > problem, is that you will have an hard time distinguishing which > addresses of a same domain are bouncing and which are not bouncing.

    Very interesting... I hadn't thought about that. Definately don't want legit emails mistaken as SPAM.

    > > > method seems to be like BCC as you can't personalized each email To: > > recepient. > > If you want delivery efficiency, forget personalization. > > > > 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 > > Actually the class provides different delivery methods that maybe > appropriate in different circunstances: mail(), sendmail, qmail and SMTP. > > SMTP is the slowest for queuing but it is the fastest for direct > delivery. My SMTP class supports direct deliveries which is great to > deliver urgent messages as they are not relayed to the local mailer. It > delivers to the recipient SMTP server and you will know if the message > was accepted right away. I use this to deliver password reminder and > other messages that users of my sites are anxious to receive because the > local mailer queue may be loaded at the moment with some long delivery.

    That makes sense.

    > > each recepient. phpmailer.sourceforget.net has that problem of opening and > > closing a connection, yet they claim to receive good results of up to 40,000 > > emails per hour. Another software using that class was able to send 500,000 > > emails in 10 hours. > > You should not consider any delivery statistics because all depends on > factors that have nothing to do with the software you use, like the > outbound bandwidth, remote server reachability, anti-spam reception > delays, temporary messages refusals (mailbox full, blocked account, etc..).

    Right. . . however I was more curious on a comparison between piping into Qmail vs SMTP. So far, you have prooven greatly the differences and has swayed my decision alot :)

    > > If injecting the emails directly into Qmail (Sounds to me that Qmail is far > > better for email deliver than to be using Sendmail) vs using SMTP, then > > DJB software rules! BTW, consider using DJBDNS cache to reduce DNS > server lookup time.

    I'll check it out. We've been using Bind and are considering of using TinyDNS, but also heard good things about DJBDNS. Mainly we are looking for PostGreSQL extensions because we built a web hosting control panel that's rounded around PostGresSQL to manage services.

    > > > that'll be the approach. The only reason I'd would be using SMTP is to keep > > the code and data (on MySQL) stored on one machine and when it's time to > > blast out an email, it'll establish a connection to a SMTP server assigned > > to the list to deliver the email. > > In that case, you may consider QMQP relay which is a protocol that lets > you rely entire mail queues from a server to another. This is > recommended when you have many busy mailing lists served from one > machine and you can use more servers do the actual delivery. I think > only qmail and ezmlm support QMQP.

    Thanks, I'll check QMQP as well.

    > > > Though if the code was written to sit on each server that scans for pending > > tasks, it'll pick up it's job from a master database server and then > > directly injecting Qmail locally. > > That is what qmail does. > > > > The software app I'm writing is expected to have many users with small to > > very large lists. I'm trying to spec this out so that it scales well and > > with the fastest delivery. From what I'm hearing from you and from the first > > guy's reply to this thread, inject the email into Qmail is the quickest way. > > Yes, qmail was thought for that. Yahoogroups use it and I have also used > when I worked in a large portal with many subscriber newsletters as I > mentioned. We had some very large like for MTV Brasil that had almost > 400,000 subscribers. > > The greatest problem that made me learn some hard lessons is that it is > very problematic if you start with subscribers list that are not clean > up of no longer valid users. Once you start delivering messages to those > addresses, you get a flood of bounces that pratically stop your server > queue. > > The MTV newsletter was weekly, but that affected the newsletters of > other sites that were stopped during the MTV newsletter bounces. Since > ezmlm does not unsubscribe bouncing addresses right away, the solution > was to remove bouncing subscribers using an external validation > procedure. I used this other class for the cleanup. After that it was a > breeze. We had peaks of 10,000 messages sent per minute. > > http://www.phpclasses.org/emailvalidation

    We had a 72K list with about 6K bad emails that Mailman didn't unsubscribe until we used MojoMail which unsubscribes them from the database instantly as well as perform validations. Now, blasts are handled alot quicker.

    So far, you have given me a good case to use Qmail and using your PHP class as a foundation for this application. . . I'll have to check the other software recommendations you made and see how'd I incorporate this into the application.

    BTW, isn't there any overhead associating with opening/closing a connection to inject each email into Qmail? Or it's very minimal overhead to even worry about? If 100,000 was looped and injected into Qmail, is Qmail fast enough that 100,000 emails are not just sitting on the server filling up disk space?

    attached mail follows:


    Q If it delivers when possible, won't the server flake if it get's 100,000 emails inject into Qmail? If I was to use your class and loop through 100,000 emails into Qmail, will Qmail attempt all at once?

    A The answer was right above the question... "With qmail you do not have to run the queue like sendmail. You just inject the messages and it will deliver them when possible." It will build up a queue of everything it needs to send, then send them one at a time (or ten, or a hundred- you can configure that...) until it's done. It will never DoS itself by trying to send 10K eMails at once. Think of the queue as a long line. Mail waits its turn, then gets attention when it reaches the front of the line.

    Q BTW, isn't there any overhead associating with opening/closing a connection to inject each email into Qmail? Or it's very minimal overhead to even worry about? If 100,000 was looped and injected into Qmail, is Qmail fast enough that 100,000 emails are not just sitting on the server filling up disk space?

    A It's more than worth the overhead to use qmail. Basically, qmail does all the hard work for you. First of all, it sends multiple messages at once (default is 20, but it's configurable), so you're connection is never idle waiting for that SYN|ACK, DNS query, SMTP acknowledgement, etc. Now theoretically _could_ do this with PHP (pcntl), but why re-invent the MTA? It probably wouldn't be nearly as efficient, and it would take an eternity to develope a script that even approaches qmail's functionality.

    Now, with regards to a MLM (mailing list manager), you may want to take a look at ezmlm. You can find it (and qmail) at http://cr.yp.to/ It doesn't just delete addresses from the database automatically, but first sends a little probe eMail, threatening to delete the address if the probe bounces. It's a pretty cool feature, since it prevents good addresses from being dropped for stupid reasons. For instance, I get them sometimes (securityfocus runs ezmlm on bugtraq and vuln-dev, prolly their others too, and vulnwatch/vulndev both use it) when mail bounces due to MIME types that can be naughty (exe, vbs, com, eml, hehe .fon, .ttf, .otf soon?), or when someone uses profanity, or even if the DNS was temporarily down. Now personally i don't care about profanity or naughty MIME types, but lots of ISPs (like mine) filter them. Just something to think about.

    On Wednesday 22 January 2003 08:40 pm, Jonathan Chum wrote: > 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" <mlemosacm.org> wrote in message > news:20021222195208.97940.qmailpb1.pair.com... > > > 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 best. > > > :) Sounds good, definately going with Qmail on this project... > : > > > and run it every hour. > > > > With qmail you do not have to run the queue like sendmail. You just > > inject the messages and it will deliver them when possible. > > If it delivers when possible, won't the server flake if it get's 100,000 > emails inject into Qmail? If I was to use your class and loop through > 100,000 emails into Qmail, will Qmail attempt all at once? > > > > 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 > > > Of course all e-mail is delivered to each recipient via SMTP, but that > > you can relay to your local mailer. > > > > > 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 > > > > That would be a good idea if you have messages to be sent to many > > recipients of the same domain but in reality it is more problematic. > > Some servers indeed reject messages to be sent many recipients at once. > > Although that is not illegal, it is a pattern of spamming. Another > > problem, is that you will have an hard time distinguishing which > > addresses of a same domain are bouncing and which are not bouncing. > > Very interesting... I hadn't thought about that. Definately don't want > legit emails mistaken as SPAM. > > > > method seems to be like BCC as you can't personalized each email To: > > > recepient. > > > > If you want delivery efficiency, forget personalization. > > > > > 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 > > > Actually the class provides different delivery methods that maybe > > appropriate in different circunstances: mail(), sendmail, qmail and SMTP. > > > > SMTP is the slowest for queuing but it is the fastest for direct > > delivery. My SMTP class supports direct deliveries which is great to > > deliver urgent messages as they are not relayed to the local mailer. It > > delivers to the recipient SMTP server and you will know if the message > > was accepted right away. I use this to deliver password reminder and > > other messages that users of my sites are anxious to receive because the > > local mailer queue may be loaded at the moment with some long delivery. > > That makes sense. > > > > each recepient. phpmailer.sourceforget.net has that problem of opening > > and > > > > closing a connection, yet they claim to receive good results of up to > > 40,000 > > > > emails per hour. Another software using that class was able to send > > 500,000 > > > > emails in 10 hours. > > > > You should not consider any delivery statistics because all depends on > > factors that have nothing to do with the software you use, like the > > outbound bandwidth, remote server reachability, anti-spam reception > > delays, temporary messages refusals (mailbox full, blocked account, > > etc..). > > Right. . . however I was more curious on a comparison between piping into > Qmail vs SMTP. So far, you have prooven greatly the differences and has > swayed my decision alot :) > > > > If injecting the emails directly into Qmail (Sounds to me that Qmail is > > far > > > > better for email deliver than to be using Sendmail) vs using SMTP, then > > > > DJB software rules! BTW, consider using DJBDNS cache to reduce DNS > > server lookup time. > > I'll check it out. We've been using Bind and are considering of using > TinyDNS, but also heard good things about DJBDNS. Mainly we are looking for > PostGreSQL extensions because we built a web hosting control panel that's > rounded around PostGresSQL to manage services. > > > > that'll be the approach. The only reason I'd would be using SMTP is to > > keep > > > > the code and data (on MySQL) stored on one machine and when it's time > > > to blast out an email, it'll establish a connection to a SMTP server > > assigned > > > > to the list to deliver the email. > > > > In that case, you may consider QMQP relay which is a protocol that lets > > you rely entire mail queues from a server to another. This is > > recommended when you have many busy mailing lists served from one > > machine and you can use more servers do the actual delivery. I think > > only qmail and ezmlm support QMQP. > > Thanks, I'll check QMQP as well. > > > > Though if the code was written to sit on each server that scans for > > pending > > > > tasks, it'll pick up it's job from a master database server and then > > > directly injecting Qmail locally. > > > > That is what qmail does. > > > > > The software app I'm writing is expected to have many users with small > > to > > > > very large lists. I'm trying to spec this out so that it scales well > > > and with the fastest delivery. From what I'm hearing from you and from > > > the > > first > > > > guy's reply to this thread, inject the email into Qmail is the quickest > > way. > > > Yes, qmail was thought for that. Yahoogroups use it and I have also used > > when I worked in a large portal with many subscriber newsletters as I > > mentioned. We had some very large like for MTV Brasil that had almost > > 400,000 subscribers. > > > > The greatest problem that made me learn some hard lessons is that it is > > very problematic if you start with subscribers list that are not clean > > up of no longer valid users. Once you start delivering messages to those > > addresses, you get a flood of bounces that pratically stop your server > > queue. > > > > The MTV newsletter was weekly, but that affected the newsletters of > > other sites that were stopped during the MTV newsletter bounces. Since > > ezmlm does not unsubscribe bouncing addresses right away, the solution > > was to remove bouncing subscribers using an external validation > > procedure. I used this other class for the cleanup. After that it was a > > breeze. We had peaks of 10,000 messages sent per minute. > > > > http://www.phpclasses.org/emailvalidation > > We had a 72K list with about 6K bad emails that Mailman didn't unsubscribe > until we used MojoMail which unsubscribes them from the database instantly > as well as perform validations. Now, blasts are handled alot quicker. > > So far, you have given me a good case to use Qmail and using your PHP class > as a foundation for this application. . . I'll have to check the other > software recommendations you made and see how'd I incorporate this into the > application. > > BTW, isn't there any overhead associating with opening/closing a connection > to inject each email into Qmail? Or it's very minimal overhead to even > worry about? If 100,000 was looped and injected into Qmail, is Qmail fast > enough that 100,000 emails are not just sitting on the server filling up > disk space?

    attached mail follows:


    Rasmus Lerdorf wrote: > > Because the server doesn't work very well yet. There are issues in the > filter api and you can't really uses a threaded mpm as many of the > 3rd-party libraries that are commonly linked into PHP are simply not > threadsafe.

    Thank you! That's the kind of answer I was looking for.

    If I understand correctly PHP will not work correctly because some parts of it are not thread-safe.

    Is the PHP team working on getting PHP to be thread-safe? Does it look promising? Might version 5 be thread-safe?

    Thanks again,

    Jc

    attached mail follows:


    On Thu, 23 Jan 2003, Jean-Christian Imbeault wrote:

    > Rasmus Lerdorf wrote: > > > > Because the server doesn't work very well yet. There are issues in the > > filter api and you can't really uses a threaded mpm as many of the > > 3rd-party libraries that are commonly linked into PHP are simply not > > threadsafe. > > Thank you! That's the kind of answer I was looking for. > > If I understand correctly PHP will not work correctly because some parts > of it are not thread-safe.

    No, you didn't understand correctly. I specifically said the thread safety issues were in 3rd party libraries and not in PHP. This is not going to be solved anytime soon since it isn't really something we can fix. We can hack around it and add mutexes and stuff to protect ourselves from broken libraries, but in the end that just brings us closer to the non-threaded model that we already have with Apache-1.3, so there is very little motivation to even go through this bit of pain.

    Why exactly are you asking? Is there some feature in Apache2 that you need that is not available in Apache-1.3?

    -Rasmus

    attached mail follows:


    Rasmus Lerdorf wrote: > > No, you didn't understand correctly. I specifically said the thread > safety issues were in 3rd party libraries and not in PHP.

    Sorry, I thought by 3rd party libraries you meant libraries that PHP is dependent upon. Do you mean libraries used by PHP or Apache. And if these are libraries used by PHP, do you mean library that as in the multi-byte library (i.e. libraries that add functionality to PHP), or do you mean C libraries used when compiling PHP.

    > Why exactly are you asking? Is there some feature in Apache2 that you > need that is not available in Apache-1.3?

    I don't want to move from Apache 1-3 to Apache. I just keep hearing that PHP is not ready for Apache2 yet and I wanted to educate myself as to why. I don't like just being told something and not understanding the reason behind the answer.

    So this boils down to Apache2 using threads and PHP not being thread-safe?

    And the reason that PHP is not thread-safe is that some 3rd party libraries PHP used are not thread-safe.

    Now the only two questions I have left are : #1 what those libraries are used for. I.e. are they part of PHP or libraries that are used to compile PHP?

    If they are libraries used to compile PHP, I would assume that Apache2 must have faced similar issues when going from a forking model to a threaded model?

    #2 Is there progress being made towards having PHP work with Apache2. And who is working on this (if not the PHP team).

    Thanks again for the clarifications!

    Jc

    attached mail follows:


    On Thu, 23 Jan 2003, Jean-Christian Imbeault wrote:

    > Rasmus Lerdorf wrote: > > > > No, you didn't understand correctly. I specifically said the thread > > safety issues were in 3rd party libraries and not in PHP. > > Sorry, I thought by 3rd party libraries you meant libraries that PHP is > dependent upon. Do you mean libraries used by PHP or Apache. And if > these are libraries used by PHP, do you mean library that as in the > multi-byte library (i.e. libraries that add functionality to PHP), or do > you mean C libraries used when compiling PHP.

    Common libraries such as gdbm or c-client, for example.

    > So this boils down to Apache2 using threads and PHP not being thread-safe?

    No

    > And the reason that PHP is not thread-safe is that some 3rd party > libraries PHP used are not thread-safe.

    No

    > If they are libraries used to compile PHP, I would assume that Apache2 > must have faced similar issues when going from a forking model to a > threaded model?

    Why? Apache by itself doesn't need to talk to anywhere near the same number of 3rd-party things that PHP commonly talks to.

    > #2 Is there progress being made towards having PHP work with Apache2. > And who is working on this (if not the PHP team).

    Nobody really is. And I don't see this changing until there are some really compelling features in Apache2 to warrant the massive effort it would take. And yes, a working perchild mpm may be that compelling feature, but we don't have one of those.

    All of this stuff is available by reading the PHP and Apache dev lists, by the way. They are archived and not that hard to find.

    -Rasmus