OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Mon Aug 05 2002 - 12:40:23 CDT

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

    php-general Digest 5 Aug 2002 17:40:23 -0000 Issue 1507

    Topics (messages 111145 through 111231):

    Function Troubles!
            111145 by: Dave at Sinewaves.net
            111151 by: Damian Harouff

    Re: MySQL performance question
            111146 by: Mirek Novak
            111176 by: Richard Lynch
            111184 by: Lars Olsson
            111198 by: John Holmes

    Re: Protect PHP coding
            111147 by: Zeev Suraski
            111148 by: Zeev Suraski
            111150 by: php . banana
            111182 by: lallous
            111195 by: Manuel Lemos
            111204 by: Geoff Caplan
            111206 by: Jim Jagielski
            111207 by: Chris Allen
            111231 by: Maxim Maletsky

    Re: Php manual
            111149 by: Jason Wong
            111189 by: George Nicolae

    Re: Problems with HTML forms and PHP. Please Help !!
            111152 by: Richard Lynch

    Re: ODBC under linux + PHP + Apache problem.
            111153 by: Richard Lynch

    Re: mktime() question
            111154 by: Richard Lynch

    Re: include hassle
            111155 by: Richard Lynch

    Re: FATAL: emalloc(): Unable to allocate -83128 bytes
            111156 by: Richard Lynch

    Re: Reading in contents of URL
            111157 by: Richard Lynch

    Re: string questions
            111158 by: Richard Lynch

    Re: HELP with fOpen
            111159 by: Richard Lynch

    Re: wonder why php as apache module can work with virtual host
            111160 by: Richard Lynch

    Re: share librearies from repository
            111161 by: Richard Lynch

    Re: Vars passed via URL disappearing
            111162 by: Richard Lynch

    Re: php backtraces with gdb print gibberish for function name
            111163 by: Richard Lynch

    Re: File Phrasing & Mark-ups
            111164 by: Richard Lynch

    Re: virtual hosting using php as apache module
            111165 by: Richard Lynch

    Re: RegEx (back referencing)
            111166 by: Richard Lynch
            111201 by: Phil Ewington

    Re: PHP and multiple page .tiffs
            111167 by: Richard Lynch

    Re: __functionName?
            111168 by: Richard Lynch

    Re: register_argc_argv
            111169 by: Richard Lynch

    Re: parse_str () problems. using on the command line args ( argv[1]) - problem with php-4.2.2 ??
            111170 by: Richard Lynch

    Re: which function can do so ?
            111171 by: Richard Lynch

    Re: mysql_connect
            111172 by: Richard Lynch

    Re: PHP/MySQL Error Log Parser
            111173 by: Richard Lynch

    Re: Upgraded to 4.2.2 on Win2k - server (including ASP) crashing
            111174 by: Richard Lynch

    Re: defining separate form element within While statment
            111175 by: Richard Lynch

    Re: Mkdir!
            111177 by: Richard Lynch
            111190 by: lallous

    Re: Referencement
            111178 by: Richard Lynch

    Re: Form variable to PHP script problems
            111179 by: Richard Lynch

    Re: detecting links in strings
            111180 by: Richard Lynch
            111183 by: lallous

    Re: Passing varibles
            111181 by: Richard Lynch

    Re: Undefined function: dbmopen() in loaded Windows binaries of PHP 4.2.1
            111185 by: îÅÎÁÛÅ× éÌØÑ îÉËÏÌÁÅ×ÉÞ

    random data from mysql db
            111186 by: tux
            111187 by: Richard Black
            111188 by: George Nicolae
            111193 by: Justin French
            111194 by: Peter Janett

    Re: PHP4 and MySql - Search Results Question?
            111191 by: George Nicolae

    help with mail() function
            111192 by: rdkurth.starband.net
            111196 by: Manuel Lemos

    htpasswd in link
            111197 by: adi
            111200 by: Bas Jobsen

    Re: [PHP-DB] Re: [PHP] MySQL performance question
            111199 by: Andrey Hristov

    Help needed after upgrading to PHP4
            111202 by: Tony Burgess
            111203 by: Mirek Novak
            111205 by: . Edwin
            111209 by: Kondwani Spike Mkandawire
            111212 by: Ashwin Kutty
            111213 by: Matt

    Oracle Question....
            111208 by: Tim Nields
            111211 by: . Edwin
            111214 by: Kondwani Spike Mkandawire
            111216 by: Kondwani Spike Mkandawire
            111218 by: . Edwin

    Here's the workaround to assign data from XML tag into array!
            111210 by: Scott Fletcher

    Re: HELP! Problem configuring PHP
            111215 by: Sameh Attia

    Sessions
            111217 by: Chris Morrow
            111224 by: Johnson, Kirk

    Re: PHP4 and MS Excel?
            111219 by: Sameh Attia

    picture editing
            111220 by: olev rumm
            111221 by: Matt

    mkdir in safe-mode
            111222 by: Kai

    session problems
            111223 by: B i g D o g

    String parsing and Array sorting
            111225 by: Geoff Hankerson

    PERL to PHP problem
            111226 by: Andy Woolley

    file uploads problem
            111227 by: George Liao

    simplify statement
            111228 by: Jim Long
            111229 by: Andy Woolley

    Re: Text Format ALL GONE ??!!
            111230 by: Jerry

    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:


    I'm having trouble with a function I've been working on - I can't seem to
    get the learn() function to trigger! Is there a flaw in my logic?

    Here's my code:

    <?
    function damn_it_all_to_hell($poster, $anotherpost)
    {
            if ( is_constructive($anotherpost) )
            {
                    echo $anotherpost;
                    if(strpos($anotherpost, 'answer'))
                    {
                            learn(); // <-- this is where my problems are
                    } else {
                            teach();
                    }
            }

            if ( is_worthless($anotherpost) || strpos($anotherpost, $complaint) )
            {
                    block_poster($poster);
                    unset($anotherpost);
                    die;
            }
    }

    damn_it_all_to_hell($this_poster, $this_message);

    ?>

    Your words and actions will either encourage, educate, and entertain, or
    discourage, mislead, and depress. The former has always worked better for
    me.

    Dave

    p.s. - I know this isn't the philosophy list, but see damn_it_all_to_hell()
    above for a useful function.

    attached mail follows:


    Perhaps to try strstr instead of strpos?

    http://www.php.net/manual/en/function.strstr.php

    DaSn> I'm having trouble with a function I've been working on - I can't seem to
    DaSn> get the learn() function to trigger! Is there a flaw in my logic?

    DaSn> Here's my code:

    DaSn> <?
    DaSn> function damn_it_all_to_hell($poster, $anotherpost)
    DaSn> {
    DaSn> if ( is_constructive($anotherpost) )
    DaSn> {
    DaSn> echo $anotherpost;
    DaSn> if(strpos($anotherpost, 'answer'))
    DaSn> {
    DaSn> learn(); // <-- this is where my problems are
    DaSn> } else {
    DaSn> teach();
    DaSn> }
    DaSn> }

    DaSn> if ( is_worthless($anotherpost) || strpos($anotherpost, $complaint) )
    DaSn> {
    DaSn> block_poster($poster);
    DaSn> unset($anotherpost);
    DaSn> die;
    DaSn> }
    DaSn> }

    DaSn> damn_it_all_to_hell($this_poster, $this_message);

    ?>>

    DaSn> Your words and actions will either encourage, educate, and entertain, or
    DaSn> discourage, mislead, and depress. The former has always worked better for
    DaSn> me.

    DaSn> Dave

    DaSn> p.s. - I know this isn't the philosophy list, but see damn_it_all_to_hell()
    DaSn> above for a useful function.

    attached mail follows:


    Hi,

       I think, that the first one is (theoretically) faster, because (IMHO) query is executed from left to right ... Even I don't
    know how it works internally it seems (to me :) ) clear from syntax rules
      1. SELECT data according to WHERE clause
      2. apply sorting
      3. apply limit

    HTH
    Mirek

    --
    Lars Olsson wrote:
    > Hi all!
    > 
    > Sorry for being slightly off topic, but this list seems to have it's 
    > fair share of MySQL gurus... :-) Anyway, here's my question:
    > 
    > Suppose I create a table (called table1) which has a field with only 
    > unique values (called id). Now suppose this table has some rows and that 
    > I want to select ONE of them. I usually do this:
    > 
    > "SELECT * FROM table1 WHERE id=somevalue"
    > 
    > Since id is a unique value this can only return (at most) 1 row. Now 
    > let's try this:
    > 
    > "SELECT * FROM table1 WHERE id=somevalue LIMIT 1"
    > 
    > This query will produce exactly the same result as the first query. But 
    > which one (if any) of the two queries are the most efficient? Is it
    > 
    > a) The first one, since it's a less complicated SQL query (less time to 
    > parse)
    > b) The second one, since it will restrict MySQL from searching further 
    > whenever a row is found
    > 
    > Any opinions?
    > 
    > /lasso (lassolassoweb.nu)
    > 
    > 
    

    -- -- Mirek Novak Anima Publishers CMS development

    http://www.auto.cz http://www.formule1.cz

    jabber:mireknjs.netlab.cz ISEEKYOU:1<one>9<four>9<nine>44<eight> GEsEm:+420603807838

    attached mail follows:


    >Hi all! > >Sorry for being slightly off topic, but this list seems to have it's >fair share of MySQL gurus... :-) Anyway, here's my question: > >Suppose I create a table (called table1) which has a field with only >unique values (called id). Now suppose this table has some rows and that >I want to select ONE of them. I usually do this: > >"SELECT * FROM table1 WHERE id=somevalue" > >Since id is a unique value this can only return (at most) 1 row. Now >let's try this: > >"SELECT * FROM table1 WHERE id=somevalue LIMIT 1" > >This query will produce exactly the same result as the first query. But >which one (if any) of the two queries are the most efficient? Is it > >a) The first one, since it's a less complicated SQL query (less time to >parse) >b) The second one, since it will restrict MySQL from searching further >whenever a row is found

    Try it and see.

    MySQL has a very nice 'explain' (?) or something like that built-in which will analyze your queries and tell you more than you ever wanted to know about their efficiency. http://mysql.com

    Note that you didn't say whether you had made an index (aka key) for this column, which may affect your answer.

    Also note that you're wasting your time with this question unless you have a *LOT* of rows. I mean a *LOOOOOOT* of rows. Try it and see.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    Richard Lynch wrote: > > > Try it and see. > > MySQL has a very nice 'explain' (?) or something like that built-in which > will analyze your queries and tell you more than you ever wanted to know > about their efficiency. http://mysql.com > > Note that you didn't say whether you had made an index (aka key) for this > column, which may affect your answer. > > Also note that you're wasting your time with this question unless you have a > *LOT* of rows. I mean a *LOOOOOOT* of rows. Try it and see. >

    Cool. I didn't know about the explain command. Thanks a lot, Richard (and all else who answered)!

    /lasso (lassolassoweb.nu)

    attached mail follows:


    I'm sure it's the first one. Look up the BENCHMARK() function in the manual and see which one is faster. (MySQL manual, btw)

    ---John Holmes...

    > -----Original Message----- > From: Lars Olsson [mailto:lassolassoweb.nu] > Sent: Sunday, August 04, 2002 4:28 PM > To: php-generallists.php.net > Subject: [PHP] MySQL performance question > > Hi all! > > Sorry for being slightly off topic, but this list seems to have it's > fair share of MySQL gurus... :-) Anyway, here's my question: > > Suppose I create a table (called table1) which has a field with only > unique values (called id). Now suppose this table has some rows and that > I want to select ONE of them. I usually do this: > > "SELECT * FROM table1 WHERE id=somevalue" > > Since id is a unique value this can only return (at most) 1 row. Now > let's try this: > > "SELECT * FROM table1 WHERE id=somevalue LIMIT 1" > > This query will produce exactly the same result as the first query. But > which one (if any) of the two queries are the most efficient? Is it > > a) The first one, since it's a less complicated SQL query (less time to > parse) > b) The second one, since it will restrict MySQL from searching further > whenever a row is found > > Any opinions? > > /lasso (lassolassoweb.nu) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    At 03:51 05/08/2002, Maxim Maletsky wrote: >I am sorry, Manuel, but with all my respect to you - I personally see >this thread as your personal disagreement with the project's management >based on the experience you had. And, I'd like to stop it at this very >point.

    Well-put, Maxim. If interested, you should also take a look at earlier post from around 1999 or 2000, where I was actually naive enough to back Mr Lemos when he was fighting Rasmus for CVS access. Surprisingly (or not), the dirt he was throwing at him was remarkably similar to the dirt he is now throwing at me. Of course, Rasmus didn't have a commercial venture, but the dictatorship accusations were pretty much identical. If I'm not mistaken, I'm to blame for the fact Manuel has CVS access in the first place, which almost outweighs all the good things I've done for PHP :(

    By the way, yes, I was the one who removed Mr Lemos's access to lists.php.net, as a service to the php-dev community. As it was done without enough prior discussion (only discussion on an online forum, instead of a discussion on the PHP Group forum), it was later discontinued, not before Mr Lemos assured us that he's going to disappear from php-dev from his own 'free' will. I do not regret removing Mr Lemos's access at all - as you can probably tell now, he's wasting hours and hours of otherwise productive time; I do regret not passing this decision through the proper channels prior to executing it, because then it would have stayed, whereas now, we still have to suffer from his abusive thread hijacks.

    Zeev

    attached mail follows:


    At 06:30 05/08/2002, Mark Charette wrote: >Sure it was. You brought up the numbers to prove a point - to bolster your >side with a rhetorical question, but the numbers are suspect; they don't >tell us how _useful_ the classes are. In my case, the classes I looked at >left too much to be desired to be useful, but perhaps other classes on there >_are_ useful - I just didn't need them at the time. You've created a >repository - for that I thank you - but to imply that the number of visits >or downloads or subscribers = the number of people actually using the >classes is disingenuous at best.

    Sure Mark, he's not pretending to have 75,000 users. That's where the "30,000 *REAL* users" fit in. Try http://www.landonize.it/users/sterling if you have no idea what I'm talking about (I am cynical, of course).

    By the way, other than being a developer who's of course envious of Mr Lemos' tremendous success, Sterling is also the developer behind some of the most important XML work in PHP, CURL module, flash module, some compression modules and lots of all around work, and that's while being about half the age of Mr Lemos. Yes, he has a reason to be envy of Mr Lemos, no doubt.

    attached mail follows:


    humans ARE capable of working together for the greater good. How are we to know for sure if we don't stick to our projects to the end, life is short as it is, let's just get on with our missions, please.

    R>

    _____-____----_______________ SKEE was here...

    attached mail follows:


    > > any windows version of this product? > > AFAIK, you compile it for Windows. I was also told that is a major headache. > Anyway, don't despair, it seems that some developers are working on > providing already compiled PECL extensions that can be automatically > downloaded. Good! Is there is anyway that I can be notified when such product exists?

    Regarding to paying for Zend Encoder or not: Personally, I respect every product and its price. If I am going to make benefit of what I wrote and what I want to protect then Zend Encoder is worth its price. But If I'm still not able to sell scripts and make good benefit, I'ld then use free encoders.

    Elias

    attached mail follows:


    On 08/05/2002 03:33 AM, Zeev Suraski wrote: > At 06:30 05/08/2002, Mark Charette wrote: > >> Sure it was. You brought up the numbers to prove a point - to bolster >> your >> side with a rhetorical question, but the numbers are suspect; they don't >> tell us how _useful_ the classes are. In my case, the classes I looked at >> left too much to be desired to be useful, but perhaps other classes on >> there >> _are_ useful - I just didn't need them at the time. You've created a >> repository - for that I thank you - but to imply that the number of >> visits >> or downloads or subscribers = the number of people actually using the >> classes is disingenuous at best. > > > Sure Mark, he's not pretending to have 75,000 users. That's where the > "30,000 *REAL* users" fit in. Try

    Oh, now that explains why you keep mentioned that figure.

    I would like to apologise to not have had time to update the banner. The 30,000 image was updated for the last time on 2001-03-26 . You may find the current figures here:

    http://www.phpclasses.org/browse.html/statistics/statistics.html

    If you are not logged in, you will be redirected to the mirror choice page. Oh, BTW, the site is so successful, that it has now 33 activated mirrors around the world, although near 50 have been requested. I still have to make time to approve them all.

    I don't control the mirror sites. They are managed by people that really wanted to host mirrors of them and it is always good cooperate with them all.

    Are you going to be envious of this too? No?

    If you are willing to host a mirror, feel free to request it in this page, I promise that I will treat you fairly like every other mirror host.

    http://www.phpclasses.org/mirrors.html?mirroring=1

    > http://www.landonize.it/users/sterling if you have no idea what I'm > talking about (I am cynical, of course).

    When you grow up you will realize the image of imaturity you are passing of yourself and the Sterlings of the world.

    > By the way, other than being a developer who's of course envious of Mr > Lemos' tremendous success, Sterling is also the developer behind some of > the most important XML work in PHP, CURL module, flash module, some > compression modules and lots of all around work, and that's while being > about half the age of Mr Lemos. Yes, he has a reason to be envy of Mr > Lemos, no doubt.

    Coding seems to be the only good things that you kids should be doing because when it comes to maturity it certainly explains why you haven't yet graduated from high school. :-)

    Seriously Zeev, how much do you want to aggravate the image of imaturity that you already passed to everybody?

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    Hi folks

    Just a comment to Manuel and Acer about basic netiquette.

    Your points will never get a fair hearing if you are downright rude and abusive to people who have invested years of their lives creating the platform which we all use for free. Key contributors like Zeev and Rasmus surely deserve more respect.

    That doesn't mean that they are always right or that we can't disagree with their views, provided we make courteous and well-founded points. But if you make personal attacks on people whose contributions we all appreciate no-one will take you seriously. The community will naturally rally to the defense of Rasmus and Zeev, and you will merely end up with unproductive flames such as this thread.

    Like most of the list, I suspect, I find the tone of your comments decidedly distasteful. So please - make you points by all means, but make them in a more civil manner.

    -- 
    Geoff Caplan
    Advantae Ltd
    

    mailto:geoffadvantae.com http://www.advantae.com

    attached mail follows:


    At 9:37 PM -0300 8/4/02, Manuel Lemos wrote: >Hello, > >On 08/04/2002 07:43 PM, Jim Jagielski wrote: >>>Not you, I meant Zeev presents lame excuses to avoid the subject of accepting an Open Source cache extension in PHP. At that time, other PHP Group core developers remain conviniently quiet. >> >>Maybe, just maybe, the whole history of how APC came about would be >>illuminating to people... especially how it relates to the Zend >>Cache (as it was called then). At the core is the question, how well >>and how much should you trust someone who ignores a NDA? Do people >>know that CC was actually *beta testing* the Zend Cache, under NDA. >>And less than 1 month after they stopped testing the Cache, APC was >>announced and released to the world? Does that sound like a weird >>thing to people? Using a sneak peak in such a devious way? And then >>to wrap such behavior up in the cloak of "Open Source" and "free for >>all." >> >>And I better not hear anyone question by standing on Open Source in >>all this... I will ignore such clueless responses. > >Jim, just one question, if somebody broke a NDA, where is the lawsuit that would have happened? APC code is public. Did anybody demonstrate that it was developed with code or knowledge acquired during Zend Cache beta-testing? >

    Maybe because such a (justified) suit would have looked very very bad to Zend, and clueless boneheads would have seen it as an attempt to "stop an open source alternative" rather than a cut-and-dried legal matter. Zend always knew and expected that open source alternatives would exist (if not, then there's no "market" for a product).

    But if you think that whereas the 2 main authors and architects of the Zend Engine took *several* months to create the Cache, developing, testing, tuning, and some "other guys" were able to do the same thing in a month makes logical sense, well,... so be it.

    -- 
    ===========================================================================
       Jim Jagielski   [|]   jimjaguNET.com   [|]   http://www.jaguNET.com/
          "A society that will trade a little liberty for a little order
                 will lose both and deserve neither" - T.Jefferson
    

    attached mail follows:


    ----- Original Message ----- From: "Andrey Hristov" <ahristovicygen.com> To: <php-generallists.php.net> Sent: Saturday, August 03, 2002 7:16 AM Subject: Re: [PHP] Re: Protect PHP coding

    > The people for Zend have to eat to live. > People, if there is no Zend there is no core for PHP. This is the same as > with MySQL. MySQL is free under GPL > but has no subselects because the companies that has commercial licenses > didn't wanted that - Monty has > to eat and he codes other features.

    As always this advice below is open-source and GPL'd.

    IF mysql required me to buy it just so I can use subselects I would not buy it....and I would take a beating from my friends for using sub-selects. =>

    Furthermore, if PHP, which I have been around since RASMUS first made it available, was to require that I needed some module which cost me or my company alot of money I would be looking for a new tool. I dont know if Zeev and Rasmus talk about this but what happens when ZEND and PHP come to odds? IE ZEND wants to charge for the code? Hell, Im not against anyone making some money or even get filthy stinkin rich but I dont want to pay $3,000 for php. I'd pay $50 a year though. I'd pay $50.00 USD for the zend encoder and core php. I'd pay $100.00USD if I could get a say (vote) on which new features are a good idea.

    >. I just want the people from Zend to continue > their tremendous work and > we will have PHP5 and PHP6 and so on otherwise start learning ASP or JSP.

    And if they dont continue I will go back to perl....there are always alternatives toASP?JSP junkbox ..

    -ccma

    attached mail follows:


    check this out:

    http://landonize.it/?how=url&theme=classic&url=http%3A%2F%2Fphpbeginner.com& filter=Manuel+Lemos&user=sterling

    isn't it fun? ... :-)

    maxim

    Zeev Suraski writes:

    > At 06:30 05/08/2002, Mark Charette wrote: >> Sure it was. You brought up the numbers to prove a point - to bolster >> your >> side with a rhetorical question, but the numbers are suspect; they don't >> tell us how _useful_ the classes are. In my case, the classes I looked at >> left too much to be desired to be useful, but perhaps other classes on >> there >> _are_ useful - I just didn't need them at the time. You've created a >> repository - for that I thank you - but to imply that the number of >> visits >> or downloads or subscribers = the number of people actually using the >> classes is disingenuous at best. > > Sure Mark, he's not pretending to have 75,000 users. That's where the > "30,000 *REAL* users" fit in. Try http://www.landonize.it/users/sterling > if you have no idea what I'm talking about (I am cynical, of course). > > By the way, other than being a developer who's of course envious of Mr > Lemos' tremendous success, Sterling is also the developer behind some of > the most important XML work in PHP, CURL module, flash module, some > compression modules and lots of all around work, and that's while being > about half the age of Mr Lemos. Yes, he has a reason to be envy of Mr > Lemos, no doubt. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On Monday 05 August 2002 13:33, Ian Ball wrote: > Look at http://www.php.net/download-docs.php. There are several options > for several different languages. I have taken the many html files tar.bz2, > extracted to a directory in /usr/share/doc/PHP and made a bookmark to > /usr/share/doc/PHP/index.html > > On Sunday 04 August 2002 02:20, support-botsaudiabm.net wrote: > > Where can I download the php manual with the user notes (in html format)

    I don't think you can download the php manual WITH the user notes.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* The truth is rarely pure, and never simple. -- Oscar Wilde */

    attached mail follows:


    The true is: - you CAN'T download the HTML manual WITH user notes. - you CAN downloat the HTML manual WITHOUT user notes at http://www.php.net/download-docs.php - you CAN download the CHM version WITH user notes at http://weblabor.hu/php-doc-chm

    --
    

    Best regards, George Nicolae IT Manager ___________________ PaginiWeb.com - Professional Web Design www.PaginiWeb.com

    "Jason Wong" <php-generalgremlins.com.hk> wrote in message news:200208051452.24870.php-generalgremlins.com.hk... > On Monday 05 August 2002 13:33, Ian Ball wrote: > > Look at http://www.php.net/download-docs.php. There are several options > > for several different languages. I have taken the many html files tar.bz2, > > extracted to a directory in /usr/share/doc/PHP and made a bookmark to > > /usr/share/doc/PHP/index.html > > > > On Sunday 04 August 2002 02:20, support-botsaudiabm.net wrote: > > > Where can I download the php manual with the user notes (in html format) > > I don't think you can download the php manual WITH the user notes. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > The truth is rarely pure, and never simple. > -- Oscar Wilde > */ >

    attached mail follows:


    >Hi! i have instaled PHP 4.2.2 in a slack 8.1 running apache 2.0.39. >i have a proble with a very basic script (pass variables to a php >script). Is seems not recieve variables, because print somthing like this: > >Your first name is . >Your last name is . >Your E-mail address is . >This is what you had to say: > >In the server log say the variables appear don´t exist. >Here i send this windows files (i try in XP with iis 5.1 and PJP 4.2.2 >and is the same problem) to help you to help me :) >ah! php is working because i test the <? phpinfo(); ?> stuff and works !!!

    Use $_POST['foo'] instead of $foo

    Read the zillion posts/articles/bug-reports about register_globals

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I have no warnings trying to find DSN, but now nothing happens. I suppose >that it finds dsn but there is another error somewhere. But there is no >logs, there is no output in the browser... i dont know what to do, i have > >this is the reply from the browser; >The following error was encountered: >Zero Sized Reply >Squid did not receive any data for this request. > >this is my code: ><html>^M ><title>REGISTRO DE LLAMADAS</title>^M ><body >^M ><?php >putenv("ODBCINSTINI=/etc/odbcinst.ini"); >putenv("ODBCINI=/etc/odbc.ini"); >if(!extension_loaded('odbc')) >{ > if(!dl("odbc.so")){ > exit;

    The preceding line would cause the exact behaviour you describe.

    Try die("Could not load odbc.so") instead of exit;

    > } >} >echo "dl odbc loaded ok<br>"; >$cx=odbc_pconnect("cdr2","mylogin","mypasswd",""); >echo "connected"; >?> ></body> ></html> > > > > >thanks in advance!

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Good morning! > >I need to subtract months by their abbreviated month name, so shouldn't this >work? > >print(date("M", mktime(date("M")-$i)); > >and if I loop; > >Aug >Jul >Jun >May >........

    Try it and see?

    Almost for sure you need 'm' on the second date(), though.

    You can't expect ('Aug' - 1) to be meaningful.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I have this: > >//file1.php ><? >include('../libs/lib1.php'); >.. >.. >.. >?> > >now lib1.php: ><? >include ('helper.php'); >?> > >If i run file1.php ->includes lib1.php -> fails to include helper.php ! ! > >how can i solve that? > >p.s: currently, i'm chdir()ing to the ../libs path, then i return to current >dir...

    Don't even try to keep track of where you are in the directory path and use relative dirs when you are doing includes. That way lies madness.

    >my code cannot make use of Apache's help. (like setting the include path >inside .htaccess)

    Why not?

    If you can't edit php.ini and you don't have .htaccess turned on, you're going to find yourself ham-strung even after you solve this one...

    That said, the solution if you really are stuck with no .htaccess is to just use a full path name from the root of the hard drive.

    Oooooh. You can also set the include_path from *inside* your PHP script with http://php.net/ini-set

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I get the error msg mentioned above when I use the ereg() function. >What is it, that I don't know?

    Your code is attempting to ask PHP for a string *SOOOOOO* large that it's beyond 2 billion bytes long...

    Either your Regex is just broken, or it's trying to do something that just can't be done within the physial limitations of the RAM available.

    Post your Regex. I won't be able to fix it (I suck at Regex), but somebody will.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >1. read in the contents of a URL. >2. get the content-type >3. set the content type for the response >4. write the contents of the URL to the response. > >here is what i have thus far: > >$dataURL = "http://www.foo.com/data.xml"; >$fp = fopen($dataURL, "r"); >$content = fread($fp, true); >echo($content); >fclose($fp); > >I am running into two problems. One, the second param for fread takes >the size of the file / content. how do i get this?

    You don't.

    Actually, if you can get the headers, and *IF* the headers are kosher enough to tell you the Content-length:, and if that number is actually correct, you would know how many bytes.

    *BUUUUUT* I sure wouldn't trust every web-server on the planet to correctly output the Content-length: anyway, so that's out.

    Your choices are:

    1. Use http://php.net/eof and a loop to figure out when there's no more HTML coming. 2. Assume every URL has a reasonable amount of data and just use http://file

    >there is a comment at: >http://www.php.net/manual/en/function.fread.php > >which says to just specify a constant and it will work, but what ever >number i specify, that is the amount of data that is read. > >how do i retrieve the content type?

    Assuming you're not running 4.3.0 from CVS and http://www.php.net/manual/en/function.file_get_wrapper_data.php is not helpful, you're stuck with doing something like this:

    <?php $sock = fsockopen('example.com', 80) or die("Could not open socket to example.com"); fputs($sock, "GET /whatever.html HTTP/1.0"); # Might need \n on the end... fputs($sock, "Host: example.com"); # In case it's virtual hosting. fputs($sock, ""); # MUST send blank line before output will occur! # The end of headers is indicated by a blank line: $inheaders = true; $headers = ''; while ($inheaders && !feof($sock)){ $line = fgets($sock, 4096); # Any header over 4K in length will screw this up... if ($line){ $headers .= $line; # You could also parse the headers looking for Content-type: and so on. # But you should *NEVER* assume that other stupid web-server is going to bother to tell you... # Much less tell you correctly. # If it doesn't say, it's supposed to be text/plain... # But stupid IE looks at the URLs and uses them anyway, so Good Luck! } else{ $inheaders = false; } } $content = ''; while (!feof($sock)){ $content .= fread($sock, 4096); # If you expect to suck down HUGE pages, increase this... } ?>

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I know there has to be an easy way to do this, but I just can't find the >answer. I need to strip out the first part of a text string. I've >figured out out to strip out the last part of a string using the >following: > >$address = (4455 N. 45th St.); > >$test = strstr($address, " "); >echo $test; > >The variable $test returns N. 45th St. without the 4455. Is there a way >to reverse this so I can just return 4455?

    $position = strpos(' ', $address); # Or is it strpos($address, ' '); ? $number = substr($address, 0, $position);

    http://php.net/strpos http://php.net/substr

    WARNING: There *ARE* addresses like: '324 1/2 West Main Street' out in the real world...

    Or even '221 B Baker Street' :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >No lock in the archives, so here it goes... >Greetings all, I am using fOpen to try and create a new file in a local >directory on a remote server.

    I'm confused...

    What's "a local directory on a remote server"?

    Is PHP on the same computer as the file you are trying to create? If not, it ain't gonna work, no matter what the permissions of the directory on the other computer.

    Show us source code.

    >Each time I run my script is says "PERMISSION >DENIED" but the sys admin swears the entire directory is set to 777.

    SysAdmins are frequently wrong :-)

    Can you use FTP and/or SSH to see for yourself?

    >Does anyone know if a setting has to be set in PHP for dynamic file >creation to take place? >I can use fOpen to read a file, I just cant write without the above error. > >Please, any help is appreciated, my deadline is looming.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I dunno why some webhosting company can do virtual host by php as apache >module. That means they seem to work fine with the virtual host uid/gid >permission when using php. But they use php as apache module....how do >to that ??

    Basically, PHP is running as the same User as Apache, which is defined by User in httpd.conf

    This User (unless you're an idiot) is 'nobody' or some similarly under-powered user.

    Any files PHP has to read/write/execute must thus be allowed that access to 'nobody' (or whatever User is set to) for it to be possible.

    It is also possible to set up PHP as a CGI wrapped by suExec (don't do both suExec and safe mode -- won't work) and then have suExec run PHP as a specific user. Once you've worked out that wrinkle, it's pretty trivial to wrap the suExec around PHP CGI differently in each VirtualHost block, and give your PHP users the best of both worlds. My host does this, and I thank him for it, oh, every month or so :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I wrote my classes with php where I defined my objects, then I created my >repository in /usr/share/php , in this directory are my clasess. >Now, from my directory web I like to call to my classes, then I modified my >php.ini (/etc/php.ini) and inserted this line, in the option "Paths and >Directories" > include_path = ".:/usr/share/php" >and restart apache. >In my page index.php I call to my class with this form > <? > include ("plantilla.class") > ?> >But when I like to see my page I have two message: >1) Warning: Failed opening 'plantilla.class' for inclusion >(include_path='.:/usr/share/php')in /usr/local/httpd/htdocs/index.php on >line 2

    Did you spell it right? :-) What permissions are on the file plantilla.class?

    If it's not world-readable (or at least readable by PHP's User set in httpd.conf) then it can't be read.

    >2)Fatal error: Cannot instantiate non-existent class: pagina in >/usr/local/httpd/htdocs/index.php on line 3

    This is a direct result of 1.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I thought register_globals only affected session, cookie and get type >variables? Why is PHP ignoring the variables passed via the URL?

    variables passed by the URL *are* GET variables.

    register_globals also affects POST variables.

    Pretty much, it affects *ALL* variables coming in from the outside world -- the big, bad Internet.

    Use $_GET['foo'] instead of 'foo'

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I have have a PHP script that is core dumping, I'm trying to find out >exactly where. I carefully followed the instructions on > >http://bugs.php.net/bugs-generating-backtrace.php > >with a little help in creating an apache debug build using: > >http://www.bowiesnyder.com/writings/gdb_apache.htm > >however, when I get to the end bit where it's supposed to print out the >function that was causing the seg fault (I've already typed "frame x" >where x is the lowest-numbered execute() call), I get crap: > >(gdb) print (char >*)(executor_globals.function_state_ptr->function)->common.function_name >$2 = 0x83a2be0 "´\221/\b\024àJ\bÜï[\b´ì0\b" > >where it should say, according to the bugs.php.net page above, something >like: > >(gdb) print (char >*)(executor_globals.function_state_ptr->function)->common.function_name >$14 = 0x80fa6fa "pg_result_error" > >I can't find any docs anywhere on what else I can ask executor_globals >for... getting executor_globals.active_op_array->function_name returns >one of my functions, but that's not terribly useful without knowing what >line of it caused the segfault. > >Any suggestions for futher probing?

    Quite possibly, whatever went wrong has so corrupted the stack and such-like that what you are seeing is what's there.

    While it is gibberish, it's meaningful gibberish :-)

    Somebody somewhere might be able to interpret it.

    Your best bet at this point is to post the gdb output to http://bugs.php.net with the smallest/shortest PHP script you can make that causes it.

    But first, check *VERY* carefully the version numbers of the software you're using and that PHP thinks you are using:

    Example: If <?php phpinfo();?> says you are using MySQL 3.22.34 but on the command line mysql -v says you are using 3.22.32 you are in trouble.

    It will "work" okay, sorta, kinda, maybe, until you happen to try to use the function[s] that change between 3.22.34 and 3.22.32 and then it blows up in your face like above...

    It could easily be "before" the actual breaking-point of your script, so check *ALL* the software involved in your script and/or make a shorter script to narrow your focus.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >A function I have written to accept filenames, read it and phrase it's mark >ups. Is the second function of one line file a good idea ?

    Yes, but why do the loop in PHP? $fa = file($file); $output = implode('', $fa); return $output;

    > Is there an >alternative ? Can problems arise if the size of the file being phrased is >very large ?

    Yes, of course.

    The real question is "How large is very large?"

    There are two possible limitations:

    1. There is a setting in php.ini called, I think, memory_limit 2. There is only so much RAM/swap available on your machine. PHP will cheerfully use all that's there (and not already used), but after you hit that limit, there's not a whole lot PHP can do...

    Will your files every *REALLY* be that large?

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Hi everybody, > I would like to know how to make the directive user/group in ><virtualhost> working with php. I prefer to use php as modules but not >cgi, as it is more handy and easy for upgrade. How to do that ? >Thx !

    User/Group do not work in a VirtualHost block. This is a limitation of Apache which has nothing whatsoever to do with PHP. Well, obviously, it affects PHP, but PHP has no control over this...

    Apache 2.x *does* allow for User/Group (or something like them) to be done on a VirtualHost or Directory block basis.

    If you *NEED* this badly enough, you could jump to the bleeding edge and run Apache 2.x... Not recommended for Production servers at this time.

    See previous response to your differently-worded question for alternatives.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Hi, > >I am am writing a function to color code and indent JavaScript source using >regular expressions and cannot seem to get back referencing working. The >pattern match is successful but the output is a single unrecognised >character (a square). > >$string = eregi_replace("<(/?)(scr[^>]*)>", "«font color=maroon»\1«/font»", >$string); > >This results in opening and closing <script></script> tags being replaced >with a square being wrapped in font tags. I have this working in Cold Fusion >but cannot seem to convert my scripts to PHP. Can anyone help?

    If the « you posted is actually in your source code instead of << it ain't gonna work... ^ / \ This is not a valid ASCII character.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    Dan,

    Thanks for your explanation. In fact Danny's version of using \\0 did the trick without altering the pattern, useful to now about the ' chars making faster processing though. My understanding of back referencing was that it is the ability to use all or part of a search pattern in the replace string, if this is wrong I think I need to read up again, can you recommend any good reference manuals (preferably not specific to a single language construct, I mainly use ColdFusion in my professional capacity and like to convert my CF scripts to PHP).

    I have another regex question now, perhaps you could help. Is it possible to give a start position within the string being searched. I want to find x occurences of a pattern, then use a regular expression to search only a given section of the whole string. This is probably because my regex is not that great and I cannot work out how to find an instance of a pattern only if it is contained in another pattern. Here's my problem...

    When converting JS comments & strings, it is possible certain chars already have font/bold tags wrapped around them and need to be removed.

    // comments example $nl = chr(10); $fcontent = eregi_replace("[^http:]/{2,2}([^$nl]*)$nl", "«font color=darkgreen»«i»\\0«/i»«/font»", $fcontent);

    I now want to remove any font/bold opening/closing tags from inside the string(s) «font color=darkgreen»«i» «/i»«/font».

    http://www.n-igma.net/regex.php

    The above shows what happens to strings and comments with chars that are being used in other search patterns.

    TIA

    Phil.

    P.S - I fully agree with you regarding font colors over CSS, I am using font tags here while the script is being perfected before rolling out the final version ;o)

    > -----Original Message----- > From: Analysis & Solutions [mailto:danielcanalysisandsolutions.com] > Sent: 04 August 2002 19:34 > To: PHP List > Subject: Re: [PHP] RegEx (back referencing) > > > On Sat, Aug 03, 2002 at 05:03:36PM +0100, Phil Ewington wrote: > > Hi, > > > > I am am writing a function to color code and indent JavaScript > source using > > regular expressions and cannot seem to get back referencing working. > > What you're using isn't "back referencing," it's utilizing "substrings." > Back referencing is when you bring the substrings back into the regular > expression definition. > > > > $string = eregi_replace("<(/?)(scr[^>]*)>", "«font > color=maroon»\1«/font»", > > $string); > > Here's what your command asks PHP to do: Find any opening or > closing script tag and replace it with "«font color=maroon»\1«/font»." > That's not what you intend. Let's make a test script: > > <?php > > $string = 'begin <script>java is dumb</script> end'; > > $string = eregi_replace("<(/?)(scr[^>]*)>", > "«font color=maroon»\1«/font»", $string); > > echo "$string\n"; > > ?> > > > This is what comes out: > > begin «font color=maroon»«/font»java is dumb«font color=maroon»«/font» > end > > > First off, if you want to utilize substrings, you need to use two > backslashes. "\\1" instead of "\1". Second, \\1 refers to the first > parenthesized part of the pattern, which in the pattern you set up is the > forward slash at the beginning of the script tag. So, let's modify the > pattern accordingly and see what happens: > > $string = eregi_replace("<(/?)(scr[^>]*)>", > "«font color=maroon»\\1«/font»", $string); > > Creates: > > begin «font color=maroon»«/font»java is dumb«font > color=maroon»/«/font» > end > > > But, that's still not what you intend. I think you're really looking to > surround the scripts with maroon font tags. To do that, you need to tweak > the expression to grab the script tags, the script itself and the closing > script tag. > > $string = eregi_replace('(<script[^>]*>[^<]*</script>)', > '<font color="maroon">\\1</font>', $string); > > Outputs: > > begin <font color="maroon"><script>java is dumb</script></font> end > > > Notice the use of ' rather than ", which saves a little processor time by > not evaluaing the strings for variables. > > One final improvement. Font tags are obnoxious. They cause problems for > people that choose their own background colors in their browsers. Read > http://www.analysisandsolutions.com/code/weberror.htm?ft=y for more info > on that. Anyway, I suggest using Cascading Style Sheets, > http://www.w3.org/TR/REC-CSS1, for the colroing instead: > > $string = eregi_replace('(<script[^>]*>[^<]*</script>)', > '<code class="js">\\1</code>', $string); > > echo "<style>code.js {color: maroon;}</style>\n"; > echo "$string\n"; > > Yields: > > <style>code.js {color: maroon;}</style> > begin <code class="js"><script>java is dumb</script></code> end > > Voila! > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    >Is there a way for PHP to look at a local multiple-page .tiff file and find >out haw many page it has?

    I think that's what this http://www.php.net/manual/en/function.exif-read-data.php is for...

    If not, I could have sworn that pdf_open_tiff *USED* to document how to read a specific frame from a multi-frame TIFF, and (presumably) it would have given some detectable condition when you went "too far"...

    Alas, http://www.php.net/manual/en/function.pdf-open-image.php doesn't seem to talk much about this...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I know that a function name preceded by 2 underscores (__) has 'magical' >properties when declared in a class. My question is, is it safe to declare >a function with 2 underscores before its name outside of a class? For >example, if this is my whole script. > ><?PHP >function __hello () { > echo 'Hello world'; >} > >__hello; >?> > >Is my function safe from having any wierd effects from the double >underscore?

    Almost for sure that's safe...

    Check the "rules" for a function name to be sure that an initial alphabetic isn't required in the specification.

    http://php.net/manual/

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >What does this parameter do in PHP.ini, and what would happen if I turned it >off? From reading the PHP site, it appears this is only useful if you use >PHP from the command line, is that right?

    Yes. Well, as a CGI is pretty much from the command line, I think...

    Basically, $argc tells how many arguments were on the command line, and $argv is an array with the arguments in it.

    Example php -c /alternate/php.ini -f /path/to/some/file.php

    $argc would be 5, I think (counting the 'php'?) and $argv would be: array('php', '-c', '/alternate/php.ini', '-f', '/path/to/some/file.php')

    I'm not sure the 'php' is counted or not...

    Anyway, if you turn them "Off" they ain't gonna be there.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Hello All > >I am trying to use parse_str in my script , passing a variable. > >I have old code, working with php 4.1.2 working with the following script : > >[rootzion kickstart]# cat make-kickstart.php > > >#!/usr/local/bin/php -q ><? >// parse any arguments >parse_str ($argv[1]) ; > >print "NAME: $name \n"; > >?> > >for some reason tho , under 4.2.2 it is not parsing the argument/s > >[rootzion kickstart]# ./make-kickstart.php name=lxmode >NAME: > >Does any one know if anything changed in 4.2.2 , I swear it works under >4.1.2 or older. > >Thanks for any advice or info in advance !!

    register_argc_argv got turned off in php.ini along with register_globals?

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I am exactly a beginner of php. This question may be easy. >I have a php program which want to achieve the url from browser. >e.g. webmail.xxx.com > >then how the index.php is able to know it is xxx.com ?? >which function in php can do so??

    Depends...

    What if it's:

    chi.mail.ameritech.net

    Did you want 'mail.ameritech.net' or 'ameritech.net' ?

    Well, it's pretty much the same either way.

    <?php $url = 'webmail.xxx.com'; $parts = explode('.', $url);

    $lasttwo = $parts[count($parts) - 2] . '.' . $parts[count($parts) - 1];

    unset($parts[0]); $allbutfirst = implode('.', $parts); ?>

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Hey php-general, > > $db_host = "localhost"; > > how do i set with ip ? > > it works with localhost > > but it doesn't work: > > $db_host = "IP.IP.IP.IP";

    This works just fine *IF* MySQL is configured to allow that IP address to connect, which it probably isn't.

    And assuming that you can actually reach that IP address from the box you are on.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >How can I set up MySQL error logging? Is there any PHP MySQL error log >parsers?

    http://mysql.com might have an answer...

    If you want to log all errors from PHP, there are settings in php.ini for that.

    If you want to be a bit careful with your code, you can use http://php.net/error_log and http://set_error_handler and log all MySQL errors from PHP.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I upgraded from 4.1.1 to 4.2.2 on Win2000 running IIS. I immediately starting >having problems with IIS hanging after a few requests. I tried all sorts of >nonsense and its only got worse. In desperation, I copied all of the dll's in >the php distribution into /winnt/system32, overwriting the existing files. >Now I've got php running fine, but as soon as any *php* page is accessed, ASP >pages stop responding. Actually, they do respond with this: -2147417842 >(0x8001010e). > >Restarting IIS clears it up until the next php page loads. Any ideas? The ASP >folks developing on the server are getting (understandably) irritable.

    My first guess is that one of the DLLs you replaced shouldn't have been replaced...

    Don't supposed you have a backup?...

    If not, perhaps if they re-install ASP, it will over-write whichever DLL is guilty.

    Microsoft sucks. :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I'm having trouble passing "$the_score" to "edit_s1_php3": > > // Display the scores > while ( $row = mysql_fetch_array($result) ) { > echo( "<form>" . "<p>" . > $row["last_name"] . " , " . $row["first_name"] . "</p>" . > $row["s1"] . " <input type='text' name='the_score' size='3'>"

    I think maybe you want:

    name='the_score[s1]'

    Any JavaScript will have to refer to it as document.form.element.5.value since you'll never get JavaScript to use [ or ] as part of the name.

    >I'm pretty sure it's because I don't have the form action defined.. however, >each input goes to a diffent action. How do I do this?

    I dunno how you made that work. Not even sure why you'd want to. I guess it has to be JavaScript...

    But you *could* do it with having a different <FORM> for each row.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >When I create directories in PHP through the mkdir() command, what number >should I set the mode so I have the priveleges to delete the directory >through FTP? I used to always set them to 777 but then when I try to delete >the directories in FTP, it doesnt let me, and I have to write a PHP script >that deletes the folders!

    Note that mkdir() works in conjunction with http://php.net/umask so that you *MIGHT* need to do:

    <?php umask('0000'); mkdir('/path/to/dir', '0777'); ?>

    if you expect to actually *GET* a 777 directory.

    If the mkdir documentation doesn't say anything about this, add a Note... Though I thought I did that about two years ago... :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    better do this:

    $oldmask = umask(0); mkdir($dir_to_create, 0777); umask($oldmask);

    Elias

    "Richard Lynch" <richphpbootcamp.com> wrote in message news:php.general-111177news.php.net... > >When I create directories in PHP through the mkdir() command, what number > >should I set the mode so I have the priveleges to delete the directory > >through FTP? I used to always set them to 777 but then when I try to delete > >the directories in FTP, it doesnt let me, and I have to write a PHP script > >that deletes the folders! > > Note that mkdir() works in conjunction with http://php.net/umask so that you > *MIGHT* need to do: > > <?php > umask('0000'); > mkdir('/path/to/dir', '0777'); > ?> > > if you expect to actually *GET* a 777 directory. > > If the mkdir documentation doesn't say anything about this, add a Note... > Though I thought I did that about two years ago... :-) > > -- > Like Music? http://l-i-e.com/artists.htm > I'm looking for a PRO QUALITY two-input sound card supported by Linux (any > major distro). Need to record live events (mixed already) to stereo > CD-quality. Soundcard Recommendations? > Software to handle the recording? Don't need fancy mixer stuff. Zero (0) > post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo > audio-to-disk.

    attached mail follows:


    >I have some a very little problem about referencing my site www.vanua2com. > >Although, I insert a good tags in the head of my index.php, I couldn't add >my site into any search engin. > >Before, I used the same method in HTML with real success, with PHP it >become impossible.

    I can't even begin to guess how you would think PHP would affect your site's ability to be in a search engine...

    Unless you're trying to register URLs with ? in them like:

    www.vanua2.com/whatever.php?test=foo

    Search engines will generally refuse such URLs since they are usually dynamic in nature.

    You can get around this by doing:

    www.vanua2.com/whatever.php/test/foo

    and instead of using $_GET['foo'] you'll need to use http://php.net/parse_str with $PATH_INFO (?)...

    Look at the output from <?php phpinfo();?> in whatever.php and the URL above to see what I mean.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >But when I try to pass some variables from a Form to a PHP isn´t working

    register_globals is probably off, so you need $_POST['nome'] instead of $nome and so on.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Hi all >Has anyone got any suggestions on the easiest way to detect strings like >http://www.bla.bla.bla.com/test.html or ftp://ftp.bla.bla.bla.com >mailto://namecompany.com etc etc >I've got a text buffer containg url's of different typs mixed in with normal >text. What I want to do is go through the buffer and htmlise the url type >strings so that they are clickable. > >Has anyone got any suggestions on the easiest way to do this?

    There are probably only a dozen or so solutions in each code archive linked from:

    http://php.net/links.php

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    This has been discussed several times now.

    You've gotta search the newsgroup or learn REGEXP yourself.

    Elias,

    "Nick Allan" <allannirvib.org.au> wrote in message news:431CECCEDA1AD611822B00B0D02257670CE26Aexchskr1.rvib.org.au... > Hi all > Has anyone got any suggestions on the easiest way to detect strings like > http://www.bla.bla.bla.com/test.html or ftp://ftp.bla.bla.bla.com > mailto://namecompany.com etc etc > I've got a text buffer containg url's of different typs mixed in with normal > text. What I want to do is go through the buffer and htmlise the url type > strings so that they are clickable. > > Has anyone got any suggestions on the easiest way to do this? > > Thanks in advance for any suggestions. > > Regards Nick > > > ___________________________________________ > > This email (including all attachments) may contain personal information and > is intended solely for the named addressee. It is confidential and may be > subject to legal or other professional privilege. Any confidentiality or > privilege is not waived or lost because this email has been sent to you by > mistake. If you have received it in error, please let us know by reply > email, delete it from your system and destroy any copies. > > This email is also subject to copyright. No part of it should be reproduced, > adapted or communicated without the written consent of the copyright owner. > Any personal information in this email must be handled in accordance with > the Privacy Act 1988 (Cth). > > Emails may be interfered with, may contain computer viruses or other defects > and may not be successfully replicated on other systems. We give no > warranties in relation to these matters. If you have any doubts about the > authenticity of an email purportedly sent by us, please contact us > immediately. > > > > >

    attached mail follows:


    >Hi, > >I'm sorry.. I don't really have any idea what I'm doing, but I almost >got this thing working. If someone could help, I'd deeply appreciate it. > >I need to get these variables to the next script (edit_scores.php3): >$the_Score, $player_name >so I can update the field (s1) WHERE the last_name is $player_name > >I'm pretty close with this:------------ > >// Display the scores > while ( $row = mysql_fetch_array($result) ) { >echo("<table border='0' cellpadding='3' cellspacing='0'>" . >"<tr>". > "<td>". $row["last_name"]. "</td>" . > "<td>". $row["first_name"] ."</td>". > "<td></td><td></td><td></td>". >"</tr>". >"<tr>". > "<td>".$row["s1"] ."</td>". > "<td>"."<form action = edit_score.php3>". "</td>". > "<td>"."<input type='text' name='the_score' size='3'>"."<input >type='hidden' name='$player_name'>"."</td>". > "<td>"."<input type='submit' name='s1' value='edit'>"."</td>". > "<td>"."</form>"."</td>". >"</tr>". > >etc..etc.. more scores ------------------------- > >$the_score is passed ok... but how do I include passing the >$player_name? > >The result from above in the url is: >cpa_golf/edit_score.php3?the_score=23&nichols=++&s1=edit > >"nichols" is "$player_name" but is will not echo in the script.

    It's probably $_POST['player_name'] not in $player_name.

    Also, older browsers won't let you put the FORM tag inside a TD and then have INPUT and the /FORM in other TD tags...

    Put the FORM and /FORM outside the whole TABLE if it doesn't all fit inside a single TD tag:

    <FORM> <TABLE> . . . </TABLE> </FORM>

    I dunno how far back this problem goes, so maybe it's version 2 browsers... Oh well. Better safe than sorry.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    Very thanks!

    In php.ini I found many commented lines like extension=php_XXX.dll, and one of them was needed - after uncomment my "Fatal error" was disappear.

    But some values (not all!) stored into db after fetch was without first char. In result, now I'm using MySql - anyway that was installed.

    -----Original Message----- From: Richard Lynch [mailto:richphpbootcamp.com] Sent: Friday, August 02, 2002 11:59 AM To: Nashev Cc: php-generallists.php.net Subject: Re: Undefined function: dbmopen() in loaded Windows binaries of PHP 4.2.1

    >Hello. > >Say me pls, are there method to enable DBM support in loaded Windows >binaries of PHP 4.2.1? > >I have "Fatal error: Call to undefined function: dbmopen() in ..." my .php >file... :((

    You need to find a file in your PHP 4.2.1 install named something like one of these: dbmphp.dll phpdbm.dll . . .

    I dunno what the name really is...

    Then, in your php.ini, add something like:

    extension=dbmphp.dll

    only with the right name.

    If you're not sure where php.ini is or don't have one, use this: <?php phpinfo();?> to find out where it should be, and find it or put one there.

    NOTE: There is no guarantee that dbm is supported under Windows, so there might not *BE* any dbmphp.dll file on the planet.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux
    (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero
    (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    hey guys,

    what im trying to do is display a random entry from a mysql db, is there a function for this? or do i just have to generate a random number and go from there?

    jo

    attached mail follows:


    -----Original Message----- From: Richard Black [mailto:rblackdatavisibility.co.uk] Sent: 05 August 2002 09:33 To: 'tux' Subject: RE: [PHP] random data from mysql db

    SELECT field1, field2 FROM table ORDER BY RAND() LIMIT 1

    -----Original Message----- From: tux [mailto:tuxengimped.net] Sent: 05 August 2002 23:28 To: php-generallists.php.net Subject: [PHP] random data from mysql db

    hey guys,

    what im trying to do is display a random entry from a mysql db, is there a function for this? or do i just have to generate a random number and go from there?

    jo

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

    attached mail follows:


    SELECT * FROM tablename ORDER BY RAND() LIMIT 1

    --
    

    Best regards, George Nicolae IT Manager ___________________ PaginiWeb.com - Professional Web Design www.PaginiWeb.com

    "Tux" <tuxengimped.net> wrote in message news:1028586495.12082.47.cameltuxen.gimped.net... > > hey guys, > > what im trying to do is display a random entry from a mysql db, is there > a function for this? or do i just have to generate a random number and > go from there? > > jo > > >

    attached mail follows:


    SELECT * FROM table ORDER BY RAND()

    or something like that... check the MySQL manual for RAND()

    Justin

    on 06/08/02 8:28 AM, tux (tuxengimped.net) wrote:

    > > hey guys, > > what im trying to do is display a random entry from a mysql db, is there > a function for this? or do i just have to generate a random number and > go from there? > > jo > > >

    attached mail follows:


    With older versions of MySQL you had to do this: SELECT id, name, age, etc, id*0+RAND() as rand_col FROM table ORDER BY rand_col

    HTH,

    Peter Janett

    New Media One Web Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PostgreSQL coming soon!

    http://www.newmediaone.net webmasternewmediaone.net (303)828-9882

    ----- Original Message ----- From: "George Nicolae" <geomasterwebhotmail.com> To: <php-generallists.php.net> Sent: Monday, August 05, 2002 2:41 AM Subject: [PHP] Re: random data from mysql db

    > SELECT * FROM tablename ORDER BY RAND() LIMIT 1 > > -- > > > Best regards, > George Nicolae > IT Manager > ___________________ > PaginiWeb.com - Professional Web Design > www.PaginiWeb.com > > > "Tux" <tuxengimped.net> wrote in message > news:1028586495.12082.47.cameltuxen.gimped.net... > > > > hey guys, > > > > what im trying to do is display a random entry from a mysql db, is there > > a function for this? or do i just have to generate a random number and > > go from there? > > > > jo > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I think the answer is mysql_num_rows(). Take a look at http://www.php.net/manual/en/function.mysql-num-rows.php

    --
    

    Best regards, George Nicolae IT Manager ___________________ PaginiWeb.com - Professional Web Design www.PaginiWeb.com

    "Jason Caldwell" <jasonthinkingman.org> wrote in message news:20020802210130.66098.qmailpb1.pair.com... > I'm using PHP4 and MySQL -- > > I'm trying to write a small search engine -- got it working, however, what > I'd like to do is return the TOTAL records found. > > You see, right now I am using LIMIT within my SQL -- so I only return 15 > results at a time. > > How do I get the total (say for example there are 2000 records) -- do I need > to COUNT(*) first, then perform another SELECT query for my search? > > Or, is there a PHP/MYSQL command that returns the total records matching my > SELECT query irregardless of the LIMIT ?? > > Thanks > Jason > >

    attached mail follows:


    Is it possible in the body of the e-mail to get every carriage return and indention that the client types in. In other words if he adds lines like below how can I get them to stay in the format that they where typed in. This is all done using a form Text Area field This is the start of the e-mail message This is the second line of the message this is the third line of the message

    I don't what it to end up on the other end with it looking like this This is the start of the e-mail message This is the second line of the message this is the third line of the message

    -- 
    Best regards,
     rdkurth                          mailto:rdkurthstarband.net
    

    attached mail follows:


    Hello,

    On 08/05/2002 06:09 AM, rdkurthstarband.net wrote: > Is it possible in the body of the e-mail to get every carriage return and > indention that the client types in. In other words if he adds lines > like below how can I get them to stay in the format that they where > typed in. This is all done using a form Text Area field > This is the start of the e-mail message > This is the second line of the message > this is the third line of the message > > I don't what it to end up on the other end with it looking like > this > > This is the start of the e-mail message This is the second line of > the message this is the third line of the message

    Just send the message in plain text. If you send in HTML, page sure you put the text between <PRE></PRE>.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    i have two files: file1.php file2.php - file1 is public and file2 is password protected with htpaswd-htaccess. -in file1 i have link1 to file2. How to make link1 to acces file2 without entering username and password in htpasswd popup window? (User can acces file2 from file1, just pressing link1, and without necesity to enter user and pass). I think user and pass are parameters in link1, but i don't know sintax) tx in adv for any help adi

    attached mail follows:


    Op maandag 05 augustus 2002 12:32, schreef adi: > i have two files: file1.php file2.php > - file1 is public and file2 is password protected with htpaswd-htaccess. > -in file1 i have link1 to file2. How to make link1 to acces file2 without > entering username and password in htpasswd popup window? > (User can acces file2 from file1, just pressing link1, and without necesity > to enter user and pass). I think user and pass are parameters in link1, but > i don't know sintax) > tx in adv for any help > adi

    www.dom">http://username:passwordwww.dom.......

    attached mail follows:


    Hi, the 2 queries runs at exact speed. They differ only in that mysql has to return 1 row. So mysql generates the result as in the first query and returns only one row. You may get better performance for the second query because less data is transported over TCP/IP or unix domain sockets. If the result set is extremely big in the first query the second will be fast but because the transport of the result set of it will be faster. AFAIK, LIMIT clause is like HAVING clause but having is on some column and because mysql does not have default column as I heard there is in postgres LIMIT is used. This query will work in Postrgresq but mysql queries with LIMIT x,y will also run but will give unexpected results because in Postgres LIMIT how, offset (in mysql LIMIT offset, how).

    Andrey

    > > > -----Original Message----- > > > From: Lars Olsson [mailto:lassolassoweb.nu] > > > Sent: Sunday, August 04, 2002 4:28 PM > > > To: php-generallists.php.net > > > Subject: [PHP] MySQL performance question > > > > > > Hi all! > > > > > > Sorry for being slightly off topic, but this list seems to have it's > > > fair share of MySQL gurus... :-) Anyway, here's my question: > > > > > > Suppose I create a table (called table1) which has a field with only > > > unique values (called id). Now suppose this table has some rows and > > that > > > I want to select ONE of them. I usually do this: > > > > > > "SELECT * FROM table1 WHERE id=somevalue" > > > > > > Since id is a unique value this can only return (at most) 1 row. Now > > > let's try this: > > > > > > "SELECT * FROM table1 WHERE id=somevalue LIMIT 1" > > > > > > This query will produce exactly the same result as the first query. > > But > > > which one (if any) of the two queries are the most efficient? Is it > > > > > > a) The first one, since it's a less complicated SQL query (less time > > to > > > parse) > > > b) The second one, since it will restrict MySQL from searching further > > > whenever a row is found > > > > > > Any opinions? > > > > > > /lasso (lassolassoweb.nu) > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Hi Everyone,

    I'm quite new to all this PHP stuff, and was wondering if someone could give me some help with a problem I have.

    After upgrading from PHP3 I now get the following information displayed

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

    I think it may have something to do with the build, perhaps it's made errors whilst trying to build with mySQL. Any help would be much appreciated.

    --
    Tony Burgess
    

    attached mail follows:


    Hi, you are not connect to database (maybe), check lines with mysql_connect() ... for error. You're may be using mysql_connect to supress error messages so remove ''.

    Tony Burgess wrote: > Hi Everyone, > > I'm quite new to all this PHP stuff, and was wondering if someone could give > me some help with a problem I have. > > After upgrading from PHP3 I now get the following information displayed > > Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result > resource > > I think it may have something to do with the build, perhaps it's made errors > whilst trying to build with mySQL. Any help would be much appreciated. > > -- > Tony Burgess > > > >

    -- 
    --
    Mirek Novak
    Anima Publishers
    CMS development
    

    http://www.auto.cz http://www.formule1.cz

    jabber:mireknjs.netlab.cz ISEEKYOU:1<one>9<four>9<nine>44<eight> GEsEm:+420603807838

    attached mail follows:


    Or you can use die() like this:

    mysql_connect("localhost","login","passwd") or die (mysql_error());

    This won't fix the problem but it'll give you something more informative to work on (I think)...

    You can also

    echo mysql_errno() . ": " . mysql_error();

    - E

    > >Hi, > you are not connect to database (maybe), check lines with >mysql_connect() ... for error. You're may be using mysql_connect to >supress error messages so remove ''. > >Tony Burgess wrote: >>Hi Everyone, >> >>I'm quite new to all this PHP stuff, and was wondering if someone >>could give >>me some help with a problem I have. >> >>After upgrading from PHP3 I now get the following information >>displayed >> >>Warning: mysql_query(): supplied argument is not a valid MySQL-Link >>resource >>Warning: mysql_fetch_array(): supplied argument is not a valid >>MySQL result >>resource >> >>I think it may have something to do with the build, perhaps it's >>made errors >>whilst trying to build with mySQL. Any help would be much >>appreciated. >> >>-- >>Tony Burgess >> >> >> >> > > > >-- >-- >Mirek Novak >Anima Publishers >CMS development > >http://www.auto.cz >http://www.formule1.cz > >jabber:mireknjs.netlab.cz >ISEEKYOU:1<one>9<four>9<nine>44<eight> >GEsEm:+420603807838 > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/

    attached mail follows:


    "Mirek Novak" <mirek.novakauto.cz> wrote in message news:3D4E7DE1.5070004auto.cz... > Hi, > you are not connect to database (maybe), check lines with mysql_connect() ... for error. You're may be using mysql_connect to > supress error messages so remove ''. >

    I doubt its to do with connect, wouldn't a corresponding error have shown... i.e. Something along the lines of cannot find DNS... Or error connecting to....

    > Tony Burgess wrote: > > Hi Everyone, > > > > I'm quite new to all this PHP stuff, and was wondering if someone could give > > me some help with a problem I have. > > > > After upgrading from PHP3 I now get the following information displayed > > > > Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource > > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result > > resource > >

    Your error is most likely is to do with the SQL query supplied before the fetch_array statement you obviously had something that requested execution of a query as follows:

    $result = mysql_query("An SQL Command", $dataBaseNameSource);

    Here is where lies your problem.... Make sure you are supplying a legit SQL query i.e. Check the "An SQL Command" syntax for legitimacy, For instance if you are INSERTING make sure number of arguements supplied equals number of fields indicated for enrty

    > > I think it may have something to do with the build, perhaps it's made errors > > whilst trying to build with mySQL. Any help would be much appreciated. > > > > -- > > Tony Burgess > > > > > > > > > > > > -- > -- > Mirek Novak > Anima Publishers > CMS development > > http://www.auto.cz > http://www.formule1.cz > > jabber:mireknjs.netlab.cz > ISEEKYOU:1<one>9<four>9<nine>44<eight> > GEsEm:+420603807838 > Hope this helps,

    Spike...

    attached mail follows:


    Two things you should check, since I came across this problem once:-

    1) Have you lost MySQL support with apache/php? .. Do a phpinfo on your site and see if mysql support has been lost.. if so, you need to re-build the package with mysql enabled.

    2) Are you using older functions in your php script, since I think I remember doing so myself that were given up for others available in php4..

    I think those were two major issues I had to deal with at some time or another, that sorta were the answers to your kinda problem..

    On Mon, 5 Aug 2002, Edwin wrote:

    > Or you can use die() like this: > > mysql_connect("localhost","login","passwd") or die (mysql_error()); > > This won't fix the problem but it'll give you something more informative to > work on (I think)... > > You can also > > echo mysql_errno() . ": " . mysql_error(); > > - E > > > > >Hi, > > you are not connect to database (maybe), check lines with > >mysql_connect() ... for error. You're may be using mysql_connect to > >supress error messages so remove ''. > > > >Tony Burgess wrote: > >>Hi Everyone, > >> > >>I'm quite new to all this PHP stuff, and was wondering if someone > >>could give > >>me some help with a problem I have. > >> > >>After upgrading from PHP3 I now get the following information > >>displayed > >> > >>Warning: mysql_query(): supplied argument is not a valid MySQL-Link > >>resource > >>Warning: mysql_fetch_array(): supplied argument is not a valid > >>MySQL result > >>resource > >> > >>I think it may have something to do with the build, perhaps it's > >>made errors > >>whilst trying to build with mySQL. Any help would be much > >>appreciated. > >> > >>-- > >>Tony Burgess > >> > >> > >> > >> > > > > > > > >-- > >-- > >Mirek Novak > >Anima Publishers > >CMS development > > > >http://www.auto.cz > >http://www.formule1.cz > > > >jabber:mireknjs.netlab.cz > >ISEEKYOU:1<one>9<four>9<nine>44<eight> > >GEsEm:+420603807838 > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > _________________________________________________________________ > $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    ---
    "The difference between genius and stupidity is that genius has its
    limits."  - Albert Einstein
    

    Ashwin kutty.. Systems Administrator Dalhousie University Libraries (902) 494-2694

    attached mail follows:


    From: "Tony Burgess" <tonyactual-systems.com> Sent: Monday, August 05, 2002 9:01 AM Subject: [PHP] Help needed after upgrading to PHP4

    > After upgrading from PHP3 I now get the following information displayed > Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

    PHP 4 out of the box has register_globals off now. Find the php.ini, and change register_globals to on. If that fixes it, then you ought to change the scripts so they don't need register_globals on.

    You can read about why register_globals is now default off under Security at: http://www.php.net/release_4_1_0.php

    attached mail follows:


    I can't seem to find a way to connect to an Oracle 8.16 database on a remote server. I have a linux box running 4.2.2 and the oracle database sits on a seperate Solaris box. I could use ODBC, but I can't seem to find a FREE odbc driver for oracle.

    Does anyone have anything to offer? Did I miss a PHP function that does this?

    Any help would be greatly appreciated.

    Tim Nields

    attached mail follows:


    I don't think you need ODBC for this.

    Perhaps, you can check the manual:

    http://www.php.net/manual/en/function.ocilogon.php

    The tnsnames.ora file has something to do with this. (When the client and the server are on 2 different machines, this is the file that you need to investigate about...)

    I think...

    - E

    > >I can't seem to find a way to connect to an Oracle 8.16 database on a remote >server. I have a linux box running 4.2.2 and the oracle database sits on a >seperate Solaris box. I could use ODBC, but I can't seem to find a FREE >odbc driver for oracle. > >Does anyone have anything to offer? Did I miss a PHP function that does >this? > >Any help would be greatly appreciated. > >Tim Nields > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!&E>?&(B http://career.msn.co.jp/

    attached mail follows:


    "Tim Nields" <tnieldsiitri.org> wrote in message news:20020805143956.49675.qmailpb1.pair.com... > I can't seem to find a way to connect to an Oracle 8.16 database on a remote > server. I have a linux box running 4.2.2 and the oracle database sits on a > seperate Solaris box. I could use ODBC, but I can't seem to find a FREE > odbc driver for oracle. > > Does anyone have anything to offer? Did I miss a PHP function that does > this? > > Any help would be greatly appreciated. > > Tim Nields > >

    I think the microsoft site might have the downloads you are looking for... I believe they come with the MDAC versions... I may be mistaken, or the version you are looking for may not be suppported if so my appologies (I have never worked with Oracle so I have no clue as to update versions etc...)...

    Try: http://www.microsoft.com/data/download.htm

    Spike...

    attached mail follows:


    Sorry I missed the part that said you have a linux box hence my previous post is useless...

    Sorry about that... "Kondwani Spike Mkandawire" <kondwanics.mun.ca> wrote in message news:20020805150554.78036.qmailpb1.pair.com... > > "Tim Nields" <tnieldsiitri.org> wrote in message > news:20020805143956.49675.qmailpb1.pair.com... > > I can't seem to find a way to connect to an Oracle 8.16 database on a > remote > > server. I have a linux box running 4.2.2 and the oracle database sits on > a > > seperate Solaris box. I could use ODBC, but I can't seem to find a FREE > > odbc driver for oracle. > > > > Does anyone have anything to offer? Did I miss a PHP function that does > > this? > > > > Any help would be greatly appreciated. > > > > Tim Nields > > > > > > I think the microsoft site might have the downloads you are looking > for... I believe they come with the MDAC versions... I may be mistaken, > or the version you are looking for may not be suppported if so my > appologies (I have never worked with Oracle so I have no clue > as to update versions etc...)... > > Try: http://www.microsoft.com/data/download.htm > > Spike... > >

    attached mail follows:


    Also, it seems like MDAC is only for Micro$oft $QL $erver--this has nothing to do with Oracle, I think...

    Anyway, don't worry, I think this place is about sharing and not always being correct...

    - E

    > >Sorry I missed the part that said you have a linux box >hence my previous post is useless... > >Sorry about that... >"Kondwani Spike Mkandawire" <kondwanics.mun.ca> wrote in message >news:20020805150554.78036.qmailpb1.pair.com... > > > > "Tim Nields" <tnieldsiitri.org> wrote in message > > news:20020805143956.49675.qmailpb1.pair.com... > > > I can't seem to find a way to connect to an Oracle 8.16 database on a > > remote > > > server. I have a linux box running 4.2.2 and the oracle database sits >on > > a > > > seperate Solaris box. I could use ODBC, but I can't seem to find a FREE > > > odbc driver for oracle. > > > > > > Does anyone have anything to offer? Did I miss a PHP function that does > > > this? > > > > > > Any help would be greatly appreciated. > > > > > > Tim Nields > > > > > > > > > > I think the microsoft site might have the downloads you are looking > > for... I believe they come with the MDAC versions... I may be mistaken, > > or the version you are looking for may not be suppported if so my > > appologies (I have never worked with Oracle so I have no clue > > as to update versions etc...)... > > > > Try: http://www.microsoft.com/data/download.htm > > > > Spike... > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ $B%O%$%;%s%9$J>&IJ$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/

    attached mail follows:


    Hi!

    After a few days, I came to the conclusion that the workaround to the PHP code for parsing XML and stuff like that are not going to work. Due to the fact that the data have to be put into a file which is illegal for me to store the credit bureau inquiry data. Again, due to the fact that that parsing is only to tell if the XML tag is not broken or anything. Mozilla browser can tell you that. So, here is what I did to make it happen, plain and simple!!!!!!!!!!!!!!!!!!!!!!!!! It involved logic!!!!!

    The variable, $res_str contain the XML stuff as a response in a serial stream from the credit bureau. Let's say you want to get the data from the XML tag and put it into an array out of bunch of XML tags, "<CompletionCode>23scs3</CompletionCode>";

    --clip-- //// the XML data into the PHP ----------------------------- $str_len = strlen($res_str); $count = 0; $BEGIN_COMPLETIONCODE = ""; $END_COMPLETIONCODE = "";

    //// prevent infinite loop if the appropriate response is not received if (substr($res_str,0,2) == "<?")

    while($count < $str_len){ //// check for "<CompletionCode>" and "</CompletionCode>" and put it into PHP array if (substr($res_str,$count,16) == "<CompletionCode>"){ $BEGIN_COMPLETIONCODE = ($count+16); } if (substr($res_str,$count,17) == "</CompletionCode>"){ $END_COMPLETIONCODE = ($count-$BEGIN_COMPLETIONCODE); } $count++; } }

    $XML['CompletionCode'] = substr($res_str,$BEGIN_COMPLETIONCODE,$END_COMPLETIONCODE);

    echo substr($res_str,$BEGIN_COMPLETIONCODE,$END_COMPLETIONCODE)."<br>"; --clip--

    Voila!! You got one data!!! If you have tons of XML tags with only some of them come at a random while some other won't show up then you have got a problem!!! We're gonna need PHP developer to write a function for that for the sake of PHP people!!

    attached mail follows:


    Markas wrote: > Hello, people. > So the problem. > I have apache running with php-module. > Recently I've upgraded the 4.0.6 version up to 4.2.2. > All my php configuration directives in httpd.conf (php_flag, php_admin_flag, > php_value, php_admin_value) are not working now. When I change libphp4.so > back to 4.0.6 the directives work, if I use 4.2.2 module - they don't. The > configuration of apache and php.ini are not being changed. The php.ini in > both cases is almost the same. > The configure options of both php-versions seems to be the same. > Where is the problem? Did I miss anything while configuring and installing > 4.2.2 php module? I can not find any info in php docs. > > > >

    I had the same problem with my setup. I used to set engine = off in php.ini and using php_flag engine on as per vhost. I did overcome it by adding php types (.php .php3 .php4) as per vhost only and not globally. Regards

    -- 
    Sameh Attia
    Senior System Engineer
    T.E. Data
    --
                    __  __  _
        _________ _/ /_/ /_(_)___ _
       / ___/ __ `/ __/ __/ / __ `/
      (__  ) /_/ / /_/ /_/ / /_/ /
    /____/\__,_/\__/\__/_/\__,_/
    

    attached mail follows:


    Hi Guys!

    I am having trouble with my sessions. Basically I have a php script from which I register a session variable:

    session_register("myVar"); $myVar = "hello";

    My problem arises when I try to output the variables further down the page using $HTTP_SESSION_VARS['myVar'] it just doesn't display anything unless I refresh the page then it works ok.

    I have tried using the ob_start() and ob_end_flush() functions to buffer the output, these seem to work great with cookies but not so great with session variables.

    Does anybody have any ideas how I should be tackling this?

    Thanks, Chris

    attached mail follows:


    > session_register("myVar"); > $myVar = "hello"; > > My problem arises when I try to output the variables further > down the page > using $HTTP_SESSION_VARS['myVar'] it just doesn't display > anything unless I > refresh the page then it works ok.

    I am assuming you have register_globals turned on in this answer. If it is off, delete this message now ;)

    The trick here is that PHP doesn't store the values of session variables to the $HTTP_SESSION_VARS array until the script ends. So on the current page, the array is empty. On the next page, the values are there. To access (display or assign to) the variable on the current page, just use the session variable, e.g.,

    $myVar = "hello"; echo $myVar;

    Kirk

    attached mail follows:


    Jason Caldwell wrote: > I would like to give my users the ability to send (to my website) a > Microsoft Excel file, and then have my server (PHP code) extract that data > and turn it into a TAB Delimited Text file -- is this possible with PHP? > > Thanks. > Jason > > >

    sc.openoffice.org they have a pdf document that describes Excel sheet file format Regards

    -- 
    Sameh Attia
    Senior System Engineer
    T.E. Data
    --
                    __  __  _
        _________ _/ /_/ /_(_)___ _
       / ___/ __ `/ __/ __/ / __ `/
      (__  ) /_/ / /_/ /_/ / /_/ /
    /____/\__,_/\__/\__/_/\__,_/
    

    attached mail follows:


    Hello Gurus. Any good links from where I can find how to edit pictures in PHP. I want to generate a text (like 01,02,03 etc.)on every picture after the customer loads the picture in to my database.How to do it. Thanks Olev

    attached mail follows:


    >From: "olev rumm" <infotoolmecindustries.com> >Sent: Monday, August 05, 2002 11:30 AM >Subject: [PHP] picture editing

    > Hello Gurus. > Any good links from where I can find how to edit pictures in PHP. > I want to generate a text (like 01,02,03 etc.)on every picture after the > customer loads the picture in to my database.How to do it.

    This is from a presentation by Rasmus that does what you want using gd and libpng. It will center the text on the image. It's a good place to start.

    <?php Header("Content-type: image/png"); $font = "php.ttf"; if(!$si) $si = 66; $im = ImageCreateFromPNG("php-blank.png"); $tsize = imagettfbbox($si,0,$font,$text); $dx = abs($tsize[2]-$tsize[0]); $dy = abs($tsize[5]-$tsize[3]); $x = ( imagesx($im) - $dx ) / 2; $y = ( imagesy($im) - $dy ) / 2 + 3*$dy/4; $blue = ImageColorAllocate($im,0x5B,0x69,0xA6); $white = ImageColorAllocate($im,255,255,255); $black = ImageColorAllocate($im,0,0,0); ImageTTFText($im, $si, 0, $x, $y, $white, $font, $text); ImageTTFText($im, $si, 0, $x+2, $y, $white, $font, $text); ImageTTFText($im, $si, 0, $x, $y+2, $white, $font, $text); ImageTTFText($im, $si, 0, $x+2, $y+2, $white, $font, $text); ImageTTFText($im, $si, 0, $x+1, $y+1, $black, $font, $text); ImagePNG($im); ?>

    Use like: <IMG src="txt2.php?text=<?echo urlencode($text)?>&si=<?echo $si?>">

    attached mail follows:


    Hi,

    sorry, my english isn't the best.

    I have a problem to dynamically create directorystructures using php 4.2.2 running as modul in safe-mode.

    the ftp- and apache user (for the virtual-hosts) are identical, but the user, the apache-daemon in runnung under, is a different, so that directory-access ist only possible to the owner.

    if now using the mkdir-function, php creates a directory owned by the user, the apache-daemon is started with, not by the user, the virtual-host is running under.

    the first directory can be created, if the permissions are the to. but in the created directory i can't create other directories or files.

    this is no problem, if safe-mode is turned off - tested with a test-server. but the configuration of the live-server can't be changed to not using the safe_mode.

    What's the way to get this work ??

    regards and thanks for your answers

    Kai

    attached mail follows:


    Has anyone had any problems with session data not unsetting with the unset command with 4.2.2?

    I am using sessions and much of the data is not unsetting.

    .: B i g D o g :.

    attached mail follows:


    I am having trouble conceptualizing a solution to a fairly complicated (for me) string parsing exercise.

    The problem is I need to work with "fields" in a text string which is essentially a profile of a professional person (doctor, lawyer , etc...)

    So say the profile is this: John Doe the best in the world. Education: School of hard Knocks 2000 Admitted: 2001. Employment History: John Doe Inc, 2000- present Professional Associations: PTA Representative Clients: My dog

    Obviously this is a simplified, ficticious example. This profile will come from a database but here I'l just stuff it in a string variable for simplicity. $bio = "Me \n Education: School of hard Knocks 2000. \n Admitted: 2001. \n Employment History: none \n Professional Associations: PTA \n Representative Clients: My dog";

    The "delimiters" of the text field can be put into an array as follows: $keywords[0]="Education:"; $keywords[1]="Admitted:"; $keywords[2]="Employment History:"; $keywords[3]="Professional Associations:"; $keywords[4]="Representative Clients:"; $keywords[5]="Community Involvement:"; $keywords[6]="Firm:";

    Now I can loop through the text field ($bio) looking for each keyword and its position and add it to another array as follows: $i=0; $j=-1; for ($i=0;$i<=count($keywords);$i++) { $keypos = strpos($bio, $keywords[$i]);

    if (!$keypos === false ) { $j++; $biofields[$j][0] = $keypos; $biofields[$j][1] = $keywords[$j]; } }

    I can now output this and get this (in position keyword format):

    3 Education: 45 Admitted: 66 Employment History: 93 Professional Associations: 126 Representative Clients:

    With this information I can parse through the "bio" and get each "field" if they are always in the same, static order, but in reality this is not the case. So I need to sort the array somehow or use some other method to make this flexible enough to account for any order of "keyword delimiters".

    Suggestions?

    attached mail follows:


    Hi All,

    I'm trying to convert this snippet of Perl to PHP and it just wont populate the $oid and $status variables. Does anyone know if Perl can do things that PHP can't? - Personally I wouldn't have thought so but you live & learn I suppose.

    <Perl code starts here> #!/usr/bin/perl use CGI; use DBI;

    my $qs = new CGI();

    #- Print MIME header print $qs->header(); print "<b>Doing Transaction </b><br />\n";

    my $oid = $qs->param("oid"); my $status = $qs->param("transactionstatus"); <Perl code ends>

    The problem is that $oid and $transactionid are just not there. I'm unsure what method the sending server is using. I'm told Java but I have my doubts - It's a banks credit card transaction server so it's kinda secret and it's https which could be the problem.

    Any help from a Perl guru will be very much appreciated.

    Cheers Andy.

    attached mail follows:


    Hi there: I wonder if somebody can help me with this. I am able to upload only files generated by "notepad" or "wordpad"...that's to say..plain txt files. When I try to upload any files, such as ms-word, ms-excel, the parameter: $_FILES["userfile"]["tmp_name"] would be "none"....

    I'm wondering if this is a problem with Apache_1.3.23 server setup or with php.ini?

    Appreicate any help...

    attached mail follows:


    Anyone know how to simplify this statment:

    $i=0; $s1=$row[s1]; if ($s1!= 0){ $i++; } $s2=$row[s2]; if ($s2!= 0){ $i++; } $s3=$row[s3]; if ($s3!= 0){ $i++; } $s4=$row[s4]; if ($s4!= 0){ $i++; } $s5=$row[s5]; if ($s5!= 0){ $i++; } $s6=$row[s6]; if ($s6!= 0){ $i++; } $s7=$row[s7]; if ($s7!= 0){ $i++; } $s8=$row[s8]; if ($s8!= 0){ $i++; } $s9=$row[s9]; if ($s9!= 0){ $i++; } $s10=$row[s10]; if ($s10!= 0){ $i++; } $s11=$row[s11]; if ($s11!= 0){ $i++; } $s12=$row[s12]; if ($s12!= 0){ $i++; } $s13=$row[s13]; if ($s13!= 0){ $i++; } $s14=$row[s14]; if ($s14!= 0){ $i++; } $s15=$row[s15]; if ($s15!= 0){ $i++; }

    Thanks In Advance, Jim Long

    attached mail follows:


    for($a=0;$a<15;$a++) { if($row[$a])$i++; }

    Hope this helps Andy.

    ----- Original Message ----- From: "Jim Long" <jimjimlong.net> To: "php" <php-generallists.php.net> Sent: Monday, August 05, 2002 7:03 PM Subject: [PHP] simplify statement

    > Anyone know how to simplify this statment: > > $i=0; > $s1=$row[s1]; > if ($s1!= 0){ > $i++; > } > $s2=$row[s2]; > if ($s2!= 0){ > $i++; > } > $s3=$row[s3]; > if ($s3!= 0){ > $i++; > } > $s4=$row[s4]; > if ($s4!= 0){ > $i++; > } > $s5=$row[s5]; > if ($s5!= 0){ > $i++; > } > $s6=$row[s6]; > if ($s6!= 0){ > $i++; > } > $s7=$row[s7]; > if ($s7!= 0){ > $i++; > } > $s8=$row[s8]; > if ($s8!= 0){ > $i++; > } > $s9=$row[s9]; > if ($s9!= 0){ > $i++; > } > $s10=$row[s10]; > if ($s10!= 0){ > $i++; > } > $s11=$row[s11]; > if ($s11!= 0){ > $i++; > } > $s12=$row[s12]; > if ($s12!= 0){ > $i++; > } > $s13=$row[s13]; > if ($s13!= 0){ > $i++; > } > $s14=$row[s14]; > if ($s14!= 0){ > $i++; > } > $s15=$row[s15]; > if ($s15!= 0){ > $i++; > } > > Thanks In Advance, > Jim Long > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    In article <20020805140434.30109.qmailpb1.pair.com>, ohmysamhotmail.com (Samura1) wrote: > I have a variable $text contains a paragraph and dot points. Here is an > example > ========== > Hello, > Yes I am a GUY. > Why not? > - ABC > - DEF > ========== > > But the browser will only display something like: > ========================== > Hello,Yes I am a GUY.Why not? > ========================== > > I know it is caused by the <p> <br>...etc. But how to insert this tags into > the paragraph? > Please help~

    There are two ways to do this, depending on how you think of that text. If that text is meant to specifically not be HTML, nor even a paragraph, and you want to present it as flat, mono-spaced text, you can use the <pre> tag:

    echo "<pre>$text</pre>";

    will keep the exact (monospaced) formatting.

    If you mean to present it as a paragraph, or as a set of paragraphs and listed items, you'll need to do it in multiple steps.

    1. Break it into an array of paragraphs, probably using the 'split' function.

    2. Iterate through each paragraph and echo "<p>$paragraph</p>"; (assuming that you use $paragraph as your iteration variable).

    This ignores that some of your paragraphs are really list items. Don't worry about that. Make sure that those steps are working, and then:

    3. If they are indented as a list, as it appears, you'll want to detect that they are a list, and then (a) drop the pre-pended spaces, (b) drop the bullet (-), and (c) echo "<li>$listitem</li>.

    Making sure to always use "<ul>" along with the first list item and "</ul>" with the final list item.

    Do step 3 last, because it is the most complicated! Get the first two steps done first.

    Jerry

    -- 
    http://www.hoboes.com/jerry/
    "Give a man a fish and you feed him for a day. Teach him to fish, and you've
    depleted the lake."--It Isn't Murder If They're Yankees
    (http://www.hoboes.com/jerry/Murder/)