OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Fri Apr 06 2001 - 06:28:54 CDT

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

    php-general Digest 6 Apr 2001 11:28:54 -0000 Issue 611

    Topics (messages 47325 through 47429):

    How can I make this smaller
            47325 by: Richard Kurth
            47329 by: Matt McClanahan
            47335 by: Chris Anderson
            47336 by: Lindsay Adams

    Re: better functionality in query ?
            47326 by: Jason Lotito
            47346 by: Jerry Lake
            47351 by: Joe Stump
            47357 by: Jason Lotito
            47416 by: Tim Ward
            47427 by: Christian Reiniger

    Re: about php.ini
            47327 by: Christian Reiniger
            47331 by: Jason Lotito
            47339 by: eschmid+sic.s.netic.de

    Re: How can I send command to ftp?
            47328 by: Christian Reiniger

    Directory(parent) Structure
            47330 by: Chris Anderson
            47333 by: Joe Stump
            47334 by: Jack Dempsey
            47338 by: Chris Anderson
            47371 by: Plutarck

    Re: PHP and CVS
            47332 by: Joe Stump

    How can I chmod something with php.
            47337 by: Brandon Orther
            47361 by: David Robley

    MySql & PHP - Looking for the right command
            47340 by: YoBro
            47342 by: Joe Stump

    MySQL (about 1 database, many tables)
            47341 by: Richard
            47343 by: Lindsay Adams
            47358 by: Richard

    Re: BUG - Someone else please verify B4 I file
            47344 by: Plutarck

    Read one word in file
            47345 by: Andrew V. Romero
            47347 by: Joe Stump
            47350 by: Chris Fry
            47368 by: Plutarck

    Re: how to return strings from functions?
            47348 by: Toby Butzon

    Re: scramble the code
            47349 by: Plutarck

    Re: foreach ?!
            47352 by: Yasuo Ohgaki

    fopen wierdness
            47353 by: Jerry
            47355 by: Steve Werby
            47360 by: Richard
            47365 by: Jerry
            47367 by: Plutarck
            47379 by: Steve Werby
            47426 by: Christian Reiniger

    Re: array speed
            47354 by: Yasuo Ohgaki

    Re: "YourName.BEST321.com" FREE免費域名 !!!!!
            47356 by: David Robley
            47369 by: Plutarck

    Re: drop-down menu variables
            47359 by: Richard
            47364 by: Joe Stump

    Re: Include / Require
            47362 by: Plutarck

    Re: Mail() Speed?
            47363 by: Plutarck

    Re: How can I make this smaller + something neet with global
            47366 by: Plutarck

    Re: PHP sending email contents as an attachment, not in thebody
            47370 by: Stuart J. Browne

    I'm equally curious
            47372 by: Plutarck

    Re: output buffering
            47373 by: Christian Dechery
            47375 by: Plutarck

    ob_*() functions in Win9x
            47374 by: Christian Dechery
            47377 by: Plutarck

    probs with session_register() solved...
            47376 by: Christian Dechery

    Addendum
            47378 by: Plutarck

    Re: IF this then, move to this line...
            47380 by: Wade DeWerff
            47420 by: Stewart Taylor

    Re: PHP with Win2k or Linux
            47381 by: John

    Re: Problems porting from MySQL Server to MSSQL7 Server
            47382 by: John
            47394 by: Michael Kimsal
            47428 by: jlim.natsoft.com.my

    Re: close tcp-IP connection before php-skript finishes
            47383 by: Steve Werby

    Re: Crack extension
            47384 by: John

    doubt in ob_*() functions
            47385 by: Christian Dechery
            47388 by: Aaron Tuller

    mystery line
            47386 by: Martin Skj闤debrand
            47387 by: Tyler Longren
            47389 by: David Robley
            47395 by: Martin Skj闤debrand
            47397 by: David Robley

    Problem with each()
            47390 by: David Minor
            47396 by: Jeff Carnahan

    Re: Building an array from a URL
            47391 by: Mike Gifford
            47411 by: Plutarck

    How to don愒 write if exist
            47392 by: Jan Grafstr闣

    Passing Arrays Between Pages Using Forms
            47393 by: Mike Gifford

    use NEWLY-ASSIGNED SESSION id?
            47398 by: Derek Sivers

    fopen() redirected file & frameset file
            47399 by: Thomas Edison Jr.

    fopen() Redirected File & Frameset File!!!
            47400 by: Thomas Edison Jr.

    Using proxy servers with fsockopen()
            47401 by: Vlad
            47406 by: Plamen Slavov

    PHP and geocities
            47402 by: Joseph Bannon
            47403 by: CC Zona
            47410 by: Plutarck

    Array of words in textfile?
            47404 by: Jan Grafstr闣
            47407 by: Plutarck

    function and global problems
            47405 by: Richard Kurth
            47408 by: Plutarck
            47412 by: Richard Kurth

    Re: sockets (long)
            47409 by: Joseph Blythe

    Nearly all (1755) PHP functions in a text file
            47413 by: Plutarck

    help me please :(
            47414 by: Nilesh Parmar

    Re: inlude_path not in php.ini
            47415 by: Alvin Tan
            47419 by: Matt Williams

    help me on file writing
            47417 by: hari t.v.s prakash

    Array problem
            47418 by: Alexis Antonakis

    Using Templates and replace tags to create dynamic content
            47421 by: Sharat Hegde

    Variables
            47422 by: Cheng, Kynan (London)

    Update All fields?
            47423 by: James Holloway
            47424 by: Martin Cabrera Diaubalick

    Re: Apache latest + PHP latest + GD latest + Freetype latest + Jpeg latest
            47425 by: Daniel B I

    problem: php-document in netscape is oly downloadable
            47429 by: Markus Mattes

    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:


    Is there another way to write this I would like to make it smaller
    also How would I write it so it is a function and I would be able to use all
    the data throughout the whole program every time I try the rest of the
    program does not see the data

    if(file_exists("userdata")) {
    $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)");
    flock($fp2, 2); //unless ($use_flock == 0);
    while ($data = fgetcsv ($fp2, 1000, "|")) {
        $num = count ($data);
          $row++;
          for ($c=0; $c<$num; $c++) {

        }
     $domain=$data[0];
     $tld=$data[1];
      $firstname=$data[2];
     $lastname=$data[3];
     $userid=$data[4];
     $passw=$data[5]; this part would like to make smaller
      $email=$data[6];
     $package=$data[7];
     $frontpage=$data[8];
     $mysql=$data[9];
     $userdatabase=$data[10];
     $newuser =$data[11];
    $newuserpass =$data[12];
    }

    //close and del file
    fclose ($fp2);
    system ("del userdata");

    attached mail follows:


    On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote:

    > Is there another way to write this I would like to make it smaller
    > also How would I write it so it is a function and I would be able to use all
    > the data throughout the whole program every time I try the rest of the
    > program does not see the data

    > $domain=$data[0];
    > $tld=$data[1];
    > $firstname=$data[2];
    > $lastname=$data[3];
    > $userid=$data[4];
    > $passw=$data[5]; this part would like to make smaller
    > $email=$data[6];
    > $package=$data[7];
    > $frontpage=$data[8];
    > $mysql=$data[9];
    > $userdatabase=$data[10];
    > $newuser =$data[11];
    > $newuserpass =$data[12];

    Use list()

    list($domain,$tld,$firstname,$lastname,$userid,.....) = $data;

    If you want to put it in a function, declare them all globals beforehand.

    function myfunc()
    {
       global $domain,$tld,$firstname,$lastname,$userid...;

    Matt

    attached mail follows:


    Cool, not my thread, but i never knew about the list function. /me needs to
    read up an arrays more i guess
    ----- Original Message -----
    From: "Matt McClanahan" <cardinaldodds.net>
    To: "Richard Kurth" <rkurthpacifier.com>
    Cc: "PHP" <php-generallists.php.net>
    Sent: Thursday, April 05, 2001 6:56 PM
    Subject: Re: [PHP] How can I make this smaller

    > On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote:
    >
    > > Is there another way to write this I would like to make it smaller
    > > also How would I write it so it is a function and I would be able to use
    all
    > > the data throughout the whole program every time I try the rest of the
    > > program does not see the data
    >
    > > $domain=$data[0];
    > > $tld=$data[1];
    > > $firstname=$data[2];
    > > $lastname=$data[3];
    > > $userid=$data[4];
    > > $passw=$data[5]; this part would like to make smaller
    > > $email=$data[6];
    > > $package=$data[7];
    > > $frontpage=$data[8];
    > > $mysql=$data[9];
    > > $userdatabase=$data[10];
    > > $newuser =$data[11];
    > > $newuserpass =$data[12];
    >
    > Use list()
    >
    > list($domain,$tld,$firstname,$lastname,$userid,.....) = $data;
    >
    > If you want to put it in a function, declare them all globals beforehand.
    >
    > function myfunc()
    > {
    > global $domain,$tld,$firstname,$lastname,$userid...;
    >
    > Matt
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > For additional commands, e-mail: php-general-helplists.php.net
    > To contact the list administrators, e-mail: php-list-adminlists.php.net
    >
    >

    attached mail follows:


    On 4/5/01 3:56 PM, "Matt McClanahan" <cardinaldodds.net> wrote:

    > On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote:
    >
    >> Is there another way to write this I would like to make it smaller
    >> also How would I write it so it is a function and I would be able to use all
    >> the data throughout the whole program every time I try the rest of the
    >> program does not see the data
    >
    >> $domain=$data[0];
    >> $tld=$data[1];
    >> $firstname=$data[2];
    >> $lastname=$data[3];
    >> $userid=$data[4];
    >> $passw=$data[5]; this part would like to make smaller
    >> $email=$data[6];
    >> $package=$data[7];
    >> $frontpage=$data[8];
    >> $mysql=$data[9];
    >> $userdatabase=$data[10];
    >> $newuser =$data[11];
    >> $newuserpass =$data[12];
    >
    > Use list()
    >
    > list($domain,$tld,$firstname,$lastname,$userid,.....) = $data;
    >
    > If you want to put it in a function, declare them all globals beforehand.
    >
    > function myfunc()
    > {
    > global $domain,$tld,$firstname,$lastname,$userid...;
    >
    > Matt

    Umm, you can add them to the global space this way.
    Inside a function.

    $GLOBALS['domain']=data[0];
    $GLOBLAS['tld']=data[1];
    ...

    Can't you? Everyone?

    Or you can pass as a reference in the last parameter of your function call,
    the variable that you want returned as an array

    Function get_data($parm,$parm,&$array_parm)

    And set the values of $array_parm['variablename']=whatever
    Inside the function, and return $array_parm at the end of the function call.

    So, if you called your function as

    get_data("somethinghere","somethingelse",$returned_array);

    $returned_array['domain'] will equal whatever $data[0] was

    But I think adding the variable to the GLOBAL array will work fine.

    attached mail follows:


    > I'm in process of creating a online whitepages directory for
    > a small town phone company and I am having a little difficulty
    > in refining my selection. My search form has two fields; last
    > and first name. I would like to be able to have more of a wild
    > card approach and some refinement when a user enters both a
    > first and last name. I am unsure how to go about this, should
    > I restructure my query, or make changes to my PHP. here is the
    > query I am currently using. and the site is located at
    > http://whitepages.maadtelco.com/ any assistance/direction is certainly
    > appreciated.
    >
    > <snip>
    > $query = "select * from whitepages WHERE last_name LIKE '$last_name' ORDER
    > BY last_name" or die("Nothing to see here");
    > </snip>

    $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' ORDER
    BY last_name" or die("Nothing to see here");

    Question, why are you 'die'ing on a variable assigntment? Wouldn't you want
    to 'die' on the actualy db_query()?

    Note the added '%', this is assuming you are using MySQL, though they are
    generally the same, I believe, with other DB's. The % is essentially
    wildcard of any amount. So, if the last_name was BOB

    it would find

    BOBBY
    BOBBER
    ADOBOB

    $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%'
    $andor first_name LIKE '%$first_name' ORDER
    BY last_name" or die("Nothing to see here");

    In this query, we are including the First Name. In this, we are also using
    the $andor variable, which you can define as AND, or OR, or allow the user
    to define it by using a radio box or the like when making the search. I
    suggest setting a default of OR for the variable $andor.

    Jason Lotito
    www.NewbieNetwork.net
    Where those who can, teach;
    and those who can, learn.

    attached mail follows:


    Damn, if I'd a known it was that easy ;)
    Thanks for the help, works great now.

    Jerry Lake - jerryleuropa.com
    Web Designer
    Europa Communications - http://www.europa.com
    Pacifier Online - http://www.pacifier.com

    -----Original Message-----
    From: Jason Lotito [mailto:Jasonlehighweb.com]
    Sent: Thursday, April 05, 2001 7:09 PM
    To: Jerry Lake; php-generallists.php.net
    Subject: RE: [PHP] better functionality in query ?

    > I'm in process of creating a online whitepages directory for
    > a small town phone company and I am having a little difficulty
    > in refining my selection. My search form has two fields; last
    > and first name. I would like to be able to have more of a wild
    > card approach and some refinement when a user enters both a
    > first and last name. I am unsure how to go about this, should
    > I restructure my query, or make changes to my PHP. here is the
    > query I am currently using. and the site is located at
    > http://whitepages.maadtelco.com/ any assistance/direction is certainly
    > appreciated.
    >
    > <snip>
    > $query = "select * from whitepages WHERE last_name LIKE '$last_name' ORDER
    > BY last_name" or die("Nothing to see here");
    > </snip>

    $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' ORDER
    BY last_name" or die("Nothing to see here");

    Question, why are you 'die'ing on a variable assigntment? Wouldn't you want
    to 'die' on the actualy db_query()?

    Note the added '%', this is assuming you are using MySQL, though they are
    generally the same, I believe, with other DB's. The % is essentially
    wildcard of any amount. So, if the last_name was BOB

    it would find

    BOBBY
    BOBBER
    ADOBOB

    $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%'
    $andor first_name LIKE '%$first_name' ORDER
    BY last_name" or die("Nothing to see here");

    In this query, we are including the First Name. In this, we are also using
    the $andor variable, which you can define as AND, or OR, or allow the user
    to define it by using a radio box or the like when making the search. I
    suggest setting a default of OR for the variable $andor.

    Jason Lotito
    www.NewbieNetwork.net
    Where those who can, teach;
    and those who can, learn.

    attached mail follows:


    NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are making a phone book,
    which could get to be a lot of numbers. On the other hand 'foo%' oddly scales to
    hundreds of thousands of records without any problems (make sure it's key'd!).

    Which should work fine in your instance - just have people type in the first
    4 letters of the persons name.

    --Joe

    On Thu, Apr 05, 2001 at 04:51:47PM -0700, Jerry Lake wrote:
    > Damn, if I'd a known it was that easy ;)
    > Thanks for the help, works great now.
    >
    > Jerry Lake - jerryleuropa.com
    > Web Designer
    > Europa Communications - http://www.europa.com
    > Pacifier Online - http://www.pacifier.com
    >
    >
    > -----Original Message-----
    > From: Jason Lotito [mailto:Jasonlehighweb.com]
    > Sent: Thursday, April 05, 2001 7:09 PM
    > To: Jerry Lake; php-generallists.php.net
    > Subject: RE: [PHP] better functionality in query ?
    >
    >
    >
    > > I'm in process of creating a online whitepages directory for
    > > a small town phone company and I am having a little difficulty
    > > in refining my selection. My search form has two fields; last
    > > and first name. I would like to be able to have more of a wild
    > > card approach and some refinement when a user enters both a
    > > first and last name. I am unsure how to go about this, should
    > > I restructure my query, or make changes to my PHP. here is the
    > > query I am currently using. and the site is located at
    > > http://whitepages.maadtelco.com/ any assistance/direction is certainly
    > > appreciated.
    > >
    > > <snip>
    > > $query = "select * from whitepages WHERE last_name LIKE '$last_name' ORDER
    > > BY last_name" or die("Nothing to see here");
    > > </snip>
    >
    >
    > $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' ORDER
    > BY last_name" or die("Nothing to see here");
    >
    > Question, why are you 'die'ing on a variable assigntment? Wouldn't you want
    > to 'die' on the actualy db_query()?
    >
    > Note the added '%', this is assuming you are using MySQL, though they are
    > generally the same, I believe, with other DB's. The % is essentially
    > wildcard of any amount. So, if the last_name was BOB
    >
    > it would find
    >
    > BOBBY
    > BOBBER
    > ADOBOB
    >
    > $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%'
    > $andor first_name LIKE '%$first_name' ORDER
    > BY last_name" or die("Nothing to see here");
    >
    > In this query, we are including the First Name. In this, we are also using
    > the $andor variable, which you can define as AND, or OR, or allow the user
    > to define it by using a radio box or the like when making the search. I
    > suggest setting a default of OR for the variable $andor.
    >
    > Jason Lotito
    > www.NewbieNetwork.net
    > Where those who can, teach;
    > and those who can, learn.
    >
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > For additional commands, e-mail: php-general-helplists.php.net
    > To contact the list administrators, e-mail: php-list-adminlists.php.net

    /******************************************************************************\
     * Joe Stump - PHP/SQL/HTML Developer *
     * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net *
     * "Better to double your money on mediocrity than lose it all on a dream." *
    \******************************************************************************/

    attached mail follows:


    > > > I'm in process of creating a online whitepages directory for
    > > > a small town phone company and I am having a little difficulty
    > > > in refining my selection. My search form has two fields; last
    > > > and first name. I would like to be able to have more of a wild
    > > > card approach and some refinement when a user enters both a
    > > > first and last name. I am unsure how to go about this, should
    > > > I restructure my query, or make changes to my PHP. here is the
    > > > query I am currently using. and the site is located at
    > > > http://whitepages.maadtelco.com/ any assistance/direction is certainly
    > > > appreciated.
    > > >
    > > > <snip>
    > > > $query = "select * from whitepages WHERE last_name LIKE
    > '$last_name' ORDER
    > > > BY last_name" or die("Nothing to see here");
    > > > </snip>
    > >
    > >
    > > $query = "SELECT * FROM whitepages WHERE last_name LIKE
    > '%$last_name%' ORDER
    > > BY last_name" or die("Nothing to see here");
    > >
    > > Question, why are you 'die'ing on a variable assigntment?
    > Wouldn't you want
    > > to 'die' on the actualy db_query()?
    > >
    > > Note the added '%', this is assuming you are using MySQL,
    > though they are
    > > generally the same, I believe, with other DB's. The % is essentially
    > > wildcard of any amount. So, if the last_name was BOB
    > >
    > > it would find
    > >
    > > BOBBY
    > > BOBBER
    > > ADOBOB
    > >
    > > $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%'
    > > $andor first_name LIKE '%$first_name' ORDER
    > > BY last_name" or die("Nothing to see here");
    > >
    > > In this query, we are including the First Name. In this, we
    > are also using
    > > the $andor variable, which you can define as AND, or OR, or
    > allow the user
    > > to define it by using a radio box or the like when making the search. I
    > > suggest setting a default of OR for the variable $andor.
    > >
    > > Jason Lotito

    > On Thu, Apr 05, 2001 at 04:51:47PM -0700, Jerry Lake wrote:
    > > Damn, if I'd a known it was that easy ;)
    > > Thanks for the help, works great now.
    > >
    >

    -----Original Message-----
    > From: Joe Stump [mailto:miesterphp.net]

    > NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are
    > making a phone book,
    > which could get to be a lot of numbers. On the other hand 'foo%'
    > oddly scales to
    > hundreds of thousands of records without any problems (make sure
    > it's key'd!).
    >
    > Which should work fine in your instance - just have people type
    > in the first
    > 4 letters of the persons name.
    >
    > --Joe
    >

    Very true, good point. Good thing to keep in mind, and something I
    overlooked.

    Jason Lotito
    www.NewbieNetwork.net
    Where those who can, teach;
    and those who can, learn.

    attached mail follows:


    the way I'd do it is " ... WHERE lastname LIKE '$last_name%" AND firstname
    LIKE "$first_name%"

    this gets round the problem of blank first names and treats all names as
    being the start of a name, e.g. "Smith" will find "Smithson", but because of
    your ORDER BY, for an exact imnput, an exact match will always show first.
    haven't tried this at all but seems sound sql.

            Tim Ward
            Senior Systems Engineer

    Please refer to the following disclaimer in respect of this message:
    http://www.stivesdirect.com/e-mail-disclaimer.html

    > -----Original Message-----
    > From: Jerry Lake [mailto:jerryleuropa.com]
    > Sent: 05 April 2001 22:23
    > To: php-generallists.php.net
    > Subject: better functionality in query ?
    >
    >
    > I'm in process of creating a online whitepages directory for
    > a small town phone company and I am having a little difficulty
    > in refining my selection. My search form has two fields; last
    > and first name. I would like to be able to have more of a wild
    > card approach and some refinement when a user enters both a
    > first and last name. I am unsure how to go about this, should
    > I restructure my query, or make changes to my PHP. here is the
    > query I am currently using. and the site is located at
    > http://whitepages.maadtelco.com/ any assistance/direction is certainly
    > appreciated.
    >
    > <snip>
    > $query = "select * from whitepages WHERE last_name LIKE
    > '$last_name' ORDER
    > BY last_name" or die("Nothing to see here");
    > </snip>
    >
    > Jerry Lake - jerryleuropa.com
    > Web Designer
    > Europa Communications - http://www.europa.com
    > Pacifier Online - http://www.pacifier.com
    >
    >

    attached mail follows:


    On Friday 06 April 2001 01:57, you wrote:
    > NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are making a
    > phone book, which could get to be a lot of numbers. On the other hand
    > 'foo%' oddly scales to hundreds of thousands of records without any
    > problems (make sure it's key'd!).

    Well, if you think a bit about it it's not odd at all. For "%foo%" the DB
    has to examine the entire string until it finds an occurence of "foo" or
    until it reaches the end - and it can not use any (normal) index. for it.
    For "foo%" it just has to examine the first three chars - that's even
    faster than "WHERE phone = 'foobar-something'"
    and works very nicely with a perfectly normal index.

    -- 
    Christian Reiniger
    LGDC Webmaster (http://sunsite.dk/lgdc/)
    

    I saw God --------- and she was black.

    attached mail follows:


    On Thursday 05 April 2001 20:30, you wrote: > Hi all, > > i'm would to know if there is a doc that give all php.ini possiblities > with all variables that can be set or something like that

    Yes. Most people call it "PHP Manual"

    -- 
    Christian Reiniger
    LGDC Webmaster (http://sunsite.dk/lgdc/)
    

    Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds.

    - http://www.google.com/search?q=e

    attached mail follows:


    > > On Thursday 05 April 2001 20:30, you wrote: > > Hi all, > > > > i'm would to know if there is a doc that give all php.ini possiblities > > with all variables that can be set or something like that > > Yes. Most people call it "PHP Manual" > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/)

    Can I get a URL to it?

    No, no, Just Kidding, sorry, couldn't resist, sorry... oh...it has been a long week.

    =)

    Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn.

    attached mail follows:


    On Fri, Apr 06, 2001 at 12:53:50AM +0200, Christian Reiniger wrote: > On Thursday 05 April 2001 20:30, you wrote:

    > > i'm would to know if there is a doc that give all php.ini possiblities > > with all variables that can be set or something like that > > Yes. Most people call it "PHP Manual"

    This was not the correct answer. He asked for configuration parameters and that is best answered with "read the output from ./configure --help". Besides that in every distribution is a file php.ini-dist with enough comments.

    The so called "PHP Manual" can be found at http://php.net/manual. I should know this, because I'm one of the editors.

    -Egon

    -- 
    LinuxTag, Stuttgart, Germany: July 5-8 2001: http://www.linuxtag.de/
    All known books about PHP and related books: http://php.net/books.php 
    Concert Band of the University of Hohenheim: http://www.concert-band.de/
    First and second bestselling book in German: http://www.php-buch.de/
    

    attached mail follows:


    On Thursday 05 April 2001 20:45, you wrote: > Hello, > > While connected to ftp can I send a command to the ftp?

    Yes

    -- 
    Christian Reiniger
    LGDC Webmaster (http://sunsite.dk/lgdc/)
    

    Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds.

    - http://www.google.com/search?q=e

    attached mail follows:


    I know using ../ in a path moves to the parent directory. But is there a way to move back farther then that?

    attached mail follows:


    ../../../../../../../ -> ../n

    or

    chdir();

    --Joe

    On Mon, Apr 02, 2001 at 06:44:30PM -0400, Chris Anderson wrote: > I know using ../ in a path moves to the parent directory. But is there a way to move back farther then that?

    /******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/

    attached mail follows:


    Sure

    .. = parent ../.. = parent of that etc...

    / = root

    you can get to any directory on your server by using a combination of .. and directory names, or, and this is often a good idea, you can just specify the location from root, for example

    /path/to/my/file

    that way if you move the file with .. in it, it'll still find your file correctly........

    jack

    Chris Anderson wrote: > > I know using ../ in a path moves to the parent directory. But is there a way to move back farther then that?

    attached mail follows:


    funny thing is, I thought to try it, but thought it looked too strange to work ^_^ ----- Original Message ----- From: "Jack Dempsey" <dempsejngeorgetown.edu> To: "Chris Anderson" <m1garandameritech.net> Cc: "PHP" <php-generallists.php.net> Sent: Thursday, April 05, 2001 7:06 PM Subject: Re: [PHP] Directory(parent) Structure

    > Sure > > .. = parent > ../.. = parent of that > etc... > > / = root > > you can get to any directory on your server by using a combination of .. > and directory names, or, and this is often a good idea, you can just > specify the location from root, for example > > /path/to/my/file > > that way if you move the file with .. in it, it'll still find your file > correctly........ > > jack > > Chris Anderson wrote: > > > > I know using ../ in a path moves to the parent directory. But is there a way to move back farther then that? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Why? Does this look weird to you?

    ../../../../../../../../../../../../../../../../../../../../../../../../../. ./../../../../../../../../../../../../../../../../../../../../../../../../.. /../../../../../../../../../../../../../../../../../../../../../../please/ju st/kill/me.ace

    Yeah ok, sometimes I go too far with nested folders. But I figure if anyone wants to go through 30 folders, unace, unrar, ungzp, untar, then run a self-extracting zip file that requires a password, then decrypt a 64 bit blowfish encryption file, then they deserve any information they'd like. Including myself.

    Or maybe I just like abusing nested technology. Go figure.

    Useful note:

    . = current directory.

    Alright, that wasn't that useful.

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    ""Chris Anderson"" <chrisdersonameritech.net> wrote in message news:004001c0bbc8$cf447f80$1a1012d1s3e8p3... > funny thing is, I thought to try it, but thought it looked too strange to > work ^_^ > ----- Original Message ----- > From: "Jack Dempsey" <dempsejngeorgetown.edu> > To: "Chris Anderson" <m1garandameritech.net> > Cc: "PHP" <php-generallists.php.net> > Sent: Thursday, April 05, 2001 7:06 PM > Subject: Re: [PHP] Directory(parent) Structure > > > > Sure > > > > .. = parent > > ../.. = parent of that > > etc... > > > > / = root > > > > you can get to any directory on your server by using a combination of .. > > and directory names, or, and this is often a good idea, you can just > > specify the location from root, for example > > > > /path/to/my/file > > > > that way if you move the file with .. in it, it'll still find your file > > correctly........ > > > > jack > > > > Chris Anderson wrote: > > > > > > I know using ../ in a path moves to the parent directory. But is there a > way to move back farther then that? > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    This is what we use at work - it's a web frontend to RCS. It works great and we have employees all over the country (and world) using it from one location. It even publishes to the main server via rsync once you want to make your changes live (based on web editing ... but would work for other applications)

    http://sourceforge.net/projects/publishtron

    We just released it open source ... it's hackers only right now, but someone is working on making it all pretty and easy to install.

    --Joe

    On Thu, Apr 05, 2001 at 05:17:51PM -0400, ..s.c.o.t.t.. [gts] wrote: > do any of you know of any nice web-interfaces to CVS > done in PHP? > > since i write code at home and at work, i wanted to maintain > a single repository for files/code that i frequently use... > > thanks for any suggestions. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    /******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/

    attached mail follows:


    Hello,

    I have been looking for a chmod command in the ftp functions, and there isn't any. how can I chmod something?

    thanks Brandon

    attached mail follows:


    On Fri, 6 Apr 2001 05:45, Brandon Orther wrote: > Hello, > > I have been looking for a chmod command in the ftp functions, and there > isn't any. how can I chmod something? > > thanks > Brandon

    I think you need ftp_site()

    -- 
    David Robley                        | WEBMASTER & Mail List Admin
    RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
    AusEinet                            | http://auseinet.flinders.edu.au/
                Flinders University, ADELAIDE, SOUTH AUSTRALIA
    

    attached mail follows:


    Hello,

    I have a site that lists cars in a MySql database. I want to display on a page how many makes of each are in the database (Under the feild make) Like: Honda (30) //Then links to the honda page etc Toyota (25) Ford (7)

    Do you know what I mean. I know how to produce results from MySql, but I don't know how to get it to count how many hondas, toyotas etc on the same page from within the database.

    help!

    --
    Regards,
    

    YoBro ------------------------------------------------------------- DO NOT REPLY TO THIS VIA EMAIL PLEASE USE THE NEWSGROUP All emails sent to this address are automatically deleted. This is to avoid SPAM! -------------------------------------------------------------

    attached mail follows:


    This is how you can do it (just tried it on my news with my news categoryID's)

    i'll modify slightly for your purpose with psuedo code ...

    SELECT carType,count(carType) FROM cars GROUP BY carType;

    --Joe

    On Fri, Apr 06, 2001 at 11:28:00AM +1200, YoBro wrote: > Hello, > > I have a site that lists cars in a MySql database. > I want to display on a page how many makes of each are in the database > (Under the feild make) > Like: > Honda (30) //Then links to the honda page etc > Toyota (25) > Ford (7) > > Do you know what I mean. I know how to produce results from MySql, but I > don't know how to get it to count how many hondas, toyotas etc on the same > page from within the database. > > > help! > > -- > Regards, > > > YoBro > ------------------------------------------------------------- > DO NOT REPLY TO THIS VIA EMAIL > PLEASE USE THE NEWSGROUP > All emails sent to this address are automatically deleted. > This is to avoid SPAM! > ------------------------------------------------------------- > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    /******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/

    attached mail follows:


    Greetings.

    As "Frank K" wrote for some days ago, I was into the same thing, but I need help with the following: I am creating a messaging central, which is quite about the same as a web community if you like, or whatever. The thing is, I need to save all the users, mailboxes and login dates... But I only have one database, but infinite tables. Does anyone has any examples or tips? The following didn't go very well, but probably because I suck in MySQL:

    $query = "CREATE TABLE $tb_name ( UiD bigint(20) NOT NULL auto_increment, uName text NOT NULL, uPwd text NOT NULL)";

    What I was trying to do is to create one table which is called "users", which contains : uID (unique id, incremental!) uOnline (boolean) uName and uPWD

    And some other stuff, but as you can see, it did not go very well... Any help is appriciated!

    - Richard

    attached mail follows:


    If that query did not work, then maybe the user that you are connecting to the database as does not have table create privileges?

    The syntax of the query is correct I am a little confused why you are using a text type for those columns And you can probably stand to use unsigned for UiD, since I doubt that you will be using negative values.

    Note that the value you pass for bigint() only represents the field width that mysql should display. It has nothing to do with the size of the number it can store.

    On 4/5/01 4:33 PM, "Richard" <oblivionlunamorena.net> wrote:

    > Greetings. > > As "Frank K" wrote for some days ago, I was into the same thing, but I > need help with the following: I am creating a messaging central, which is > quite about the same as a web community if you like, or whatever. The thing > is, I need to save all the users, mailboxes and login dates... But I only > have one database, but infinite tables. Does anyone has any examples or > tips? The following didn't go very well, but probably because I suck in > MySQL: > > $query = "CREATE TABLE $tb_name ( UiD bigint(20) NOT NULL > auto_increment, uName text NOT NULL, uPwd text NOT NULL)"; > > What I was trying to do is to create one table which is called "users", > which contains : > uID (unique id, incremental!) uOnline (boolean) uName and uPWD > > And some other stuff, but as you can see, it did not go very well... Any > help is appriciated! > > > - Richard > >

    attached mail follows:


    Well, that was what I wrote in my post.. I don't get this MySQL that well, and I didn't find that row very logical at all. But I got this email about it, so I will read it and keep on reporting.

    - Richard

    "Lindsay Adams" <lindsaydingos.net> wrote in message news:B6F251D0.44D8%lindsaydingos.net... > If that query did not work, then maybe the user that you are connecting to > the database as does not have table create privileges? > > The syntax of the query is correct > I am a little confused why you are using a text type for those columns > And you can probably stand to use unsigned for UiD, since I doubt that you > will be using negative values. > > Note that the value you pass for bigint() only represents the field width > that mysql should display. It has nothing to do with the size of the number > it can store. > > On 4/5/01 4:33 PM, "Richard" <oblivionlunamorena.net> wrote: > > > Greetings. > > > > As "Frank K" wrote for some days ago, I was into the same thing, but I > > need help with the following: I am creating a messaging central, which is > > quite about the same as a web community if you like, or whatever. The thing > > is, I need to save all the users, mailboxes and login dates... But I only > > have one database, but infinite tables. Does anyone has any examples or > > tips? The following didn't go very well, but probably because I suck in > > MySQL: > > > > $query = "CREATE TABLE $tb_name ( UiD bigint(20) NOT NULL > > auto_increment, uName text NOT NULL, uPwd text NOT NULL)"; > > > > What I was trying to do is to create one table which is called "users", > > which contains : > > uID (unique id, incremental!) uOnline (boolean) uName and uPWD > > > > And some other stuff, but as you can see, it did not go very well... Any > > help is appriciated! > > > > > > - Richard > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Sure. It's an "environment variable", so it should always be set, even if it is empty.

    It's just a matter that all variables are declared, THEN their values are assigned.

    That's how C works, and that's what PHP is built in, so that's the behavior. It makes it more standard with other applications, without loosing any real functionality.

    So it's annoying at times, but with just a switch-aroo of the functions you are using, you can do the same stuff.

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    "Krznaric Michael" <mkrznaricrand.com> wrote in message news:81A3043681E6824EBE672F7421C30E7E2A19AESRVTORONTO.RAND.COM... > O.k. I understand that, now why would HTTP_POST_VARS be set if no data is > posted? Is this desired operation? > > Mike > > -----Original Message----- > From: Jeff Carnahan [mailto:jcarnahannetworq.com] > Sent: Wednesday, April 04, 2001 2:18 PM > To: php-generallists.php.net > Subject: Re: [PHP] BUG - Someone else please verify B4 I file > > > In article <81A3043681E6824EBE672F7421C30E7E2A19A7 > SRVTORONTO.RAND.COM>, mkrznaricrand.com says... > }if (isset ($HTTP_POST_VARS)){ > } echo "Http Post Vars Set"; > > Remember, just because a variable is "set", it doesn't imply that the > variable has any data stored in it. In this case, while the > HTTP_POST_VARS array may be set, it does not contain any elements. > (It's size is zero.) > > Hence, it's not included in phpinfo(). > > -- > Jeff Carnahan - jcarnahannetworq.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    I have a php script that reads a file that looks something like this:

    1. Question One goes here: 2. Question two goes here:

    I need someway to have the script just read either the 1. or just the 1 When I first made the script I just had the program read the line using $questionBuffer = fgets($wq, 4096); and then I got the number by using a substring message: $currentQuestion = substr("$questionBuffer",0,1); and this works fine until I hit questions like 10 11... So how should I go about just getting the question number, ideally I would like to just read up until the first space is encountered. Is there a function to do that or will I need to create a for loop that goes through and compares each substring of 1 character to " ", and then once that " " is found, create a substring up until that " " character was found? Any ideas? --Andrew V. Romero To reply personally, remove all numbers from my address.

    attached mail follows:


    This is how I would do it ...

    <?

    $fp = fopen('/path/to/file','r'); while(!feof($fp)) { $line = trim(fgets($fp,4096)); if(strlen($line)) { $arr = explode(' ',$line); $numbers[] = $arr[0]; // if you want to make it remove the .'s then // do $numbers[] = str_replace('.','',$arr[0]); } }

    for($i = 0 ; $i < sizeof($numbers) ; ++$i) echo $numbers[$i]."\n";

    ?>

    --Joe

    On Thu, Apr 05, 2001 at 04:50:37PM -0700, Andrew V. Romero wrote: > I have a php script that reads a file that looks something like this: > > 1. Question One goes here: > 2. Question two goes here: > > I need someway to have the script just read either the 1. or just the 1 > When I first made the script I just had the program read the line using > $questionBuffer = fgets($wq, 4096); and then I got the number by using > a substring message: $currentQuestion = substr("$questionBuffer",0,1); > and this works fine until I hit questions like 10 11... > So how should I go about just getting the question number, ideally I > would like to just read up until the first space is encountered. Is > there a function to do that or will I need to create a for loop that > goes through and compares each substring of 1 character to " ", and then > once that " " is found, create a substring up until that " " character > was found? Any ideas? > --Andrew V. Romero > To reply personally, remove all numbers from my address. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    /******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/

    attached mail follows:


    You might want to use:-

    $aryQbuff = file("/pathto/filename", "r");

    You will then have each line of the file in an array.

    Then:- $intNumLines = count($aryQbuff); for($i=0;$i<=$intNumLines;$i++) { $intQnum = explode(".", $aryQbuff[$i]); // $intQnum now has the question number in it // Do some processing }

    This is just one way - there are plenty of others.

    Chris

    "Andrew V. Romero" wrote:

    > I have a php script that reads a file that looks something like this: > > 1. Question One goes here: > 2. Question two goes here: > > I need someway to have the script just read either the 1. or just the 1 > When I first made the script I just had the program read the line using > $questionBuffer = fgets($wq, 4096); and then I got the number by using > a substring message: $currentQuestion = substr("$questionBuffer",0,1); > and this works fine until I hit questions like 10 11... > So how should I go about just getting the question number, ideally I > would like to just read up until the first space is encountered. Is > there a function to do that or will I need to create a for loop that > goes through and compares each substring of 1 character to " ", and then > once that " " is found, create a substring up until that " " character > was found? Any ideas? > --Andrew V. Romero > To reply personally, remove all numbers from my address. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    --
    Chris Fry
    Quillsoft Pty Ltd
    Specialists in Secure Internet Services and E-Commerce Solutions
    10 Gray Street
    Kogarah
    NSW  2217
    Australia
    

    Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: chrisquillsoft.com.au http://www.quillsoft.com.au

    You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt

    **********************************************************************

    This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so.

    This notice should not be removed.

    attached mail follows:


    Once you get the first line into an array, you can just use explode on \n, or use a regex that searches for any group of characters that is not a whitespace character, then stops searching once it's found it.

    As Chris said, there are many many ways of doing it.

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    "Chris Fry" <chrisquillsoft.com.au> wrote in message news:3ACD075A.23BD6EFCquillsoft.com.au... > You might want to use:- > > $aryQbuff = file("/pathto/filename", "r"); > > You will then have each line of the file in an array. > > Then:- > $intNumLines = count($aryQbuff); > for($i=0;$i<=$intNumLines;$i++) { > $intQnum = explode(".", $aryQbuff[$i]); > // $intQnum now has the question number in it > // Do some processing > } > > This is just one way - there are plenty of others. > > Chris > > "Andrew V. Romero" wrote: > > > I have a php script that reads a file that looks something like this: > > > > 1. Question One goes here: > > 2. Question two goes here: > > > > I need someway to have the script just read either the 1. or just the 1 > > When I first made the script I just had the program read the line using > > $questionBuffer = fgets($wq, 4096); and then I got the number by using > > a substring message: $currentQuestion = substr("$questionBuffer",0,1); > > and this works fine until I hit questions like 10 11... > > So how should I go about just getting the question number, ideally I > > would like to just read up until the first space is encountered. Is > > there a function to do that or will I need to create a for loop that > > goes through and compares each substring of 1 character to " ", and then > > once that " " is found, create a substring up until that " " character > > was found? Any ideas? > > --Andrew V. Romero > > To reply personally, remove all numbers from my address. > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > -- > Chris Fry > Quillsoft Pty Ltd > Specialists in Secure Internet Services and E-Commerce Solutions > 10 Gray Street > Kogarah > NSW 2217 > Australia > > Phone: +61 2 9553 1691 > Fax: +61 2 9553 1692 > Mobile: 0419 414 323 > eMail: chrisquillsoft.com.au > http://www.quillsoft.com.au > > You can download our Public CA Certificate from:- > https://ca.secureanywhere.com/htdocs/cacert.crt > > ********************************************************************** > > This information contains confidential information intended only for > the use of the authorised recipient. If you are not an authorised > recipient of this e-mail, please contact Quillsoft Pty Ltd by return > e-mail. > In this case, you should not read, print, re-transmit, store or act > in reliance on this e-mail or any attachments, and should destroy all > copies of them. > This e-mail and any attachments may also contain copyright material > belonging to Quillsoft Pty Ltd. > The views expressed in this e-mail or attachments are the views of > the author and not the views of Quillsoft Pty Ltd. > You should only deal with the material contained in this e-mail if > you are authorised to do so. > > This notice should not be removed. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    If you typecast the string to a numeric type somewhere between setting $result to '1234 - the number', you WILL get the typecasted value, which would be the integer 1234.

    This may explain why you're only getting the number at the beginning of the string. Now, the question is: is there a typecast? Keep in mind that a typecast may be hidden - you don't have to explicitly typecast { $var = (int)$var } to get this effect. It could be implicit with a function call, etc.

    --Toby Butzon

    David Robley wrote: > > On Wed, 4 Apr 2001 15:44, Vlad wrote: > > Hi all > > > > script example: > > > > function smth(){ > > $result = '1234 - the number'; > > return $result; > > } > > ... > > $res = smth(); > > ... > > After this $res takes value of 1234 not the actual string. > > Is any soolution here? > > > > Thanks, Vlad > > If you do > function smth(){ > $result = '1234 - the number'; > return $result; > } > $res = smth(); > echo $res; > > The output is > > 1234 - the number > > What else is in your script? > > -- > David Robley | WEBMASTER & Mail List Admin > RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ > AusEinet | http://auseinet.flinders.edu.au/ > Flinders University, ADELAIDE, SOUTH AUSTRALIA > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Use either $HTTP_GET_VARS to see only data submited with get, or only $HTTP_POST_VARS for data submited with POST.

    If it exists in post but not get, it should _not_ be shown in your browser. But just because something _should_ do something doesn't mean it will.

    For every correct behavior there is a programmer with the will and the way to completely f^# it up. ;)

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    ""Joe Sheble (Wizaerd)"" <JustForMailingListswizaerd.com> wrote in message news:5.0.2.1.0.20010405070723.00a8c7a0mail.wizaerd.com... > This isn't quite accurate. WHen a form's method is set to "GET" (which BTW > is the form's default method) the variables and their values are passed > along the URL. If your form's method is set to "POST" then nothing should > get passed along on the URL. If you see all your data in the URL, you're > not using a POST method or the forms action is specified as a url with > parameters. > > At 09:06 AM 4/5/01 -0400, Scott Fletcher wrote: > >For the data in the "post", when the user type in the data and press the > >submit button, the data is then carry over to the nextpage.html. In the URL > >bar, I can clearly see the data, so is there to scramble hte data where > >anyone won't see it in the URL box at the top of the web browser? > >Thanks, > > Scott > > > > > > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: php-general-unsubscribelists.php.net > >For additional commands, e-mail: php-general-helplists.php.net > >To contact the list administrators, e-mail: php-list-adminlists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    > if ($mem_obj->home_email1!=='') > $vars["home_email1"] = "<input type=hidden name=home_email1 > value=$mem_obj->home_email1>";

    I think I don't understand what you really want to do. Anyway what's $mem_obj? Does $mem_obj->home_email1 have $HTTP_POST_VARS['home_email1'] before you test it?

    Sound like this is the cause to me.

    Regards,

    --
    Yasuo Ohgaki
    

    ""TV Karthick Kumar"" <tvkarthickmyrealbox.com> wrote in message news:031001c0bde4$f1638c00$760aa8c0office.tutticom.com... > Hi List.. > > I have the following code, which actually sets up the value of of the > hidden variable and passes onto the next page and there I manipulate the > data and send them emails. > > But passing the hidden variables depends upon the mem_id, that is the > hidden variable has to be passed for 'n' number of records. For example, if > I have two records then the I am checking the first record and finding out > the available email id (the various chances are home_email1, home_email2, > work_email1, work_email2 etc. and I have max. 4 email addresses in each > record) and passing it as an hidden variable to the next page. Here it's > very important to note that, at times, 4 emails will be available or 4 > emails will NOT be available (it'll be empty) and sometimes only 1 or 2 will > be available. There are possibilities like this. > > Now, as I have this code in place, what's happening is : when I pass any > of the email address of the first record, it's getting passed, where the > home_email1 is available and then when I pass any of the email address of > the second record, it's getting passed - BUT it's getting overwritten and I > have the value of the second record and I lost the first one. > > What I want is - I want the hidden variables to be passed and kept for > the number of records selected and then I would use pass them as hidden > variables and use it in the next page. I know that I have to use Arrays for > this, but what's next ?. > > Here's my code: > > if ($mem_obj->home_email1!=='') > $vars["home_email1"] = "<input type=hidden name=home_email1 > value=$mem_obj->home_email1>"; > > if ($mem_obj->home_email2!=='') > $vars["home_email2"] = "<input type=hidden name=home_email2 > value=$mem_obj->home_email2>"; > > if ($mem_obj->work_email1!=='') > $vars["work_email1"] = "<input type=hidden name=work_email1 > value=$mem_obj->work_email1>"; > > if ($mem_obj->work_email2!=='') > $vars["work_email2"] = "<input type=hidden name=work_email2 > value=$mem_obj->work_email2>"; > > Any help is much useful to me. > > Thanks in advance. > > ~ Karthick > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    im trying to fopen a url with something like to following :

    fopen("something.com/something.txt", r);

    this returns a "0"

    now when i rename the doc to something.htm, ill get the contents?

    Jerry Bonner Systems Analyst / Web Development --------------------------------- email: [bonnejprairie.lakes.com] icq : [34572902] phone: [507.344.1514] fax : [507.385.6017] --------------------------------- Prairie Lakes Internet

    attached mail follows:


    "Jerry" <bonnejPrairie.lakes.com> wrote: > im trying to fopen a url with something like to following : > > fopen("something.com/something.txt", r); > > this returns a "0"

    If you're trying to open an external file make sure you prepend the URL with 'http://'. If that's a local file and it's not finding the file, make sure the path is correct.

    > now when i rename the doc to something.htm, ill get the contents?

    Which document - the one being called by fopen() or the one containing the PHP script?

    --
    Steve Werby
    President, Befriend Internet Services LLC
    http://www.befriend.com/
    

    attached mail follows:


    No, you receive the handle to the file. You cannot rename the handle.

    <? $filename = "http://www.latest.txt"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); echo $contents; fclose ($fd); ?>

    Should do the trick.. or something.. Modify it or whatever.

    - Richard

    "Jerry" <bonnejPrairie.lakes.com> wrote in message news:Pine.LNX.4.21.0104051902400.15206-100000Prairie.lakes.com... > > im trying to fopen a url with something like to following : > > fopen("something.com/something.txt", r); > > this returns a "0" > > now when i rename the doc to something.htm, ill get the contents? > > > Jerry Bonner > Systems Analyst / Web Development > --------------------------------- > email: [bonnejprairie.lakes.com] > icq : [34572902] > phone: [507.344.1514] > fax : [507.385.6017] > --------------------------------- > Prairie Lakes Internet > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    acutally i found my problem, what was happening was that script1 that was on the server that file resides had that file open at the same time that scirpt2 was trying to open via http, when i change that files name, the permissions changed, and script1 was unable to open the file, and so script2 was able to :p my bad.

    but it leads me to another question, is there a way to get the file size of something opened via httpd?

    Jerry Bonner Systems Analyst / Web Development --------------------------------- email: [bonnejprairie.lakes.com] icq : [34572902] phone: [507.344.1514] fax : [507.385.6017] --------------------------------- Prairie Lakes Internet

    On Thu, 5 Apr 2001, Steve Werby wrote:

    > "Jerry" <bonnejPrairie.lakes.com> wrote: > > im trying to fopen a url with something like to following : > > > > fopen("something.com/something.txt", r); > > > > this returns a "0" > > If you're trying to open an external file make sure you prepend the URL with > 'http://'. If that's a local file and it's not finding the file, make sure > the path is correct. > > > now when i rename the doc to something.htm, ill get the contents? > > Which document - the one being called by fopen() or the one containing the > PHP script? > > -- > Steve Werby > President, Befriend Internet Services LLC > http://www.befriend.com/ >

    attached mail follows:


    Technically yes.

    In an HTTP session, the server returns a header "Content-length" which lists the more or less exact size of the file being sent.

    But there isn't really an easy way of reading HTTP headers in php, yet. I really wish there were.

    You can use fsockopen to make your own http session, and you may be able to use the CURL functions. But I really haven't a clue how, as I haven't yet had the time to play with them much.

    Maybe if it works, that's an easy way to do it...

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    "Jerry" <bonnejPrairie.lakes.com> wrote in message news:Pine.LNX.4.21.0104051949450.15206-100000Prairie.lakes.com... > acutally i found my problem, what was happening was that script1 that was > on the server that file resides had that file open at the same time that > scirpt2 was trying to open via http, when i change that files name, the > permissions changed, and script1 was unable to open the file, and so > script2 was able to :p my bad. > > but it leads me to another question, is there a way to get the file size > of something opened via httpd? > > > Jerry Bonner > Systems Analyst / Web Development > --------------------------------- > email: [bonnejprairie.lakes.com] > icq : [34572902] > phone: [507.344.1514] > fax : [507.385.6017] > --------------------------------- > Prairie Lakes Internet > > On Thu, 5 Apr 2001, Steve Werby wrote: > > > "Jerry" <bonnejPrairie.lakes.com> wrote: > > > im trying to fopen a url with something like to following : > > > > > > fopen("something.com/something.txt", r); > > > > > > this returns a "0" > > > > If you're trying to open an external file make sure you prepend the URL with > > 'http://'. If that's a local file and it's not finding the file, make sure > > the path is correct. > > > > > now when i rename the doc to something.htm, ill get the contents? > > > > Which document - the one being called by fopen() or the one containing the > > PHP script? > > > > -- > > Steve Werby > > President, Befriend Internet Services LLC > > http://www.befriend.com/ > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    "Steve Werby" <steve-listsbefriend.com> wrote: > acutally i found my problem, what was happening was that script1 that was > on the server that file resides had that file open at the same time that > scirpt2 was trying to open via http, when i change that files name, the > permissions changed, and script1 was unable to open the file, and so > script2 was able to :p my bad. > > but it leads me to another question, is there a way to get the file size > of something opened via httpd?

    If you use fread() to save the contents of the file into a variable and then use strlen() on the variable that will be pretty close. If it's important add on a few hundred bytes for the headers that don't get read in.

    --
    Steve Werby
    President, Befriend Internet Services LLC
    http://www.befriend.com/
    

    attached mail follows:


    On Friday 06 April 2001 03:12, you wrote: > Technically yes. > > In an HTTP session, the server returns a header "Content-length" which > lists the more or less exact size of the file being sent.

    Caution: The server is not required to send this header - PHP for example doesn't do it automatically.

    -- 
    Christian Reiniger
    LGDC Webmaster (http://sunsite.dk/lgdc/)
    

    I saw God --------- and she was black.

    attached mail follows:


    Just make sure you use foreach() instead of while() when you loop many times.

    foreach() is roughly 50% faster when I benched them.

    And never pass type other than object or array. foreach() simply dose not work with error message. (i.e. You will get 'server not found or dns error' or empty output)

    Regards,

    --
    Yasuo Ohgaki
    

    "Kurth Bemis" <kurthusaexpress.net> wrote in message news:4.3.2.7.2.20010405121439.00b759e0mail.usaexpress.net... > i'm concerned about the speed at which httpd (with php4.0.1pl1 compiles in > as a static mod) can "chew" through a 350 element 2d array. Can anyone > offer any information? > > ~kurth > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    On Thu, 5 Apr 2001 23:46, Zeus wrote: > I somehow got a feeling, someone is purposely, selling the php-general > list to some spam companies ;P > > ----- Original Message ----- > From: Water <best321mail.com> > To: <php-generallists.php.net> > Sent: Thursday, April 05, 2001 6:12 PM > Subject: [PHP] "YourName.BEST321.com" FREE 免費域名 !!!!!

    Hrm - I got three of these, one via php-general, one via the mirrors list and one direct to an address that isn't the one I use for php-general (although it might be the mirrors one).

    Hate spammers.

    -- 
    David Robley                        | WEBMASTER & Mail List Admin
    RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
    AusEinet                            | http://auseinet.flinders.edu.au/
                Flinders University, ADELAIDE, SOUTH AUSTRALIA
    

    attached mail follows:


    The spammers that use a foreign language are kind of fun though. Let's us use our imagination as to what they are saying.

    And we have fun trying to find an online translator that can make sense of it.

    Or not.

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    "David Robley" <huntsmanwww.nisu.flinders.edu.au> wrote in message news:01040609565301.10051www... > On Thu, 5 Apr 2001 23:46, Zeus wrote: > > I somehow got a feeling, someone is purposely, selling the php-general > > list to some spam companies ;P > > > > ----- Original Message ----- > > From: Water <best321mail.com> > > To: <php-generallists.php.net> > > Sent: Thursday, April 05, 2001 6:12 PM > > Subject: [PHP] "YourName.BEST321.com" FREE 免費域名 !!!!! > > Hrm - I got three of these, one via php-general, one via the mirrors list > and one direct to an address that isn't the one I use for php-general > (although it might be the mirrors one). > > Hate spammers. > > -- > David Robley | WEBMASTER & Mail List Admin > RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ > AusEinet | http://auseinet.flinders.edu.au/ > Flinders University, ADELAIDE, SOUTH AUSTRALIA > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    You must set:

    <option>some text</option>

    if it's a SELECT list. Use <input type="select" value="DEFAULT TEXT GOES HERE"> to set an initialized text.

    Use .VALUE to check if it's empty or not... But beware, sometimes it forgets the contents... If you would use the JavaScript "alert(text)" function...

    - Richard ""Joao Monteiro"" <absorbenthotmail.com> wrote in message news:9aahf3$bph$1toye.p.sourceforge.net... > when i edit variables with a form the ones wich are simple text get > corrected ok, but the ones chosen from drop-down menus only get added to > existing variables... > what am i doing wrong? > > Thanx > > Joao Monteiro > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    You should all check out libHTMLForm at http://www.nirvani.net/software - it has all sorts of functions for writing HTML forms easily and painlessly. I use it all the time now (shameless plug - my roommate wrote it a while back).

    --Joe

    On Fri, Apr 06, 2001 at 02:35:11AM +0200, Richard wrote: > You must set: > > <option>some text</option> > > > if it's a SELECT list. Use <input type="select" value="DEFAULT TEXT GOES > HERE"> to set an initialized text. > > Use .VALUE to check if it's empty or not... But beware, sometimes it forgets > the contents... If you would use the JavaScript "alert(text)" function... > > > - Richard > ""Joao Monteiro"" <absorbenthotmail.com> wrote in message > news:9aahf3$bph$1toye.p.sourceforge.net... > > when i edit variables with a form the ones wich are simple text get > > corrected ok, but the ones chosen from drop-down menus only get added to > > existing variables... > > what am i doing wrong? > > > > Thanx > > > > Joao Monteiro > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    /******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/

    attached mail follows:


    This is a good time for a quick lesson on just exactly what include/require actually does.

    The following two examples are exactly the same, in almost every way:

    === Example 1 ===

    example1A.php:

    <?php

    $greeting = "Hello";

    include("example1B.php");

    echo $greeting;

    ?>

    example1B.php:

    <?php

    $greeting .= " World!";

    ?>

    The output is "Hello World!", and that's all.

    === Example 2 ===

    example2.php:

    <?php

    $greeting = "Hello"; $greeting .= " World!";

    echo $greeting;

    ?>

    The output is "Hello World!"

    When you include a file it is almost exactly the same as if you went into the included file, cut out all the code, then went back into your first file and pasted it in.

    So what you can use an included file almost exactly as you would use a function, without declaring anything as global! But there are obvious reasons why functions are better than includes, but you probably know that ;)

    Example:

    first file:

    <?php

    $greeting = "Hello there";

    // Let's pretend these variables are actually set by someone POSTing data. $var1 = "Hi there"; $var2 = "Ho there"; $var3 = "Me there"; $var4 = "My there";

    include("include.php");

    echo $text;

    ?>

    include.php:

    <?php

    if ($var1) { $greeting .= ", " . $var1; } if ($var2) { $greeting .= ", " . $var2; } if ($var3) { $greeting .= ", " . $var3; } if ($var4) { $greeting .= ", " . $var4; }

    ?>

    Now you could do the exact same thing by just making the include file into a function. Or you could just paste it into your original file.

    But the output remainds the same, no matter how you slice it.

    QUESTION ANSWER:

    The following:

    > $sql = "..." > $result = ....; > include 'variables.php?table=$table';

    Can be like this:

    $table = "tablename"; $sql = "..."; $result = "..."; include ("variables.php");

    The values of $table, $sql, and $result will all be the same in variables.php as they are in your source file.

    Isn't that nice? Aren't you glad that I took 4 pages of text just to explain that single phrase? Shouldn't I get a pulitser for taking so little content and putting it into so much display? I should work for microsoft, shouldn't I?

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    ""Ashley M. Kirchner"" <ashleypcraft.com> wrote in message news:3ACCB1DC.C282F34Apcraft.com... > > I have a DB project going and every time I query the DB for data > from a particular table, I want to include a set of variables (that get > set based on the query result). I was thinking of doing something like > this: > > $sql = "..." > $result = ....; > include 'variables.php?table=$table'; > > However, every time I try that, it tells me it can't find > 'variables.php'. However, if I rename the file to 'variables.inc', it > does find it (though it doesn't pass any arguments to it then). > > The first method tells me it's not in the include path. Okay, > easily fixable in php.ini, however, I don't want this extra path info to > apply to the whole server (which is running several vhosts). How can I > adjust the include path just for this particular vhost? > > Or, is there a better way to do what I'm trying to accomplish? Make > it a function perhaps? A call that would look kinda like this perhaps: > variables($table) ? But then, how do I get to the actual variables? > > AMK4 > > -- > W | > | I haven't lost my mind; it's backed up on tape somewhere. > |____________________________________________________________________ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Ashley M. Kirchner <mailto:ashleypcraft.com> . 303.442.6410 x130 > SysAdmin / Websmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . eFax 248.671.0909 > http://www.pcraft.com . 3550 Arapahoe Ave #6 > .................. . . . . Boulder, CO 80303, USA > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Many people seem to sware that opening a direct connection to sendmail is faster than using the mail function, and often avoids errors more often.

    Your mileage may vary, but I gather that a direct connection is faster, though not by much so don't get too concerned, than using mail.

    So feel free to use either one.

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    ""PHP User"" <phpuserchek.com> wrote in message news:20010405214136.19903.qmailmeowmix.chek.com... > Would opening a direct connection to sendmail be a bad thing to do in terms of speed and server time? > Right now I loop through an array of email addresses, and just send them each out with mail() would something like this be better or worse in terms of the amount of time and resources it uses on the server? > > <? > function send_mail($to, $from, $subject, $body) { > $path_to_sendmail = "/usr/sbin/sendmail"; > $fp = popen("$path_to_sendmail -t", "w"); > $num = fputs($fp, "To: $to\n"); > $num += fputs($fp, "From: $from\n"); > $num += fputs($fp, "Subject: $subject\n\n"); > $num += fputs($fp, "$body"); > pclose($fp); if ($num>0) { return 1; } else { return 0; } } > ?> > > > ***************************************************************** > Sign up for these FREE offers and have the chance to win money and prizes! > Click Here http://winwith.chek.com/promotions.php3?partnerid=7" > ***************************************************************** > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Um...I think you could just use "global". As in:

    global $domain, $tld, $firstname, $lastname, $userid;

    Once a variable is declared global, any change to that variable inside the function is reflected outside of the function.

    So:

    function before_after () { global $var;

    echo $var . "<BR>";

    $var = "After";

    echo $var . "<BR>"; }

    $var = "Before";

    echo $var . "<BR>";

    before_after();

    echo $var . "<BR>";

    Hey, it is PHP. It's supposed to be simple ;)

    Unless of course I'm wrong in this untested example, in which PHP was designed to make you suffer agonizing pain and terror that strikes to the very depth of your soul.

    Or not.

    Because it does work.

    But there is one odd behavior I noticed.

    If you change a variable inside a function, then declare it global, declaring it global reverts it's value to what it was before the function adjusted it (when global is inside the function, that is).

    But if you first declare it global THEN change the value, it works as above. Kinda neet, I thought.

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    "Lindsay Adams" <lindsaydingos.net> wrote in message news:B6F24844.44CA%lindsaydingos.net... > On 4/5/01 3:56 PM, "Matt McClanahan" <cardinaldodds.net> wrote: > > > On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote: > > > >> Is there another way to write this I would like to make it smaller > >> also How would I write it so it is a function and I would be able to use all > >> the data throughout the whole program every time I try the rest of the > >> program does not see the data > > > >> $domain=$data[0]; > >> $tld=$data[1]; > >> $firstname=$data[2]; > >> $lastname=$data[3]; > >> $userid=$data[4]; > >> $passw=$data[5]; this part would like to make smaller > >> $email=$data[6]; > >> $package=$data[7]; > >> $frontpage=$data[8]; > >> $mysql=$data[9]; > >> $userdatabase=$data[10]; > >> $newuser =$data[11]; > >> $newuserpass =$data[12]; > > > > Use list() > > > > list($domain,$tld,$firstname,$lastname,$userid,.....) = $data; > > > > If you want to put it in a function, declare them all globals beforehand. > > > > function myfunc() > > { > > global $domain,$tld,$firstname,$lastname,$userid...; > > > > Matt > > Umm, you can add them to the global space this way. > Inside a function. > > $GLOBALS['domain']=data[0]; > $GLOBLAS['tld']=data[1]; > ... > > > Can't you? Everyone? > > Or you can pass as a reference in the last parameter of your function call, > the variable that you want returned as an array > > Function get_data($parm,$parm,&$array_parm) > > And set the values of $array_parm['variablename']=whatever > Inside the function, and return $array_parm at the end of the function call. > > So, if you called your function as > > get_data("somethinghere","somethingelse",$returned_array); > > $returned_array['domain'] will equal whatever $data[0] was > > But I think adding the variable to the GLOBAL array will work fine. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    "Lindsay Adams" <lindsaydingos.net> wrote in message news:B6EF483F.4115%lindsaydingos.net... > According to the headers in your email, you are using Outlook Express. > > I think it is a microsoft issue. Because when I write a long email in OE, > and send it to myself, I get it as an attachment. > > If I write it in Eudora, and pick up my mail with Eudora, it comes as one > message, no attachment, but if I check mail in OE, it suddenly adds the > message as an attachment. > > So, I don't think you can get around this with PHP functions, because I > doubt the issue lies there. > > On 4/3/01 3:50 AM, "Tom Pinder" <php_generalrenewable.co.uk> wrote: > > > I'm using PHP to send emails. The problem I have is that when the emails > > reach a certain length, the emails are sent with the email contents as an > > attachment, not as part of the body. > > > > I've looked thru all the mailing lists, but I can't find a reference to a > > similar problem. Has anyone come across this before? > > > > Is there is any way to control this behaviour? Is there a way of forcing > > mail() or imap_mail() to include the contents in the email body? > > > > imap_mail ($testAddress, $title, $emailContents, "from:userdomain.org.uk"); > > mail ($testAddress, $title, $emailContents, "from:userdomain.org.uk");

    The issue probably lies (as Lindsay said) in Outlook express, more accurately in the memo box type that is being used.

    Microsoft has a terrible habbit of (in their 'free' stuff atleast) using the Memo box (which has a limit of 32kb) for quick-view types of things. Anything over that and you'd see what you are.

    bkx

    attached mail follows:


    I know that to do this somehow ignore_user_abort should probably be set to true for the purpose of the script itself. Then something could be done...but I wonder along with you, is there a way to tell the client "That's all there is! stop waiting!"

    *scratches head*

    Perhaps the outbut buffer may be part of the answer?

    Perhaps PHP could use ob_start, then use ob_get_length to see how how much content must be sent.

    Then send a header with the content length, and clear the buffer. Could that perhaps make apache end the session? Or perhaps some socket use to forcefully close the connection, but that may make apache angry and create some errors...but then again, it probably wouldn't.

    This would answer all kinds of problems with mail() slowing down a script, or sleep() use, etc.

    Anyone have other theories or better yet, a solution? This would allow me to have _so_ much fun playing around with the possibilities, no matter how intensive it'd have to be.

    Does any other language have something exactly like this? Like Perl/C CGI, ASP, or JSP? Or is this purely a question of web-server support?

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    "Peter Kuppelwieser" <peter.kuppelwieserlimu.com> wrote in message news:01040622051504.23709pjotr... > Hello! > > I have an problem with on of our scripts, and some caching proxy servers > > the script produces output, then it does a flush(), > After this, the script does a sleep(10) and then it does a db-query without > producing html output. > > normally the browsers get the page after the flush() command > but on some proxy servers, the page is forwarded to the browser > only after the proxy server has terminated the connection to the apache > webserver (after the 10 secs). > > my question: > > Is it possible to terminate the tcpIP connection, before the php script ends? > (I think this would solve my problem) > Any other Ideas? > > Thank you, Peter Kuppelwieser > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    At 00:26 5/4/2001 -0500, Plutarck wrote: >http://www.php.net/manual/en/ref.outcontrol.php > >If you want to use output buffering you must use the ob_* family of >functions. > >In any script where you want it used you _must_ use it explicitly, or so do >in an included file. Unless you can change the php.ini, there is no way to >force all pages to use output buffering. I don't reccommend you do such a >thing anyway. > >If you aren't using output compression all it does is allow bad programming >practices. One exception is for hosting companies that want to force ads to >be displayed on the page with the auto_prepend type settings. > > >Output buffering should only be used if you have a specific reason for doing >so. Kind of like all PHP functions :) > >It doesn't cost much in performance except when a script pumps out a very >large amount of data. If you want to print a 10mb text file to the browser >it is a considerably _BAD_ idea to force PHP to buffer that all up into one >chunk before puking it out. > > >But, enter the gz_handler functions. If you want to compress your output, >then you have a reason for using output buffering. The cost in performance >varies widely, but if your server is already under a considerable load you >probably shouldn't use it. > >But it's very cool to use if you have the extra processor power, but wait >for 4.0.5 to do it. Many people complain about memory leaks and sub-standard >output buffering functions. It's supposed to all be fixed in the new >version, so feel free to play around with it :) > >Still, it's better to be able to set it only in the places you want it run >rather than making all output use it.

    exactly... I don't want to set this option to an entire site just because of one little script I'm having trouble setting a header() or setcookie()... and I wanna use them in the middle of the output... something like ASP's <% response.flush=true %>, it can be set anywhere u want... but of course... the best way is to code right and not to mess with headers once the output has started... but sometimes I wish I could, u know? It would really make somethings a lot simpler... ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer

    attached mail follows:


    I know what you mean. Until I decided to kill all but one single echo/print call, which is in a function I call at the bottom of the script, I often ran into problems where I needed to echo something at the top of a really really long control loop, but nested deep within it I had to set a cookie or use a redirect.

    Which is why I killed all my echo/print calls in favor of a single function which I include at the bottom of my script ;)

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    "Christian Dechery" <lemmingvento.com.br> wrote in message news:5.0.0.25.2.20010405225317.02404cd0pop-gw.vento.com.br... > At 00:26 5/4/2001 -0500, Plutarck wrote: > >http://www.php.net/manual/en/ref.outcontrol.php > > > >If you want to use output buffering you must use the ob_* family of > >functions. > > > >In any script where you want it used you _must_ use it explicitly, or so do > >in an included file. Unless you can change the php.ini, there is no way to > >force all pages to use output buffering. I don't reccommend you do such a > >thing anyway. > > > >If you aren't using output compression all it does is allow bad programming > >practices. One exception is for hosting companies that want to force ads to > >be displayed on the page with the auto_prepend type settings. > > > > > >Output buffering should only be used if you have a specific reason for doing > >so. Kind of like all PHP functions :) > > > >It doesn't cost much in performance except when a script pumps out a very > >large amount of data. If you want to print a 10mb text file to the browser > >it is a considerably _BAD_ idea to force PHP to buffer that all up into one > >chunk before puking it out. > > > > > >But, enter the gz_handler functions. If you want to compress your output, > >then you have a reason for using output buffering. The cost in performance > >varies widely, but if your server is already under a considerable load you > >probably shouldn't use it. > > > >But it's very cool to use if you have the extra processor power, but wait > >for 4.0.5 to do it. Many people complain about memory leaks and sub-standard > >output buffering functions. It's supposed to all be fixed in the new > >version, so feel free to play around with it :) > > > >Still, it's better to be able to set it only in the places you want it run > >rather than making all output use it. > > exactly... I don't want to set this option to an entire site just because > of one little script I'm having trouble setting a header() or > setcookie()... and I wanna use them in the middle of the output... > something like ASP's <% response.flush=true %>, it can be set anywhere u > want... > but of course... the best way is to code right and not to mess with headers > once the output has started... but sometimes I wish I could, u know? It > would really make somethings a lot simpler... > ____________________________ > . Christian Dechery (lemming) > . http://www.tanamesa.com.br > . Gaita-L Owner / Web Developer > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    While struggling to get MS SQL error messages from PHP, someone here gave me the idea of capturing the output when executing a query and even offered me the code (thanks again)... I tried, the code was correct, but nothing happened...

    I develop under Win98Me with Apache... but the script will run in Win2k with IIS...

    does any of the ob_*() function family works under Win9x, or just in UNIX and Win2k/NT? Is there a reasonable explanation for this?

    I see this as a real fault... means that nobody developing in Win9X platforms can get MS SQL error messages, or anything that needs some more of output handling, and not just relying on *_error() functions... ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer

    attached mail follows:


    I just tried it, and it seems to work like a charm on my Win98 machine (WAMP).

    So far I have no problems with output buffering on my machine. Test script:

    <?php function alter_buffer($buffer) { $buffer = ereg_replace("he", "MWUAHAHA", $buffer); return $buffer;

    }

    ob_start("alter_buffer"); echo "hi! "; echo "ho! "; echo "he! "; ob_end_flush(); ?>

    Should output:

    hi! ho! MWUAHAHA!

    So as far as I know, at very least version 4.0.4pl1 supports Windows. Haven't tried anything with the gzhandler yet, but I'm told it works fine as long as you are using the windows port of it.

    --
    Plutarck
    Should be working on something...
    ...but forgot what it was.
    

    "Christian Dechery" <lemmingvento.com.br> wrote in message news:5.0.0.25.2.20010405225835.00a35ce0pop-gw.vento.com.br... > While struggling to get MS SQL error messages from PHP, someone here gave > me the idea of capturing the output when executing a query and even offered > me the code (thanks again)... I tried, the code was correct, but nothing > happened... > > I develop under Win98Me with Apache... but the script will run in Win2k > with IIS... > > does any of the ob_*() function family works under Win9x, or just in UNIX > and Win2k/NT? Is there a reasonable explanation for this? > > I see this as a real fault... means that nobody developing in Win9X > platforms can get MS SQL error messages, or anything that needs some more > of output handling, and not just relying on *_error() functions... > ____________________________ > . Christian Dechery (lemming) > . http://www.tanamesa.com.br > . Gaita-L Owner / Web Developer > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    After about 4 or 5 posts asking for help with session_register() with no replies I finally got my array into session vars...

    I tried the manual, just not thoroughly enough