OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Wed Oct 10 2001 - 19:22:38 CDT

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

    php-general Digest 11 Oct 2001 00:22:38 -0000 Issue 927

    Topics (messages 70641 through 70745):

    [Sab] PHP/Sablotron random segfaults (fwd)
            70641 by: Sterling Hughes

    Re: Passing parameters with POST
            70642 by: Stig-Řrjan Smelror
            70679 by: Calin Uioreanu
            70720 by: Philip Olson

    Re: Anyway of knowing whether a integer is odd or even
            70643 by: David Otton
            70680 by: J Smith

    Send out correct headers for word document
            70644 by: Nic Skitt
            70645 by: Andrey Hristov
            70646 by: George Pitcher
            70647 by: Nic Skitt
            70648 by: Nic Skitt
            70651 by: Nic Skitt
            70653 by: Nic Skitt

    Re: String 2 Number
            70649 by: Orr, Steve
            70672 by: Berthold Tenhumberg
            70722 by: Philip Olson

    Hour/dates problems
            70650 by: KeaZ
            70652 by: Martin Thoma
            70655 by: power jessie

    comparison problem
            70654 by: Bart Verbeek
            70676 by: Chris Lee

    Re: nested includes()...
            70656 by: Christian Dechery

    Re: which regexp require preg_grep() and which can be used with ereg()?
            70657 by: John A. Grant
            70731 by: CC Zona

    Re: problem with locale
            70658 by: Paul Newby

    Re: Quotation Marks in <textarea>...</textarea>
            70659 by: Tom Gitzinger

    Application Variables
            70660 by: Travis Carden

    HTTP_AUTHORIZATION problem
            70661 by: Ninety-Nine Ways To Die
            70673 by: Chris Lee

    Why am I getting this error?
            70662 by: Boget, Chris
            70663 by: Thomas Buck
            70666 by: Maxim Maletsky \(PHPBeginner.com\)
            70669 by: Boget, Chris
            70671 by: Maxim Maletsky \(PHPBeginner.com\)

    Re: [PHP-DB] comparison problem
            70664 by: Rick Emery

    What's in my array
            70665 by: Don
            70667 by: Thomas Buck
            70668 by: Dave Watkinson
            70723 by: Philip Olson

    EMALLOC
            70670 by: Paolo

    rectified - - problems with sessions
            70674 by: sagar N Chand
            70677 by: Maxim Maletsky \(PHPBeginner.com\)
            70682 by: Johnson, Kirk
            70685 by: Andrey Hristov

    Re: arrays in a class
            70675 by: Justin Garrett

    Regular Expressions and urls
            70678 by: Rob Gambit
            70716 by: ArsenKirillov

    Images from a database ...
            70681 by: Sebastián
            70688 by: Andrey Hristov

    Multidimensional form input array.
            70683 by: Alexander Deruwe
            70706 by: Chris Lee

    session_destroy
            70684 by: sagar N Chand
            70693 by: shi
            70710 by: David Otton

    IE6 and sessions
            70686 by: peterdove7846.ukonline.co.uk
            70697 by: Johnson, Kirk

    how to get different submit button values, when images?
            70687 by: Leone, Brian
            70698 by: Johnson, Kirk
            70708 by: Chris Lee

    hidden
            70689 by: Jeremy Morano
            70691 by: Chris Hobbs
            70694 by: * nea *
            70696 by: Chris Hobbs
            70699 by: Mark Roedel
            70705 by: Kamil Nowicki

    CORBA
            70690 by: NZeeman

    exec
            70692 by: AJDIN BRANDIC
            70707 by: Chris Lee
            70709 by: ReDucTor
            70717 by: ArsenKirillov

    C/C++ problem
            70695 by: Kamil Nowicki
            70700 by: Andrey Hristov

    PHP + Apache Authentification
            70701 by: EDUMEXICO
            70704 by: Andrey Hristov
            70719 by: EDUMEXICO

    browsers
            70702 by: Nikola Veber
            70703 by: Andrey Hristov
            70711 by: Mark
            70712 by: Chris Hobbs
            70714 by: Jerry Lake
            70718 by: Andrey Hristov
            70744 by: Chip

    A common theme: sessions
            70713 by: Chesley A Windon
            70743 by: Chris Lee

    What the ?
            70715 by: PHP List
            70721 by: PHP List
            70742 by: Chris Lee

    Master vs local values in php.ini
            70724 by: Eric D Nielsen

    eval( ) syntax
            70725 by: Rw
            70727 by: Jack Dempsey

    option block
            70726 by: Jeremy Morano

    PHP query problem...
            70728 by: Jeff Lewis
            70741 by: Chris Lee

    running query through while loop returns same variables
            70729 by: Tom Beidler
            70730 by: PHPGalaxy.com

    Re: header() behavior
            70732 by: Christian Reiniger

    Export/Import data from local PC MySQL database to remote ISP MySQL database.
            70733 by: Tome
            70736 by: Mark
            70738 by: PHP List

    Re: class and pictures from database
            70734 by: Christian Reiniger
            70735 by: Ashley M. Kirchner

    4.0.6 - odd behaviour when passing constant floats as function argument
            70737 by: Papp Gyozo

    session_register();
            70739 by: Martín Marqués
            70740 by: Chris Lee

    Odd session / exec / header problem
            70745 by: Jason Morehouse

    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:


        fyi and such...

        -Sterling

    ---------- Forwarded message ----------
    Date: Wed, 10 Oct 2001 13:40:45 +0200
    From: Petr Cimprich <petrgingerall.cz>
    Reply-To: sablistgingerall.cz
    To: Ruud van den Brink <ruudstress.utwente.nl>
    Cc: sablist <sablistgingerall.cz>,
         Sterling Hughes <sterlingdesignmultimedia.com>
    Subject: [Sab] PHP/Sablotron random segfaults

    This note may be important for those of you experiencing the strange
    instability of Apache/PHP/Sablotron.

    We have a (strong) feeling that this problem may be related to
    expat_lite library which is linked statically to Apache by default. This
    old library (based on expat 1.2) exports the same symbols as expat 1.9x.
    Therefore, when you use a software linking expat 1.9x dynamically (as
    Sablotron does) via Apache, there may be conflicts resulting in
    random-like segfaults. To avoid this problem, you have to disable
    expat_lite, (rename src/lib/expat-lite) and recompile Apache.

    This problem applies to all architectures using expat through Apache
    (e.g. Charlie, AxKit), but we didn't realize it must be the same for
    PHP/Sablotron as well.

    According to Matt's message posted to perl-xml recently, Apache
    developers will provide a new option (RULE_EXPAT) in the next 1.3.x
    version to disable expat_lite in a more convenient way.

    Please, let us know, if this helps.

    Thanks,
    Petr

    Ruud van den Brink wrote:

    >Hi Petr,
    >
    >Hmm, the same bug is reported at PHP with some more info:
    >
    >http://bugs.php.net/bug.php?id=13494
    >
    >Regards,
    >Ruud.
    >

    -- 
    Petr Cimprich
    Ginger Alliance
    www.gingerall.com
    

    ---------------------------------------- sablist is maintained by Ginger Alliance

    The list archives are at http://www.gingerall.cz

    To unsubscribe: mail to sympagingerall.cz with subject "UNSUB sablist"

    attached mail follows:


    > might have to be sessions then <shrugs> > >sorry > > Dave > > > -----Original Message----- > From: Rosen [mailto:rosen_dmdir.bg] > Sent: 10 October 2001 13:17 > To: php-generallists.php.net > Subject: Re: [PHP] Passing parameters with POST > > > Thanks, > but I don't want the user to see thath > "redirector.php?param1=this&param2=is&param3=a&param4=test" >

    I do believe there is a possibility from a HTTP 1.1 standpoint. I just can't find the RFC. I tried :

    header( "HTTP_POST_VARS: param=1" ); header( "Location: file.php" ); exit;

    What I'm thinking of here is to pass the paramameter to $HTTP_POST_VARS in the HTTP header.

    But to no luck ;) My best guess is that I'm taking a long shot here.

    -- 
    Stig-Řrjan Smelror
    Systemutvikler
    

    Linux Communications AS Sandakerveien 48b Box 1801 - Vika N-0123 Oslo, Norway

    tel. +47 22 09 28 80 fax. +47 22 09 28 81 http://www.lincom.no/

    attached mail follows:


    Then you need to rebuild the POST method header using fsockopen on port 80 and right parameter order. It's not that difficult as it seems once you write the necessary functions.

    --
    

    Regards, ---------------------------------------------- Calin Uioreanu calinciao-ag.com Tel: +49 - (0) 89 - 25 55 17 23 http://www.ciao.com ---------------------------------------------- "Richard Baskett" <rickbaskettcase.com> wrote in message news:B7E9895A.460B%rickbaskettcase.com... The way I worked around this problem was by using sessions.

    Rick

    > Thanks, > but I want to redirect to new page with "header('location: script.php')" > with parameters passed throught POST mrthod ! > > Thanks, > Rosen > > > "Stig-ŘRjan smelror" <soslincom.no> wrote in message > news:61674.195.18.238.2.1002715573.squirrelwebmail.lincom.no... >>> Hi, >>> how can I pass parameters between two pages with POST method, >>> not with GET ( i.e. script.php?param=1 ) ? >>> >>> Thanks, >>> Rosen >>> >> >> >> One easy way: >> >> <input type=hidden name=param value=1> >> >> >> >> -- >> Stig-Řrjan Smelror >> Systemutvikler >> >> Linux Communications AS >> Sandakerveien 48b >> Box 1801 - Vika >> N-0123 Oslo, Norway >> >> tel. +47 22 09 28 80 >> fax. +47 22 09 28 81 >> http://www.lincom.no/ >> >> >> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    yeah, a couple functions are floating around in cyberspace that use this method, called posttohost() and sendtohost() see :

    http://marc.theaimsgroup.com/?l=php-general&m=98671098800407 http://marc.theaimsgroup.com/?l=php-general&s=posttohost http://www.php.net/fsockopen

    regards. Philip Olson

    On Wed, 10 Oct 2001, Calin Uioreanu wrote:

    > Then you need to rebuild the POST method header > using fsockopen on port 80 and right parameter order. > It's not that difficult as it seems once you write the necessary functions. > > -- > > Regards, > ---------------------------------------------- > Calin Uioreanu > calinciao-ag.com > Tel: +49 - (0) 89 - 25 55 17 23 > http://www.ciao.com > ---------------------------------------------- > "Richard Baskett" <rickbaskettcase.com> wrote in message > news:B7E9895A.460B%rickbaskettcase.com... > The way I worked around this problem was by using sessions. > > Rick > > > Thanks, > > but I want to redirect to new page with "header('location: script.php')" > > with parameters passed throught POST mrthod ! > > > > Thanks, > > Rosen > > > > > > "Stig-ŘRjan smelror" <soslincom.no> wrote in message > > news:61674.195.18.238.2.1002715573.squirrelwebmail.lincom.no... > >>> Hi, > >>> how can I pass parameters between two pages with POST method, > >>> not with GET ( i.e. script.php?param=1 ) ? > >>> > >>> Thanks, > >>> Rosen > >>> > >> > >> > >> One easy way: > >> > >> <input type=hidden name=param value=1> > >> > >> > >> > >> -- > >> Stig-Řrjan Smelror > >> Systemutvikler > >> > >> Linux Communications AS > >> Sandakerveien 48b > >> Box 1801 - Vika > >> N-0123 Oslo, Norway > >> > >> tel. +47 22 09 28 80 > >> fax. +47 22 09 28 81 > >> http://www.lincom.no/ > >> > >> > >> > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    On Tue, 09 Oct 2001 16:18:09 -0400, you wrote:

    >Is > >if ($theInt & 1) > >really that much harder to read than > >if ($theInt % 2 > 0) > >?

    This is subjective of course, but... yes. "(x%2)" is the most common way to derive odd and even numbers. Manuals and tutorials use it, prime-sieves use it. Bit-masks aren't in common use outside systems programming.

    The programmer that has to follow you 6 months down the line doesn't care that you shaved a few clock cycles off by being clever... he does care that you left him clean, easily readable code.

    MOD is also the more general solution - how would you change the code to colour every nth line red?

    (BTW, a quick test show that 1 billion (i&1) in a loop execute in 9 seconds, while (i%2) execute in 12 seconds. C (not PHP), MSVC++6, PIII800. Which means I gain 3 billionths of a second on each test if I use the bitwise operator.)

    >And why wouldn't you want to get the most performance out of your code, >regardless of the language, scripting or otherwise? Especially when it's a >one or two character switch that makes the difference?

    Because programmer time is /vastly/ more valuable than machine time. Do you remove comments from your scripts because parsing /* */ // symbols soaks up CPU time?

    >I doubt that PHP should be classified as a scripting language any more >than Perl is. Scripting languages are usually used to glue different >applications together, like a shell script that uses awk and sed or >whatever. PHP can be used to build applications, so it's more than a >scripting language. Interpreted language is more like it.

    "Scripting language" is a common-usage synonym for "interpreted language", and has been for several years. ("Your search for scripting language found 387 results on www.perl.com.")

    http://www.tuxedo.org/~esr/jargon/html/entry/Python.html

    Not that I don't agree with you...

    djo

    attached mail follows:


    David Otton wrote:

    > > This is subjective of course, but... yes. "(x%2)" is the most common > way to derive odd and even numbers. Manuals and tutorials use it, > prime-sieves use it. Bit-masks aren't in common use outside systems > programming. > > The programmer that has to follow you 6 months down the line doesn't > care that you shaved a few clock cycles off by being clever... he does > care that you left him clean, easily readable code.

    Being clever by using a relatively common technique... Nefarious!

    > > MOD is also the more general solution - how would you change the code > to colour every nth line red?

    Change all of one line? It's not like we're re-writting 1000 lines of code here.

    > > (BTW, a quick test show that 1 billion (i&1) in a loop execute in 9 > seconds, while (i%2) execute in 12 seconds. C (not PHP), MSVC++6, > PIII800. Which means I gain 3 billionths of a second on each test if I > use the bitwise operator.)

    Okay, this is certainly more true now, with faster processors, more RAM, etc. But years ago, there was a difference.

    > >>And why wouldn't you want to get the most performance out of your code, >>regardless of the language, scripting or otherwise? Especially when it's a >>one or two character switch that makes the difference? > > Because programmer time is /vastly/ more valuable than machine time. > Do you remove comments from your scripts because parsing /* */ // > symbols soaks up CPU time?

    In PHP this might matter a bit (unless you use the Zend Encoder or Cache or something), but I'm traditionally a C and C++ guy, and after compilation comments don't mean much.

    > >>I doubt that PHP should be classified as a scripting language any more >>than Perl is. Scripting languages are usually used to glue different >>applications together, like a shell script that uses awk and sed or >>whatever. PHP can be used to build applications, so it's more than a >>scripting language. Interpreted language is more like it. > > "Scripting language" is a common-usage synonym for "interpreted > language", and has been for several years. ("Your search for scripting > language found 387 results on www.perl.com.") > > http://www.tuxedo.org/~esr/jargon/html/entry/Python.html > > Not that I don't agree with you... > > djo

    I've never liked that scripting term either. It makes it sound like bash or a DOS batch script or something. It's so misleading. Perl used to fit the moniker a bit more, before it got all big and started weighing in at 900 pounds.

    J

    attached mail follows:


    Hi all,

    I have a directory above my web root containing a load of word documents. I want to be able to send them to the client without exposing the directory to the user.

    I have been trying to use readfile. It works in as much as the correct file is being sent. Unfortunalty it is coming out as unformatted rubbish because, presumably the headers have not been set to a word document so IE is interpretting it as straight text. How do I set the headers to a word document type so that the Document is either downloaded or viewed within the page?

    Cheers

    Nic

    attached mail follows:


    I'm not sure but I think that it is: Header("application/ms-word");

    -- 
    Andrey Hristov
    Web Developer
    IcyGEN Corporation
    BALANCED SOLUTIONS
    http://www.icygen.com
    

    On Wednesday 10 October 2001 15:36, you wrote: > Hi all, > > I have a directory above my web root containing a load of word documents. I > want to be able to send them to the client without exposing the directory > to the user. > > I have been trying to use readfile. It works in as much as the correct file > is being sent. Unfortunalty it is coming out as unformatted rubbish > because, presumably the headers have not been set to a word document so IE > is interpretting it as straight text. How do I set the headers to a word > document type so that the Document is either downloaded or viewed within > the page? > > Cheers > > Nic

    attached mail follows:


    Isn't it more like

    header("Content-type: application/ms-word");

    George

    ----- Original Message ----- From: "Andrey Hristov" <ahristovicygen.com> To: <php-generallists.php.net> Sent: Wednesday, October 10, 2001 1:48 PM Subject: Re: [PHP] Send out correct headers for word document

    > I'm not sure but I think that it is: > Header("application/ms-word"); > > -- > Andrey Hristov > Web Developer > IcyGEN Corporation > BALANCED SOLUTIONS > http://www.icygen.com > > On Wednesday 10 October 2001 15:36, you wrote: > > Hi all, > > > > I have a directory above my web root containing a load of word documents. I > > want to be able to send them to the client without exposing the directory > > to the user. > > > > I have been trying to use readfile. It works in as much as the correct file > > is being sent. Unfortunalty it is coming out as unformatted rubbish > > because, presumably the headers have not been set to a word document so IE > > is interpretting it as straight text. How do I set the headers to a word > > document type so that the Document is either downloaded or viewed within > > the page? > > > > Cheers > > > > Nic > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

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

    attached mail follows:


    Andrey,

    Thanks, I am currently trying this:

    header( "Content-type: application/ms-word" ); #header( "Content-Disposition: attachment; filename=cv-984.doc" ); #header( "Content-Description: Word CV Document" ); readfile ($tmp);

    With the #'d sections or without, either does not work and I still just get a garbage output.

    Any ideas?

    "Andrey Hristov" <ahristovicygen.com> wrote in message news:01101015483302.01419andrey.masq... > I'm not sure but I think that it is: > Header("application/ms-word"); > > -- > Andrey Hristov > Web Developer > IcyGEN Corporation > BALANCED SOLUTIONS > http://www.icygen.com > > On Wednesday 10 October 2001 15:36, you wrote: > > Hi all, > > > > I have a directory above my web root containing a load of word documents. I > > want to be able to send them to the client without exposing the directory > > to the user. > > > > I have been trying to use readfile. It works in as much as the correct file > > is being sent. Unfortunalty it is coming out as unformatted rubbish > > because, presumably the headers have not been set to a word document so IE > > is interpretting it as straight text. How do I set the headers to a word > > document type so that the Document is either downloaded or viewed within > > the page? > > > > Cheers > > > > Nic >

    attached mail follows:


    George,

    As I have replied to Andrey, still no success. Any ideas?

    Cheers

    Nic

    attached mail follows:


    I attach the headers:

    URL: localhost/testword.php Content Type: application/ms-word Content Length: 34816 Last Modified: Version: HTTP/1.1 Status Code: 200 Status Text: OK Raw Headers: HTTP/1.1 200 OK Forwarded: Server: Apache/1.3.20 (Win32) Request Method: GET Headers CR/LF: User Agent: GET /testword.php HTTP/1.1 Accept-Language: en Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: HTMLRaw.ocx <sarwriteme.com> Host: localhost Cookie: TrackID=9992579352093921738

    I have tried:

    $fp1 = $tmp; $len = filesize($fp1); header("Content-type: application/ms-word"); header("Content-Disposition: inline; filename=$fp1"); header("Content-Length: $len"); readfile($fp1);

    and:

    header( "Content-type: application/ms-word" ); header( "Content-Disposition: attachment; filename=cv-984.doc" ); header( "Content-Description: Word CV Document" ); readfile ($tmp);

    Neither have worked.

    Cheers

    Nic

    attached mail follows:


    BTW I have just revised the application name after checking the headers of a genuine word doc loaded via a browser and it is msword not ms-word. Still no effect :(

    attached mail follows:


    if (is_numeric($datum)) settype($datum,"double");

    -----Original Message----- From: Saied Gerami [mailto:geramid21.de] Sent: 10 October 2001 01:31 To: php-generallists.php.net Subject: [PHP] String 2 Number

    Hi,

    Does anybody know how can I change a string containing only digits (like "3451") to number?

    Thanx,

    Saied

    attached mail follows:


    Hi,

    what about $num = (int)$str + 1; ?

    I think this is the logical way... ;-)

    Am Mittwoch, 10. Oktober 2001 13:50 schrieben Sie: > I think that $str+=0 is faster than sprintf

    -- 
    Berthold
    

    (live long and prosper...)

    attached mail follows:


    hi. be sure to read about type casting and juggling in the manual :

    http://www.php.net/manual/en/language.types.php http://www.php.net/manual/en/language.types.type-juggling.php http://www.php.net/settype

    regards, Philip Olson

    On Wed, 10 Oct 2001, Saied Gerami wrote:

    > Hi, > > Does anybody know how can I change a string containing only digits (like > "3451") to number? > > Thanx, > > Saied > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    How to delete the seconds in a date ? (from dd/mm/YYYY H:i:S to dd/mm/YYYY H:i) Thanks

    ______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif

    attached mail follows:


    Use mktime, to make a timestamp out of the date. Use date to format the date again.

    Or serach for the last : and use substr to clear it from the string.

    Keaz wrote:

    > How to delete the seconds in a date ? > (from dd/mm/YYYY H:i:S to dd/mm/YYYY H:i) > Thanks

    attached mail follows:


    try this: <? $date = "25/12/2001 12:25:01"; list($dd,$mm,$yy,$hh,$mn,$ss) = split("[:/ ]",$date); $new_date = date("d/m/Y H:i",mktime($hh,$mn,$ss,$mm,$dd,$yy)); ?> or maybe just remove the last three character from the date string :

    <?php $date = "25/12/2001 12:25:01"; $new_date = substr($date,0,strlen($date)-3); ?>

    or maybe there are othe better ways of doing this.

    hope that helps!

    jessie :)

    -----Original Message----- From: KeaZ [mailto:phpboxifrance.com] Sent: Wednesday, October 10, 2001 5:55 AM To: php-generallists.php.net Subject: [PHP] Hour/dates problems

    How to delete the seconds in a date ? (from dd/mm/YYYY H:i:S to dd/mm/YYYY H:i) Thanks

    attached mail follows:


    Hello people,

    I seem to have a problem with comparing a few values. I'm queriing the db for $row_uren[uren] and $row_uren[uren_verbruikt] $uren_tegoed = the difference between [uren] and [uren_verbruikt] from the db.

    Than I split up $uren_tegoed in $uren_int (whole numbers) and $uren_dec (decimals). I want to check if the decimals and if they are - between 01 and 25 it has to be set to 25 - between 26 and 50 it has to be set to 50 - between 51 and 75 it has to be set to 75 - between 76 and 99 or is 00 it has to be set to 00

    <?PHPCODE #AANTAL UREN SPLITTEN (INT/DEC) EN KLOKJES WEERGEVEN $uren_tegoed = $row_uren["uren"] - $row_uren["uren_verbruikt"];

    list ($klok_int, $klok_dec) = split('.', $uren_tegoed); if ($klok_dec >= "01" AND $klok_dec <= "25") { $klok_dec = "25"; $klok_dec_image = "klok_4-1.gif"; } elseif ($klok_dec >= "26" AND $klok_dec <= "50") { $klok_dec ="50"; $klok_dec_image = "klok_4-2.gif"; } elseif ($klok_dec >= "51" AND $klok_dec <= "75") { $klok_dec ="75"; $klok_dec_image = "klok_4-3.gif"; } elseif ($klok_dec >= "76" AND $klok_dec <= "99" || $klok_dec == "0" || !isset($klok_dec)) { $klok_dec ="0"; $klok_dec_image = "klok_4-0.gif"; --$klok_int; } else { $klok_dec ="ERROR"; $klok_dec_image = "ERROR"; } PHPCODE?>

    I keep getting the ERROR at the bottom of the page.

    Can anyone help me with this??

    Thanks in advance..

    Bart

    attached mail follows:


    I would check the values of $klok_int and $klok_dec variables, make sure they are being set correctly.

    print_r($klok_int); print_r($klok_dec);

    you can clean you code too by doing this. its just more ledgible.

    function reassign($dec) { if ( $dec > 75 OR !$dec ) return 0; if ( $dec > 50 ) return 75;

    if ( $dec > 25 ) return 50;

    if ( $dec > 0 ) return 25; } $klok_dec = reassign($klok_dec);

    --
    

    Chris Lee leemediawaveonline.com

    "Bart Verbeek" <b.verbeekcreative-edge.nl> wrote in message news:KDEGLILLMKMDKJGAMGHIKEKCCEAA.b.verbeekcreative-edge.nl... > > Hello people, > > I seem to have a problem with comparing a few values. > I'm queriing the db for $row_uren[uren] and $row_uren[uren_verbruikt] > $uren_tegoed = the difference between [uren] and [uren_verbruikt] from the > db. > > Than I split up $uren_tegoed in $uren_int (whole numbers) and $uren_dec > (decimals). > I want to check if the decimals and if they are > - between 01 and 25 it has to be set to 25 > - between 26 and 50 it has to be set to 50 > - between 51 and 75 it has to be set to 75 > - between 76 and 99 or is 00 it has to be set to 00 > > <?PHPCODE > #AANTAL UREN SPLITTEN (INT/DEC) EN KLOKJES WEERGEVEN > $uren_tegoed = $row_uren["uren"] - $row_uren["uren_verbruikt"]; > > list ($klok_int, $klok_dec) = split('.', $uren_tegoed); > if ($klok_dec >= "01" AND $klok_dec <= "25") { > $klok_dec = "25"; > $klok_dec_image = "klok_4-1.gif"; > } elseif ($klok_dec >= "26" AND $klok_dec <= "50") { > $klok_dec ="50"; > $klok_dec_image = "klok_4-2.gif"; > } elseif ($klok_dec >= "51" AND $klok_dec <= "75") { > $klok_dec ="75"; > $klok_dec_image = "klok_4-3.gif"; > } elseif ($klok_dec >= "76" AND $klok_dec <= "99" || $klok_dec == "0" || > !isset($klok_dec)) { > $klok_dec ="0"; > $klok_dec_image = "klok_4-0.gif"; > --$klok_int; > } else { > $klok_dec ="ERROR"; > $klok_dec_image = "ERROR"; > } > PHPCODE?> > > I keep getting the ERROR at the bottom of the page. > > Can anyone help me with this?? > > Thanks in advance.. > > Bart >

    attached mail follows:


    yeah.. from all the solutions presented here... this is the best one so far...

    altough I have to keep including one file in every script I have (which I think is not so "nice"), works fine....

    I think PHP could think about something like global.asa, I guess that would be not so tough to implement and would be a great adition... it doesn't depend on the php.ini and solves this problem with perfection...

    what do you guys think???

    At 19:01 09/10/01 -0400, Jason G. wrote: >This is how I have taken care of my include problems. >--------------------------------------------------------------- >I create a file in each directory called _stdinc.php which contains: ><? > define('_INCLUDE_DIR', '../../include/'); > include(_INCLUDE_DIR . 'stdinc.php'); >?> > >In the include dir, I have a script called stdinc.php which contains: ><? > include(_INCLUDE_DIR . 'lib.data.php'); > include(_INCLUDE_DIR . 'lib.sessions.php'); > include(_INCLUDE_DIR . 'lib.forms.php'); > include(_INCLUDE_DIR . 'lib.email.php'); >?> > >At the top of every script, I simply write: ><? > require('_sdtinc.php'); > . > . > . > > >This way, if I change move directory's, I only have to edit _stdinc.php in >each dir that changes. >------------------------------------------------------------------------------------- >I have a more efficient way worked out that lets you optionally include >whichever headers you want in a particular script by saying: ><? > define('_INCLUDE_LIST','CORE, LIB_DATA, LIB_EMAIL'); //Optional > require('_stdinc.php'); > . > . > . > >Let me know if you, or anyone wants to make use of that method. > >-Jason Garber >IonZoft.com > > >At 02:33 PM 10/9/2001 -0300, Christian Dechery wrote: >that way if the include dir changes I have to go trough each file to >change it?? > >that doesn't solve my problem at all... > >At 23:00 08/10/01 -0400, Jason G. wrote: >Alas, I have your solution! > >I have gotten around this very problem by saying at the top of a script: > >define(_INCLUDE_DIR, '/home/pad/include/'); //note trailing slash > >Anytime i include a file: >include(_INCLUDE_DIR . "lib.data.php"); > >It works always. > >-Jason Garber >IonZoft.com > > > >At 10:20 PM 10/8/2001 -0300, Christian Dechery wrote: >I have a file x.php that includes a.inc, and a.inc includes b.inc... > >if I have a file dir/z.php including ../a.inc it doesn't work cuz it won't >find b.inc... > >how can I get around this??? > > >_____________________________ >. Christian Dechery >. . Gaita-L Owner / Web Developer >. . http://www.webstyle.com.br >. . http://www.tanamesa.com.br > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    "Cc Zona" <cczonanospam.invalid> wrote in message news:20011008035754.27240.qmailpb1.pair.com... > In article <20011008024151.15354.qmailpb1.pair.com>, > jazrantzsc.nrcan.zc.ca (John A. Grant) wrote: > > > What is the simplest way to check for a blank line (just > > spaces, tabs etc.) read from a file using ereg()? I couldn't > > find any equivalent for the Perl "/\S/". > > I still don't understand why you would bother looking for an ereg > equivalent when you can just use "/\S/" as-is with a preg_*, but <shrug>... I dunno. I guess I figured that I should learn the non-Perl way, since I'm in the PHP world now. I always try to adapt to a new language when I'm learning it, instead of holding on to conventions and usage from other languages. But I guess it's fine to use preg_*

    [...] > "[^[:space:]]"

    Thanks. I hadn't seen that :space: thing before.

    > Okay, since you find that easy to read, then by all means keep on > familiarizing yourself with it. Like I said before, once you know Perl > regex syntax it takes maybe 5 minutes to pickup the minor differences > needed for PCRE.

    Yes, I think I will use preg_* now. Thanks for the help.

    --
    John A. Grant  * I speak only for myself *  (remove 'z' to reply)
    Radiation Geophysics, Geological Survey of Canada, Ottawa
    If you followup, please do NOT e-mail me a copy: I will read it here
    

    attached mail follows:


    In article <20011010134314.96005.qmailpb1.pair.com>, jazrantzsc.nrcan.zc.ca (John A. Grant) wrote:

    > > I still don't understand why you would bother looking for an ereg > > equivalent when you can just use "/\S/" as-is with a preg_*, but > <shrug>... > I dunno. I guess I figured that I should learn the non-Perl > way, since I'm in the PHP world now. I always try to adapt > to a new language when I'm learning it, instead of holding > on to conventions and usage from other languages. But > I guess it's fine to use preg_*

    LOL. Now I get it. Yeah, there isn't really a "PHP way" (POSIX extended regular expressions not being limited to PHP), but PHP does offer Perl users the opportunity to do regex the "Perl(-like) way". So yeah it's fine to take advantage of that opportunity.

    preg_* is there, it's fast, it's flexible, it's powerful--go for it. Cheers!

    -- 
    CC
    

    attached mail follows:


    Richard Lynch wrote: > > Someobdy had this a while back and found "fr-FR" was the magic bullet, > except when "fr" was the right one...

    Thanks... actually I probably should have mentioned that I've tried fr_FR, fr, french, and now fr-FR, but nothing seems to work.

    Since I've got this glitch on two machines (both of which are PHP-4.* and RH 7.0), someone else must be having this same problem.

    Paul N.

    attached mail follows:


    Hello KC,

    Just another comment:

    If you don't know about the magic_quotes_gpc setting on the server your script is supposed to be run on, use get_magic_quotes_gpc() to handle text data properly anyway. I usually use a function like this before I store submitted text data in a database:

    function SlashesIfNecessary ($varname) { $mq_gpc = get_magic_quotes_gpc(); if ($mq_gpc == 1) return $varname; else return addslashes($varname); }

    And then with each variable: $title = SlashesIfNecessary($title); $text = SlashesIfNecessary($text);

    If you display text data from the database on an HTML page again, don't forget something like htmlentities() (or htmlspecialchars()) and nl2br().

    Best regards Tom

    attached mail follows:


    Is there a PHP equivalent to Microsoft ASP's global.asa or Cold Fusion's application.cfm? I could, I suppose, just auto prepend an include file to all of the pages in each of my virtual domains, but I'd really rather not do that if I don't have to. I understand that the major benefit of the global.asa or application.cfm is that it doesn't have to be reparsed every time its included variables are used, unlike an auto prepend, which, I assume must be parsed on every page call. Anybody have an answer?

    Travis Carden Web Developer, Web Impressions, L.L.C. http://www.WebImpressions.com/

    attached mail follows:


    Running Apache 1.3.12, and php cvs, running into trouble with http_auth, I use

    $a = getenv(HTTP_AUTHORIZATION);

    and try to echo it back via:

    echo "$a";

    and I get nothing, yet when I use:

    foreach(getallheaders() AS $key => $value) echo "<b><u>$key</u>:</b> $value <br>\n";

    I get it back just fine as:

    Authorization: Basic rnD0mcHraCt3r5

    Any reason why this would be, I am kind of new to extracting HTTP_Vars as I never really had a use for it until now. I need to extract it via the getenv.. Thanks...

    Make a difference, help support the relief efforts in the U.S. http://clubs.lycos.com/live/events/september11.asp

    attached mail follows:


    your trying to get the username/passwd ? if you have register globals on, just use.

    echo "$HTTP_AUTH_USER:$HTTP_AUTH_PASS ";

    --
    

    Chris Lee leemediawaveonline.com

    "Ninety-Nine Ways To Die" <ninetyninewaystodielycos.com> wrote in message news:PPDMFNFNJHDAGBAAmailcity.com... > Running Apache 1.3.12, and php cvs, running into trouble with http_auth, I use > > $a = getenv(HTTP_AUTHORIZATION); > > and try to echo it back via: > > echo "$a"; > > and I get nothing, yet when I use: > > foreach(getallheaders() AS $key => $value) echo "<b><u>$key</u>:</b> $value <br>\n"; > > I get it back just fine as: > > Authorization: Basic rnD0mcHraCt3r5 > > Any reason why this would be, I am kind of new to extracting HTTP_Vars as I never really had a use for it until now. I need to extract it via the getenv.. Thanks... > > > > > Make a difference, help support the relief efforts in the U.S. > http://clubs.lycos.com/live/events/september11.asp

    attached mail follows:


    I've been beating my head up against the wall with this one for an hour and I cannot figure out what is going wrong... :(

    Each line of code below should be on a single line. The code starts at line 115 and ends at line 133.

    $fromUserQuery = "SELECT * FROM logins WHERE name = \"$tradeInfo[trade_from_uid]\""; $fromUserResult = mysql_db_query( "vtes", $fromUserQuery, $link ); $fromUserInfo = mysql_fetch_array( $fromUserResult );

    $toUserQuery = "SELECT * FROM logins WHERE name = \"$tradeInfo[trade_to_uid]\""; $toUserResult = mysql_db_query( "vtes", $toUserQuery, $link ); $toUserInfo = mysql_fetch_array( $toUserResult );

    mysql_close( $link );

    $mailToUsers = array(); if( "$toUserInfo[trades_notification]" ) { $mailToUsers[] = "\"$toUserInfo[name]\" <$toUserInfo[]email>"; } if( "$fromUserInfo[trades_notification]" ) { $mailToUsers[] = "\"$fromUserInfo[name]\" <$fromUserInfo[email]>"; }

    When I try to run my script, I get the following error:

    Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM _STRING' in ./parse_email.php on line 126

    Line 126 is this one:

    if( "$toUserInfo[trades_notification]" ) {

    however, even if I change it to

    if( 1 == 1 ) {

    I get the same error. What's going on?!?

    Chris

    attached mail follows:


    > > $mailToUsers[] = "\"$toUserInfo[name]\" <$toUserInfo[]email>"; >

    Should there not be something in the brackets above? i.e. $toUserInfo[]email doesn't look pleasent... at least to me :)

    Thomas.

    >if( "$fromUserInfo[trades_notification]" ) { > $mailToUsers[] = "\"$fromUserInfo[name]\" <$fromUserInfo[email]>"; > >} > > >When I try to run my script, I get the following error: > >Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM >_STRING' in ./parse_email.php on line 126 > >Line 126 is this one: > >if( "$toUserInfo[trades_notification]" ) { > >however, even if I change it to > >if( 1 == 1 ) { > >I get the same error. >What's going on?!? > >Chris

    attached mail follows:


    Change

    \"$tradeInfo[trade_to_uid]\"";

    to

    \"{$tradeInfo['trade_to_uid']}\"";

    Regards,

    Maxim Maletsky www.PHPBeginner.com

    > -----Original Message----- > From: Boget, Chris [mailto:Chris.Bogetwild.net] > Sent: mercoledě 10 ottobre 2001 16.11 > To: Php (E-mail) > Subject: [PHP] Why am I getting this error? > > > I've been beating my head up against the wall with this one > for an hour and I cannot figure out what is going wrong... :( > > Each line of code below should be on a single line. The code > starts at line 115 and ends at line 133. > > $fromUserQuery = "SELECT * FROM logins WHERE name = > \"$tradeInfo[trade_from_uid]\""; $fromUserResult = > mysql_db_query( "vtes", $fromUserQuery, $link ); > $fromUserInfo = mysql_fetch_array( $fromUserResult ); > > $toUserQuery = "SELECT * FROM logins WHERE name = > \"$tradeInfo[trade_to_uid]\""; > $toUserResult = mysql_db_query( "vtes", $toUserQuery, $link ); > $toUserInfo = mysql_fetch_array( $toUserResult ); > > mysql_close( $link ); > > $mailToUsers = array(); > if( "$toUserInfo[trades_notification]" ) { > $mailToUsers[] = "\"$toUserInfo[name]\" <$toUserInfo[]email>"; > > } > if( "$fromUserInfo[trades_notification]" ) { > $mailToUsers[] = "\"$fromUserInfo[name]\" <$fromUserInfo[email]>"; > > } > > > When I try to run my script, I get the following error: > > Parse error: parse error, expecting `T_STRING' or > `T_VARIABLE' or `T_NUM _STRING' in ./parse_email.php on line 126 > > Line 126 is this one: > > if( "$toUserInfo[trades_notification]" ) { > > however, even if I change it to > > if( 1 == 1 ) { > > I get the same error. > What's going on?!? > > Chris >

    attached mail follows:


    > > $mailToUsers[] = "\"$toUserInfo[name]\" <$toUserInfo[]email>"; > Should there not be something in the brackets above? i.e. > $toUserInfo[]email doesn't look pleasent... at least to me :)

    Yup, this is exactly what the problem was. My confusion now is why PHP didn't say that the error was on this line and instead said that the error was on the line previous to this one. This is why I kept beating my head against the wall... :p

    Thnx, Chris

    attached mail follows:


    Because the line started there. And since the error happened on that line PHP 'didn't know' where it ends.

    Regards,

    Maxim Maletsky www.PHPBeginner.com

    > -----Original Message----- > From: Boget, Chris [mailto:Chris.Bogetwild.net] > Sent: mercoledě 10 ottobre 2001 16.25 > To: 'Thomas Buck'; Php (E-mail) > Subject: RE: [PHP] Why am I getting this error? > > > > > $mailToUsers[] = "\"$toUserInfo[name]\" <$toUserInfo[]email>"; > > Should there not be something in the brackets above? i.e. > > $toUserInfo[]email doesn't look pleasent... at least to me :) > > Yup, this is exactly what the problem was. My confusion now > is why PHP didn't say that the error was on this line and > instead said that the error was on the line previous to this > one. This is why I kept beating my head against the wall... :p > > Thnx, > Chris >

    attached mail follows:


    First problem: PHP understands good old American English. It don't do no Dutch....<GRIN>

    Anyway. As part of your debugging, did you print the values of $uren_tegoed, $$uren_tegoed? Were they correct? I'm a little concerned about your use of list(). I believe it should list a list of variables into which values are placed; not a pointer to a variable.

    -----Original Message----- From: Bart Verbeek [mailto:b.verbeekcreative-edge.nl] Sent: Wednesday, October 10, 2001 8:19 AM To: Php-General; Php-Db-Help Subject: [PHP-DB] comparison problem

    Hello people,

    I seem to have a problem with comparing a few values. I'm queriing the db for $row_uren[uren] and $row_uren[uren_verbruikt] $uren_tegoed = the difference between [uren] and [uren_verbruikt] from the db.

    Than I split up $uren_tegoed in $uren_int (whole numbers) and $uren_dec (decimals). I want to check if the decimals and if they are - between 01 and 25 it has to be set to 25 - between 26 and 50 it has to be set to 50 - between 51 and 75 it has to be set to 75 - between 76 and 99 or is 00 it has to be set to 00

    <?PHPCODE #AANTAL UREN SPLITTEN (INT/DEC) EN KLOKJES WEERGEVEN $uren_tegoed = $row_uren["uren"] - $row_uren["uren_verbruikt"];

    list ($$uren_tegoed) = split('.', $uren_tegoed); if ($klok_dec >= "01" AND $klok_dec <= "25") { $klok_dec = "25"; $klok_dec_image = "klok_4-1.gif"; } elseif ($klok_dec >= "26" AND $klok_dec <= "50") { $klok_dec ="50"; $klok_dec_image = "klok_4-2.gif"; } elseif ($klok_dec >= "51" AND $klok_dec <= "75") { $klok_dec ="75"; $klok_dec_image = "klok_4-3.gif"; } elseif ($klok_dec >= "76" AND $klok_dec <= "99" || $klok_dec == "0" || !isset($klok_dec)) { $klok_dec ="0"; $klok_dec_image = "klok_4-0.gif"; --$klok_int; } else { $klok_dec ="ERROR"; $klok_dec_image = "ERROR"; } PHPCODE?>

    I keep getting the ERROR at the bottom of the page.

    Can anyone help me with this??

    Thanks in advance..

    Bart

    -- 
    PHP Database Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-db-unsubscribelists.php.net
    For additional commands, e-mail: php-db-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    I have a form that posts to a PHP script. In my script, I decode the vars with the line:

    $form = $http_post_vars;

    From the $form array (or hash) , is there a way to determine what my post variable names are?

    Thanks, Don

    attached mail follows:


    At 10:15 10/10/01 -0400, Don wrote: >I have a form that posts to a PHP script. In my script, I decode the vars >with the line: > >$form = $http_post_vars; > > >From the $form array (or hash) , is there a way to determine what my > post variable names are? > >Thanks, >Don

    <? foreach($http_post_vars as $key => $value) { echo "$key : $value<br>"; } ?>

    Thomas.

    attached mail follows:


    while (list($var, $value) = each($HTTP_POST_VARS)) { echo "$var = $value<br>\n"; }

    this is actually in the FAQ on php.net

    -----Original Message----- From: Don [mailto:donlclcan.com] Sent: 10 October 2001 15:15 To: php list Subject: [PHP] What's in my array

    I have a form that posts to a PHP script. In my script, I decode the vars with the line:

    $form = $http_post_vars;

    From the $form array (or hash) , is there a way to determine what my post variable names are?

    Thanks, Don

    attached mail follows:


    <pre> <?php print_r($HTTP_POST_VARS); ?> </pre>

    also, keep in mind that All variables are cAsE SensitivE. also have a look at :

    http://www.php.net/foreach

    regards, Philip Olson

    On Wed, 10 Oct 2001, Don wrote:

    > I have a form that posts to a PHP script. In my script, I decode the vars with the line: > > $form = $http_post_vars; > > >From the $form array (or hash) , is there a way to determine what my post variable names are? > > Thanks, > Don >

    attached mail follows:


    I get an eMalloc error between line X and X+1 if there are no records to delete. My DB is IBM DB2 running on a Debian Linux Server. My PHP development engine is running on a W2000 Advanced Server.

    myfile.php

    line 1: odbc_connect(... line x: $sql = 'delete from myTable where id = '. $id; line x+1: $rs = odbc_exec ($myDBConnection, $sql );

    Thanks

    attached mail follows:


    hello all,

    the bug is in the php.ini file. i've to change the

    session.cookie_path = /

    before it was set to another location outside of my server.

    some times small bugs irritate a lot. i've been struggling for this since 4-5 days.

    How nice it would be if php have good debugging or atleast waring capabilites.......

    origina mail follows :

    this is second or third time i'm mailing this. please help me.

    hi all,

    i'm using a php4.0.6 with apache on win2k. when i register a session and immediately if i redirect to another page the session seems not to be registered. eg. <? session_start(); $value = 908; session_register("value"); header("location : new location"); ?>

    when i go to the new page i c that the session has not been reigstered.

    but in case if i dont redirect from php rather use a html redirection code like "click here to redirect" then it worked. why ? <? session_start(); $value = 908; session_register("value"); ?> <a href="newlocation">click here to redirect</a> (this worked out )

    any suggestions ?

    /sagar // ------------------------------------ // end of original mail

    check out for those small pits.

    /sagar

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

    attached mail follows:


    Is that me wrong or you should declare the session first and then assign a value to variable?

    Here:

    <? session_start(); session_register("value"); $value = 908; header("location: new location"); ?>

    Regards,

    Maxim Maletsky www.PHPBeginner.com

    > -----Original Message----- > From: sagar N Chand [mailto:sagarchandyahoo.com] > Sent: mercoledě 10 ottobre 2001 16.49 > To: php > Subject: [PHP] rectified - - problems with sessions > > > hello all, > > the bug is in the php.ini file. i've to change the > > session.cookie_path = / > > before it was set to another location outside of my server. > > some times small bugs irritate a lot. i've been struggling > for this since 4-5 days. > > How nice it would be if php have good debugging or atleast > waring capabilites....... > > origina mail follows : > > this is second or third time i'm mailing this. please help me. > > > > hi all, > > i'm using a php4.0.6 with apache on win2k. when i register a > session and immediately if i redirect to another page the > session seems not to be registered. eg. <? session_start(); > $value = 908; session_register("value"); header("location : > new location"); ?> > > when i go to the new page i c that the session has not been > reigstered. > > but in case if i dont redirect from php rather use a html > redirection code like "click here to redirect" then it > worked. why ? <? session_start(); $value = 908; > session_register("value"); ?> > <a href="newlocation">click here to redirect</a> (this worked out ) > > any suggestions ? > > /sagar > // ------------------------------------ > // end of original mail > > check out for those small pits. > > /sagar > > >

    attached mail follows:


    > Is that me wrong or you should declare the session first and > then assign > a value to variable? > > <? > session_start(); > session_register("value"); > $value = 908; > header("location: new location"); > ?>

    Maxim, I wrote some example code like above to this list. Here is what Sascha Schumann had to say about it:

    <quote> Note that session_register() will implicitly commence the session, and thus will automatically instantiate all session variables. Hence, the above two lines need to be reversed, otherwise you might overwrite the session variable.

    - Sascha Experience IRCG </quote>

    I'm not sure I know what that means, but FWIW ;)

    Kirk

    attached mail follows:


    I think that : session_start(); if (session_is_registered("value")) session_register("value");

    if he switch the places the session_start() is not needed anymore.

    -- 
    Andrey Hristov
    Web Developer
    IcyGEN Corporation
    BALANCED SOLUTIONS
    http://www.icygen.com
    

    On Wednesday 10 October 2001 18:27, you wrote: > > Is that me wrong or you should declare the session first and > > then assign > > a value to variable? > > > > <? > > session_start(); > > session_register("value"); > > $value = 908; > > header("location: new location"); > > ?> > > Maxim, I wrote some example code like above to this list. Here is what > Sascha Schumann had to say about it: > > <quote> > Note that session_register() will implicitly commence the > session, and thus will automatically instantiate all session > variables. Hence, the above two lines need to be reversed, > otherwise you might overwrite the session variable. > > - Sascha Experience IRCG > </quote> > > I'm not sure I know what that means, but FWIW ;) > > Kirk

    attached mail follows:


    class foo{ var $some_array; }

    $object = new foo; $object->some_array[0] = "bar";

    echo $object->some_array[0];

    --
    Justin Garrett
    

    "L Melville" <leemelville101.freeserve.co.uk> wrote in message news:20011010122051.32593.qmailpb1.pair.com... > Thanks for the reply, is there a way of accessing the array directly, with > out using get/set methods? > > ie;- would something like this work > > $arrayClass = new AccessArray; > $arrayClass->m_myArray[2] = "blah"; > > lee > > > "Thomas Buck" <tomlocaleyes-uk.com> wrote in message > news:5.1.0.14.0.20011010114326.00a8cae0pop.steamradio.com... > > Hi, > > > > You don't go into much detail, but here's one method, I suppose (?) > > > > Class AccessArray { > > var m_myArray; > > > > function SetElement($name,$value) { > > $this->m_myArray[$name] = $value; > > } > > > > function GetElement($name) { > > return $this->m_myArray[$name]; > > } > > } > > > > $arrayClass = new AccessArray; > > $arrayClass->SetElement("name","Thomas"); > > $arrayClass->SetElement("number","123321); > > > > echo $arrayClass->GetElement("name"); > > file://echos "Thomas" > > > > echo $arrayClass->GetElement("number"); > > file://echos "123321" > > > > Thomas. > > > > >Hi, > > > > > >How can i set up and access arrays within a class? can anyone give a > > >quick example. > > > > > >thanks in advance > > > > > > > > >-- > > >PHP General Mailing List (http://www.php.net/) > > >To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > >For additional commands, e-mail: php-general-helplists.php.net > > >To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > >

    attached mail follows:


    I am trying to find a regex to relace a url in text with the <a href=... to make it a link. The urls in the text are sometimes enclosed in () or []

    Here is what I have now: function make_url($txt){

    return eregi_replace("((ftp://)|(http://)|(www))(([a-z0-9.\-])*)()?(([a-z0-9\.])*) (([:/])?)((([a-z0-9]*)(?)/*)+([.a-z]{2,4}){1})?((\??[a-z0-9\=]*)?)((\&[a-z0 -9\=]*)?)(([\.a-z]){2,4})?", "<a href=\"\\0\" target=\"_blank\">\\0</a>",$txt);

    }

    This works, except in some cases, like the following urls, the end path is left off. [http://www.geocities.com/Heartland/5792/] [http://www.iidc.indiana.edu/~irca/]

    Does anyone have something that will work with all urls?

    attached mail follows:


    <? function make_url($txt){ return preg_replace("~((ftp://)|(http://)|(www))[^\]]*~", "<a href=\"\\0\" target=\"_blank\">\\0</a>",$txt);

    }

    $text0="[http://www.geocities.com/Heartland/5792/]"; $text1="[http://www.iidc.indiana.edu/~irca/]"; echo make_url($text0)."<br>"; echo make_url($text1)."<br>"; ?> How about like above ?

    -----Original Message----- From: Rob Gambit [mailto:robgambithotmail.com] Sent: Wednesday, October 10, 2001 4:55 PM To: php-generallists.php.net Subject: [PHP] Regular Expressions and urls

    I am trying to find a regex to relace a url in text with the <a href=... to make it a link. The urls in the text are sometimes enclosed in () or []

    Here is what I have now: function make_url($txt){

    return eregi_replace("((ftp://)|(http://)|(www))(([a-z0-9.\-])*)()?(([a-z0-9\.])*) (([:/])?)((([a-z0-9]*)(?)/*)+([.a-z]{2,4}){1})?((\??[a-z0-9\=]*)?)((\&[a-z0 -9\=]*)?)(([\.a-z]){2,4})?", "<a href=\"\\0\" target=\"_blank\">\\0</a>",$txt);

    }

    This works, except in some cases, like the following urls, the end path is left off. [http://www.geocities.com/Heartland/5792/] [http://www.iidc.indiana.edu/~irca/]

    Does anyone have something that will work with all urls?

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    i want to store images of my site into a database using blob fields in an interbase db ...

    the function createimagefromgif ... returns a pointer at the image ... no the image content ....so i can´t just store the returned value in the db ... but i cant find another function to do this ...

    anyway ... if i have te content stored in the db ... and i make a query and get te content into a variable .... $img for example ... imagegif() uses like parameter a pointer to an image , no te image content ... so i need a pointer to $img .... no $img ....

    heeeelp please !!!!

    attached mail follows:


    Write to temp file in /tmp direcotry That read the content with fread() and put the content into the blob but addslashes before inserting. delete the temp file. the name of the file must be unique so >=2 processes to access same file. use md5 from something (IP,time,username, combination of previous)

    -- 
    Andrey Hristov
    Web Developer
    IcyGEN Corporation
    BALANCED SOLUTIONS
    http://www.icygen.com
    

    On Wednesday 10 October 2001 18:31, you wrote: > i want to store images of my site into a database using blob fields in an > interbase db ... > > the function createimagefromgif ... returns a pointer at the image ... no > the image content ....so i can´t just store the returned value in the db > ... but i cant find another function to do this ... > > anyway ... if i have te content stored in the db ... and i make a query and > get te content into a variable .... $img for example ... > imagegif() uses like parameter a pointer to an image , no te image content > ... so i need a pointer to $img .... no $img .... > > > heeeelp please !!!!

    attached mail follows:


    Hewwo everyone,

    I'm having a problem with multidimensional form input arrays. Suppose there is a form set up like this:

    .. some hidden input fields .. <input type="hidden" name="Array[FileName]" value=something dynamic> ..

    .. then a loop (or section if you will, since I use smarty) .. <input type="text" name="Array[data][dynamic index][data_field]" value=something dynamic>

    The 'dynamic index' is the smarty loop index variable, which counts up from 0.

    (Now, besides from the fact that someone already pointed out to me that $Array might not be a good choice for naming this thing, I haven't before found any problems relating to that so I'm going to try and find another solution first)

    In my .php file I loop over the data as such:

    for ($i = 0; $i < count($Array['data']); $i++) { // do stuff with data fields in $Array['data'][$i] }

    But all the data fields are, not there, not set I guess.

    Is there any reason for this?

    Alexander.

    attached mail follows:


    first take a look at the array, make sure all the ields really are there.

    print_r($Array);

    then loop through the array in a way that will allow or assosiative index's and numeric index's out of order.

    foreach ( $Array['data'] as $pos => $val ) echo "$val <br>";

    is everything there now ?

    --
    

    Chris Lee leemediawaveonline.com

    "Alexander Deruwe" <aderuwe.be> wrote in message news:20011010152938.B17B121725Ftartarus.telenet-ops.be... > Hewwo everyone, > > I'm having a problem with multidimensional form input arrays. Suppose there > is a form set up like this: > > .. some hidden input fields .. > <input type="hidden" name="Array[FileName]" value=something dynamic> > .. > > .. then a loop (or section if you will, since I use smarty) .. > <input type="text" name="Array[data][dynamic index][data_field]" > value=something dynamic> > > The 'dynamic index' is the smarty loop index variable, which counts up from 0. > > (Now, besides from the fact that someone already pointed out to me that > $Array might not be a good choice for naming this thing, I haven't before > found any problems relating to that so I'm going to try and find another > solution first) > > In my .php file I loop over the data as such: > > for ($i = 0; $i < count($Array['data']); $i++) > { > // do stuff with data fields in $Array['data'][$i] > } > > But all the data fields are, not there, not set I guess. > > Is there any reason for this? > > Alexander.

    attached mail follows:


    i want to delete the session when a user logouts.

    i just use session_destroy() to destroy the session. but i'm getting the following error : Warning: Trying to destroy uninitialized session in C:\Program Files\Apache Group\Apache\htdocs/sms/logout.php on line 2

    my script is :

    <? session_destroy() ?>

    how do i delete a session. i know session_unregiter will do. any other means ????

    /sagar

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

    attached mail follows:


    Hi You have to use session_start() before you use session_destroy() Like this <? session_start() session_destroy() ?> I think that will work

    Shimon

    "Sagar N Chand" <sagarchandyahoo.com> wrote in message news:001201c151a2$922cdcd0$ded0d6d2inferno... i want to delete the session when a user logouts.

    i just use session_destroy() to destroy the session. but i'm getting the following error : Warning: Trying to destroy uninitialized session in C:\Program Files\Apache Group\Apache\htdocs/sms/logout.php on line 2

    my script is :

    <? session_destroy() ?>

    how do i delete a session. i know session_unregiter will do. any other means ????

    /sagar

    attached mail follows:


    On Wed, 10 Oct 2001 21:12:51 +0530, you wrote:

    >i just use session_destroy() to destroy the session. but i'm getting the following error : >Warning: Trying to destroy uninitialized session in C:\Program Files\Apache Group\Apache\htdocs/sms/logout.php on line 2

    ><? >session_destroy() >?>

    >how do i delete a session.

    You have to tell the script you're using the session first. Try this:

    <? session_start(); session_destroy(); ?>

    djo

    attached mail follows:


    Hi,

    I am having a few users who have 'upgraded' to IE6 saying that they are being booted out to the main page of my site AFTER loggin in.

    They tell me that they have set IE6 to accept all cookies, but there is still a problem. Of course when ever they click on one of my menu options in the member area it checks to see who you are by using a session variable.

    I append =SID to all my strings, so actually if they move their IE6 slider to 'Accept No Cookies' the automatic feature of PHP kicks in and appends the SIDs to the URL's.

    This has really got me stumped as I seem to have no problem ( I even upgraded to IE6 to check it out ). out of my 2900+members only 2 are having these problems.

    Anyone heard anything about this? Or am I going crazy

    Peter Mail Meld http://www.mailmeld.com

    attached mail follows:


    I don't know anything about IE6 in this regard, sorry. However, when we had a similar problem where just 1 or 2 users out of hundreds were having problems, we tracked it to the fact that they had a bookmark set with an expired session ID as part of the bookmark url. You might want to verify that that isn't the problem here. Good luck!

    Kirk

    > Hi, > > I am having a few users who have 'upgraded' to IE6 saying > that they are > being booted out to the main page of my site AFTER loggin in. > > They tell me that they have set IE6 to accept all cookies, > but there is > still a problem. Of course when ever they click on one of my > menu options in > the member area it checks to see who you are by using a > session variable. > > I append =SID to all my strings, so actually if they move > their IE6 slider > to 'Accept No Cookies' the automatic feature of PHP kicks in > and appends the > SIDs to the URL's. > > This has really got me stumped as I seem to have no problem ( I even > upgraded to IE6 to check it out ). out of my 2900+members > only 2 are having > these problems. > php-list-adminlists.php.net

    attached mail follows:


    I have a script that needs several different submit "buttons" in a single form, and I need to have the script figure out which button they pushed. However, I am trying to make all of the buttons images, but am having trouble getting an image button carry a value with it... any ideas?

    this is what I have: the three submit buttons carry the correct value (ie, value5) with them to the $submit variable, but the three image buttons don't.

    ---------------------------------------------------------------------------- ------------------------------------------------------------- <form method="post" action="test.phtml"> <input type="image" src="blackdot2.jpg" width=20 height=20 value="value1" name="submit"> <input type="image" src="blackdot2.jpg" width=20 height=20 value="value2" name="submit"> <input type="image" src="blackdot2.jpg" width=20 height=20 value="value3" name="submit"> <input type="submit" value="value4" name="submit"> <input type="submit" value="value5" name="submit"> <input type="submit" value="value6" name="submit"> </form> <? echo $submit; ?> ---------------------------------------------------------------------------- -------------------------------------------------------------

    Thanks. brian

    attached mail follows:


    Great question, in faqt, it is frequently asked! ;)

    http://www.php.net/manual/en/faq.using.php#AEN63164

    Kirk

    > -----Original Message----- > From: Leone, Brian [mailto:brian.leonelmco.com] > Sent: Wednesday, October 10, 2001 9:33 AM > To: 'php-generallists.php.net' > Subject: [PHP] how to get different submit button values, when images? > > > I have a script that needs several different submit "buttons" > in a single > form, and I need to have the script figure out which button > they pushed. > However, I am trying to make all of the buttons images, but am having > trouble getting an image button carry a value with it... any ideas? > > this is what I have: the three submit buttons carry the > correct value (ie, > value5) with them to the $submit variable, but the three image buttons > don't. > > -------------------------------------------------------------- > -------------- > ------------------------------------------------------------- > <form method="post" action="test.phtml"> > <input type="image" src="blackdot2.jpg" width=20 height=20 > value="value1" > name="submit"> > <input type="image" src="blackdot2.jpg" width=20 height=20 > value="value2" > name="submit"> > <input type="image" src="blackdot2.jpg" width=20 height=20 > value="value3" > name="submit"> > <input type="submit" value="value4" name="submit"> > <input type="submit" value="value5" name="submit"> > <input type="submit" value="value6" name="submit"> > </form> > <? > echo $submit; > ?> > -------------------------------------------------------------- > -------------- > ------------------------------------------------------------- > > Thanks. > brian > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: > php-list-adminlists.php.net >

    attached mail follows:


    I got stumped with this before, and as soon as I tell you the answer, you'll say "oh crap, right, I forgot" haha.

    type=submit name=submit echo $submit

    type=image name=submit echo $submit_x echo $submit_y

    type=image doesnt return the value='' it returns the cord of the image when pressed. this is just how HTML works.

    if you want to find out what type=image was pressed you'll need to make an array

    type=image name=submit[0] type=image name=submit[1] type=image name=submit[2] if (isset($submit_x[0])) if (isset($submit_x[1])) if (isset($submit_x[2]))

    that 'should' work.

    --
    

    Chris Lee leemediawaveonline.com

    "Brian Leone" <brian.leonelmco.com> wrote in message news:0C73AA5F720CD311AC2A0008C7DBA9B405CB59E3emss09m13.ems.lmco.com... > I have a script that needs several different submit "buttons" in a single > form, and I need to have the script figure out which button they pushed. > However, I am trying to make all of the buttons images, but am having > trouble getting an image button carry a value with it... any ideas? > > this is what I have: the three submit buttons carry the correct value (ie, > value5) with them to the $submit variable, but the three image buttons > don't. > > -------------------------------------------------------------------------- -- > ------------------------------------------------------------- > <form method="post" action="test.phtml"> > <input type="image" src="blackdot2.jpg" width=20 height=20 value="value1" > name="submit"> > <input type="image" src="blackdot2.jpg" width=20 height=20 value="value2" > name="submit"> > <input type="image" src="blackdot2.jpg" width=20 height=20 value="value3" > name="submit"> > <input type="submit" value="value4" name="submit"> > <input type="submit" value="value5" name="submit"> > <input type="submit" value="value6" name="submit"> > </form> > <? > echo $submit; > ?> > -------------------------------------------------------------------------- -- > ------------------------------------------------------------- > > Thanks. > brian > >

    attached mail follows:


    Hi everyone,

    I am trying to pass a variable called $username to the next page. I do not want to use a session so I am using an Input type "hidden", but its not working. Can anyone tell me why and how to make it work?

    Thank you.

    <? session_start(); //session_register("username"); $db_name = "hpool";

    $connection = mysql_connect("localhost", "hpool", "cdi986") or die("Couldn't connect.");

    $db = mysql_select_db($db_name, $connection) or die("Couldn't select database.");

    $sql="SELECT users.accounts FROM users LEFT JOIN picks ON users.uid = picks.user_uid WHERE picks.user_uid IS NULL and users.killed ='off' and users.username = '$username' order by users.username ";

    $result = mysql_query($sql,$connection) or die("Couldn't execute query.");

    while ($row = mysql_fetch_array($result)) { $accounts = $row['accounts']; $option_block .= "<option value=\"$accounts\">$accounts</option>"; }

    $display_block = "

    <FORM METHOD=\"post\" ACTION=\"show_add_a_pick2.php\">

    <P><strong>User:</strong> <select name=\"accounts\"> $option_block </select>

    <INPUT TYPE=\"SUBMIT\" NAME=\"submit\" VALUE=\"Select this User\"></P>

    <INPUT TYPE="hidden" name="username" value="<? echo "$username"; ?>">

    </form>

    ";

    ?>

    <HTML> <HEAD> <TITLE>User Management: Add a Pick</TITLE> </HEAD> <BODY> <h1>User Management</h1> <h2><em>Add a Pick</em></h2> <P>Select an account from the list below to proceed.</p>

    <? echo "$display_block"; ?>

    <p><a href="contact_menu4.php" onmouseover="window.status='Return to Main Menu';return true;" target="">Return to Main Menu</a></p>

    </BODY> </HTML>

    attached mail follows:


    Jeremy Morano wrote:

    > $display_block = "

    ------8< SNIP 8>-------

    > <INPUT TYPE="hidden" name="username" value="<? echo "$username"; ?>">

    You're not escaping these quotes?

    -- 
                    _______      ___    _  ____  _____
    Chris Hobbs   / ____\ \    / / |  | |/ ___\|  __ \
    Head Geek    | (___  \ \  / /| |  | | (___ | |  | |
    WebMaster     \___ \  \ \/ / | |  | |\___ \| |  | |
    PostMaster    ____) |  \  /  | |__| |____) | |__| |
                   \____/    \/    \____/ \____/|_____/
                       http://www.silvervalley.k12.ca.us
                           chobbssilvervalley.k12.ca.us
    

    attached mail follows:


    First, you should try this :

    > <INPUT TYPE="hidden" name="username" value="<? echo "$username"; ?>">

    <INPUT TYPE=hidden name=username value=$username>

    Look differeces between both!

    Second, you have to put the submit after this, not before 'I think'.

    Andrea Hernandez Alfaro Dpto. Computo Universidad Latina de Costa Rica.

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    * nea * wrote:

    > First, you should try this :

    >><INPUT TYPE="hidden" name="username" value="<? echo "$username"; ?>">

    > <INPUT TYPE=hidden name=username value=$username> > > Look differeces between both!

    One significant difference would be in the case that $username == "Chris Hobbs" - you should definitely be wrapping values in tags with quotes (http://www.w3.org/TR/xhtml1/#diffs - see 4.4 in particular), although I would certainly be using single quotes or escaped doubles in this particular case.

    > Second, you have to put the submit after this, not before > 'I think'.

    This _shouldn't_ matter, as long as everything is wrapped up within <form>...</form>. That said, it wouldn't surprise me if some browsers mishandled it, and I usually put them before the submit just for aesthetic reasons - there just seems something wrong about adding values after the submit, even if the browser handles it correctly :).

    -- 
                    _______      ___    _  ____  _____
    Chris Hobbs   / ____\ \    / / |  | |/ ___\|  __ \
    Head Geek    | (___  \ \  / /| |  | | (___ | |  | |
    WebMaster     \___ \  \ \/ / | |  | |\___ \| |  | |
    PostMaster    ____) |  \  /  | |__| |____) | |__| |
                   \____/    \/    \____/ \____/|_____/
                       http://www.silvervalley.k12.ca.us
                           chobbssilvervalley.k12.ca.us
    

    attached mail follows:


    > -----Original Message----- > From: Jeremy Morano [mailto:jeremyprepresshelp.com] > Sent: Wednesday, October 10, 2001 11:08 AM > To: php-generallists.php.net > Subject: [PHP] hidden > > > Hi everyone, > > I am trying to pass a variable called $username to the next > page. I do not want to use a session so I am using an Input > type "hidden", but its not working. Can anyone tell me why > and how to make it work? > > Thank you. > > > <? > > [snip] > > $display_block = " > <FORM METHOD=\"post\" ACTION=\"show_add_a_pick2.php\"> > > <P><strong>User:</strong> > <select name=\"accounts\"> > $option_block > </select> > > <INPUT TYPE=\"SUBMIT\" NAME=\"submit\" VALUE=\"Select this User\"></P> > > <INPUT TYPE="hidden" name="username" value="<? echo "$username"; ?>"> > > </form> > "; > > ?>

    Have you tried viewing the contents of $display_block to make sure they're what you were expecting? Unless I'm missing something, you appear to be trying to open a PHP code block *inside* a PHP code block. Between that and the unescaped quotes, I'm surprised you're getting anything other than a parse error out of this snippet.

    ---
    Mark Roedel           | "The most overlooked advantage to owning a
    Systems Programmer    |  computer is that if they foul up there's no
    LeTourneau University |  law against whacking them around a little."
    Longview, Texas, USA  |                          -- Owen Porterfield 
    

    attached mail follows:


    > <INPUT TYPE="hidden" name="username" value="<? echo "$username"; ?>"> Do not use '<?' and '?>' cause You are allready in PHP. Do not use 'echo "$username";' cause 'echo' in string is sensless (unless You eval() it) and when You use echo, you do not have to enclose variables in "". You are in string so You should escape "" which have to be outputted. So use:

    <INPUT TYPE=\"hidden\" name=\"username\" value=\"$username\">

    or outside the string

    <INPUT TYPE="hidden" name="username" value="<? echo $username; ?>"> or <INPUT TYPE="hidden" name="username" value="<?= $username ?>">

    Kamil 'Hilarion' Nowicki

    attached mail follows:


    Hi There

    Has Anyone got php/corba working properly on a linux system?

    Any Help will be appreciated

    Thanks

    Niel Zeeman BTECH

    "I love deadlines.... I like the sound they make when they rush past"

    attached mail follows:


    Hi

    I am trying to use exec command (php4 + Win98 + apache).

    exec('c:\mydir\unzip myfile.zip -d c:\mydir\mydata\');

    I executes without errors but nothing is unzipped. When I run the same command from the dos prompt it unzips OK. c:\mydir and mydata are outside the httpdocs directory!

    I have over 300 .zip files which all contain a .mdb file with same table structure and same name. I wrote script that will read all of them (one by one) but wish to automate the unzipping process.

    Any ideas.

    Ajdin

    attached mail follows:


    first things first, whats the output from the command ?

    exec($command, $return); print_r($return);

    --
    

    Chris Lee leemediawaveonline.com

    "Ajdin Brandic" <abrandiccoventry.ac.uk> wrote in message news:Pine.OSF.3.91.1011010170328.9076A-100000leofric... > Hi > > I am trying to use exec command (php4 + Win98 + apache). > > exec('c:\mydir\unzip myfile.zip -d c:\mydir\mydata\'); > > I executes without errors but nothing is unzipped. When I run the same > command from the dos prompt it unzips OK. c:\mydir and mydata are > outside the httpdocs directory! > > I have over 300 .zip files which all contain a .mdb file with same table > structure and same name. I wrote script that will read all of them (one > by one) but wish to automate the unzipping process. > > Any ideas. > > Ajdin

    attached mail follows:


    you use

    exec("cmd /c c:\\mydir\\unzip myfile.zip -d c:\\mydir\\mydata");

    ----- Original Message ----- From: "AJDIN BRANDIC" <abrandiccoventry.ac.uk> To: <php-generallists.php.net> Sent: Thursday, October 11, 2001 2:12 AM Subject: [PHP] exec

    > Hi > > I am trying to use exec command (php4 + Win98 + apache). > > exec('c:\mydir\unzip myfile.zip -d c:\mydir\mydata\'); > > I executes without errors but nothing is unzipped. When I run the same > command from the dos prompt it unzips OK. c:\mydir and mydata are > outside the httpdocs directory! > > I have over 300 .zip files which all contain a .mdb file with same table > structure and same name. I wrote script that will read all of them (one > by one) but wish to automate the unzipping process. > > Any ideas. > > Ajdin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    1. Put pkzip into path (c:\winnt c:\windows) 2. exec('pkzip -add arh.zip');

    _-----

    Hi

    I am trying to use exec command (php4 + Win98 + apache).

    exec('c:\mydir\unzip myfile.zip -d c:\mydir\mydata\');

    I executes without errors but nothing is unzipped. When I run the same command from the dos prompt it unzips OK. c:\mydir and mydata are outside the httpdocs directory!

    I have over 300 .zip files which all contain a .mdb file with same table structure and same name. I wrote script that will read all of them (one by one) but wish to automate the unzipping process.

    Any ideas.

    Ajdin

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    Hello!

    I know it's not a proper list to ask this question, but I need help quick, so please.... What is a C/C++ function to check username / userid (UID) of the one, who executed the program? (Under Linux system.) Eventually what is the name of system command to check the user?

    Kamil 'Hilarion' Nowicki

    attached mail follows:


    getuid() getpid() for the process. getgid

    also with set(setgid()) but if have the rights

    -- 
    Andrey Hristov
    Web Developer
    IcyGEN Corporation
    BALANCED SOLUTIONS
    http://www.icygen.com
    

    On Wednesday 10 October 2001 19:41, you wrote: > Hello! > > I know it's not a proper list to ask this question, but > I need help quick, so please.... > What is a C/C++ function to check username / userid (UID) > of the one, who executed the program? (Under Linux system.) > Eventually what is the name of system command to check > the user? > > Kamil 'Hilarion' Nowicki

    attached mail follows:


    Hi all, I have a site at http://www.somehost.com with an index.html page as a starting point. This page have a form with a input text for login and a password input for password, when I click on the 'submit' button then I do a POST for a /secure/check_user.php file which look up this info in a mysql database, if the login and password aren't valid I do a header('HTTP/1.0 401 Unauthorized') call and a box appear asking for login and passowrd, but if the login and password are valid, then I do a header('Location: main.php') call to access the main menu. /secure/ is a .htaccess protected directory but when I get this page a box prompt me for a login and password values, so my cuestion is, how can pass the values of the text boxes of index.html directly to Apache so Apache don't ask me for them? I need a secure directory with apache so unauthorized people can't reach files directly like images o plain text files.

    And a second question: after I get access to /secure/ I want to enable a 'Logout' button, because if I return to the index.html page and I put another login and password, even an invalid one I still login as the first person. Thank's for your help.

    -- 
    Mauricio Téllez Jiménez
    Seguimiento Técnico EDUMEXICO
    edumexicospeedy.coacade.uv.mx
    edumexicospeedy.uv.mx
    edumexicoterra.com.mx
    Zamora No. 25, Col. Centro
    C.P. 91000, Xalapa, Ver.
    Tel. 52(28)17-86-87, 17-73-80
    Fax. 52(28)18-64-13
    

    -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org

    iD8DBQE7xHKwt5EzMv51BrsRAtSFAKCmCUMaAD/1opMf6bneFStSDnnJ3gCeKtnJ DCIIwNWtHx7xQpA/fJwrZ0k= =SW2G -----END PGP SIGNATURE-----

    attached mail follows:


    There is a module for APAche for authorization using user/passes stored in mysql. Maybe that will suit your needs.

    -- 
    Andrey Hristov
    Web Developer
    IcyGEN Corporation
    BALANCED SOLUTIONS
    http://www.icygen.com
    

    On Wednesday 10 October 2001 19:09, you wrote: > Hi all, I have a site at http://www.somehost.com with an index.html page as > a starting point. This page have a form with a input text for login and a > password input for password, when I click on the 'submit' button then I do > a POST for a /secure/check_user.php file which look up this info in a mysql > database, if the login and password aren't valid I do a header('HTTP/1.0 > 401 Unauthorized') call and a box appear asking for login and passowrd, but > if the login and password are valid, then I do a header('Location: > main.php') call to access the main menu. /secure/ is a .htaccess protected > directory but when I get this page a box prompt me for a login and password > values, so my cuestion is, how can pass the values of the text boxes of > index.html directly to Apache so Apache don't ask me for them? I need a > secure directory with apache so unauthorized people can't reach files > directly like images o plain text files. > > And a second question: after I get access to /secure/ I want to enable a > 'Logout' button, because if I return to the index.html page and I put > another login and password, even an invalid one I still login as the first > person. Thank's for your help.

    ---------------------------------------- Content-Type: application/pgp-signature; charset="iso-8859-1"; name="Attachment: 1" Content-Transfer-Encoding: 7bit Content-Description: ----------------------------------------

    attached mail follows:


    Sorry, I forget to tell you that I use that module. Cheers.

    Andrey Hristov wrote:

    > There is a module for APAche for authorization using user/passes stored in > mysql. Maybe that will suit your needs. > > -- > Andrey Hristov > Web Developer > IcyGEN Corporation > BALANCED SOLUTIONS > http://www.icygen.com > > On Wednesday 10 October 2001 19:09, you wrote: > > Hi all, I have a site at http://www.somehost.com with an index.html page as > > a starting point. This page have a form with a input text for login and a > > password input for password, when I click on the 'submit' button then I do > > a POST for a /secure/check_user.php file which look up this info in a mysql > > database, if the login and password aren't valid I do a header('HTTP/1.0 > > 401 Unauthorized') call and a box appear asking for login and passowrd, but > > if the login and password are valid, then I do a header('Location: > > main.php') call to access the main menu. /secure/ is a .htaccess protected > > directory but when I get this page a box prompt me for a login and password > > values, so my cuestion is, how can pass the values of the text boxes of > > index.html directly to Apache so Apache don't ask me for them? I need a > > secure directory with apache so unauthorized people can't reach files > > directly like images o plain text files. > > > > And a second question: after I get access to /secure/ I want to enable a > > 'Logout' button, because if I return to the index.html page and I put > > another login and password, even an invalid one I still login as the first > > person. Thank's for your help. > > ---------------------------------------- > Content-Type: application/pgp-signature; charset="iso-8859-1"; > name="Attachment: 1" > Content-Transfer-Encoding: 7bit > Content-Description: > ---------------------------------------- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    --
    Maribel Barradas Landa
    Asistente de la Coordinación del Proyecto EDUMEXICO
    Tel. (28) 17 86 87 y 17 73 80
    Fax: (28) 18 64 13
    

    attached mail follows:


    Hi ! i know that this is a off-topic question, but can anyone tell me is it worth making a completely new site, since the netscape does not display it the way it should look like ... What is the procentage of browser users anyway ?

    attached mail follows:


    Netscape users are up to 10% of the traffic. But there are so many versions of communicator 4.x so....

    -- 
    Andrey Hristov
    Web Developer
    IcyGEN Corporation
    BALANCED SOLUTIONS
    http://www.icygen.com
    

    On Wednesday 10 October 2001 08:06, you wrote: > Hi ! > i know that this is a off-topic question, but can anyone tell me is it > worth making a completely new site, since the netscape does not display it > the way it should look like ... > What is the procentage of browser users anyway ?

    attached mail follows:


    On Wed, 10 Oct 2001 07:06:51 +0200, Nikola Veber wrote: >Hi ! >i know that this is a off-topic question, but can anyone tell me is >it worth making a >completely new site, since the netscape does not display it the way >it should look like >.... >What is the procentage of browser users anyway ? > > >

    Basically if your tables look different across different browsers there's something wrong with them. The main problem is the size of text fields and text areas being different. here's my suggestion of how to get around this:

    use size attribute and css. IE4+ and NN6.1 will ignore size and pay attention to the css and NN4 will ignore css and use the size attribute.

    for example: <input type=text size=15 style="width: 20em"> (size should be a little smaller than them em value)

    if that doesn't help, let us know what the specific problem is.

    -- 
    Mark, maggeletmminternet.com on 10/09/2001
    

    attached mail follows:


    Nikola Veber wrote:

    > Hi ! > i know that this is a off-topic question, but can anyone tell me is it worth making a > completely new site, since the netscape does not display it the way it should look like > ... > What is the procentage of browser users anyway ?

    <rant mode='light'> While IE is clearly the dominant browser (Anywhere from 75% to 90%, depending on whose stats you're looking at - and that includes all variations of IE, not just 5.x+), that still leaves a significant population using something else (not just Netscape, but also Opera, Mozilla, Lynx, text based readers for the blind, etc.).

    So you need to make a decision. Let's say you have the potential of 1000 visitors per day to your site - do you really want to alienate 100-250 (or more, if you're specifically targetting IE5+) of those users based on the browser they choose to visit with?

    I peronally use Mozilla, even on Windows. I'm only going to fire up IE if there's a _really_ good reason to do so (Dell's customization forms for computer quotes being one really annoying example - bad Dell :/). Unless you're positive that your content is so compelling that you'll make people switch browsers and/or operating systems, figure out how to get your message across without IE specific web design.

    </rant>

    -- 
                    _______      ___    _  ____  _____
    Chris Hobbs   / ____\ \    / / |  | |/ ___\|  __ \
    Head Geek    | (___  \ \  / /| |  | | (___ | |  | |
    WebMaster     \___ \  \ \/ / | |  | |\___ \| |  | |
    PostMaster    ____) |  \  /  | |__| |____) | |__| |
                   \____/    \/    \____/ \____/|_____/
                       http://www.silvervalley.k12.ca.us
                           chobbssilvervalley.k12.ca.us
    

    attached mail follows:


    speaking of browsers, does anyone have a quick browser detection script I can pilfer ? I basically just need to load different css for different browsers and I'm feeling incredibly lazy

    Thanks,

    Jerry Lake Interface Engineering Technician

    attached mail follows:


    Browse mailing archive of August on www.phpbuilder.net for "CBrowser"(i think that is the name of the class name I posted here). If you don't find it, drop a letter. I'll send it to you.

    -- 
    Andrey Hristov
    Web Developer
    IcyGEN Corporation
    BALANCED SOLUTIONS
    http://www.icygen.com
    available for projects on http://www.elance.com
    

    On Wednesday 10 October 2001 21:14, you wrote: > speaking of browsers, does anyone > have a quick browser detection script > I can pilfer ? I basically just need > to load different css for different browsers > and I'm feeling incredibly lazy > > Thanks, > > Jerry Lake > Interface Engineering Technician

    attached mail follows:


    On Wednesday 10 October 2001 10:34, Chris Hobbs wrote: > Nikola Veber wrote: > > Hi ! > > i know that this is a off-topic question, but can anyone tell me is it > > worth making a completely new site, since the netscape does not display > > it the way it should look like ... > > What is the procentage of browser users anyway ? > > <rant mode='light'> > While IE is clearly the dominant browser (Anywhere from 75% to 90%, > depending on whose stats you're looking at - and that includes all > variations of IE, not just 5.x+), that still leaves a significant > population using something else (not just Netscape, but also Opera, > Mozilla, Lynx, text based readers for the blind, etc.). > > So you need to make a decision. Let's say you have the potential of 1000 > visitors per day to your site - do you really want to alienate 100-250 > (or more, if you're specifically targetting IE5+) of those users based > on the browser they choose to visit with? > > I peronally use Mozilla, even on Windows. I'm only going to fire up IE > if there's a _really_ good reason to do so (Dell's customization forms > for computer quotes being one really annoying example - bad Dell :/). > Unless you're positive that your content is so compelling that you'll > make people switch browsers and/or operating systems, figure out how to > get your message across without IE specific web design. > > </rant>

    I'm with you 100%! I rarely use IE any version, only for testing purposes. I also only use MS Windoze at work, rarely at home. I the web site has any commercial application, then it has to be (IMHO) fully cross browser compatible. I know my company would not allow anything less. When there is money to be made you've gotta provide the widest base possible, you can't limit the site to just certain browsers.

    --
    Chip 
    

    attached mail follows:


    Hello All:

    It seems that there is a common theme on the list with session handling right now. Unfortunately, this post is no different.

    I have a single script that calls itself ($PHPSELF) for authentication against a MySQL database. I can register session variables and print the values, but when I reload the page it seems as if the values are lost. Code Follows.

    TIA,

    Chesley

    <? /* <snip> */

    session_start();

    session_register('UserID'); session_register('CID'); session_register('Status');

    // Tried this also with no better result // $HTTP_SESSION_VARS["UserID"]=$row["UserName"]; // $HTTP_SESSION_VARS["CID"]=$row["CustID"]; // $HTTP_SESSION_VARS["StatID"]=$row["StatID"];

    $UserID=$row["UserName"]; $CID=$row["CustID"]; $StatID=$row["$Status"];

    // This works, so I know there is data in the $row array echo $row["UserName"]; echo $row["CustID"]; echo $row["StatID"];

    header ("Location: $PHPSELF?SID");

    /* <snip> */

    // After the script calls itself I check for $PHPSESSID then do something. if ($PHPSESSID) { session_start(); htmlheader(); // for debug purposes echo "Testing to make sure the conditional was true...It was."; // Does not print anything... while (list($var, $value) = each($HTTP_SESSION_VARS)) { echo "$var = $value<br>\n"; } htmlfooter(); }

    /* <snip> */ ?>

    attached mail follows:


    ok two things I see, create the vars then register them, not visa versa.

    $UserID=$row["UserName"]; $CID=$row["CustID"]; $StatID=$row["$Status"]; session_register('UserID'); session_register('CID'); session_register('Status');

    second, your not sending the SID as you think you are.

    header ("Location: $PHPSELF?". SID);

    even better is make sure SID is accually set, if cookies are being used SID wont be set.

    $PHPSESSID = session_id(); $SID = "PHPSESSID=$PHPSESSID"; header ("Location: $PHPSELF?$SID");

    try that.

    --
    

    Chris Lee leemediawaveonline.com

    "Chesley A Windon" <windonorthus.net> wrote in message news:Pine.LNX.4.33.0110101216450.8139-100000oak.autus.lan... > Hello All: > > It seems that there is a common theme on the list with session handling > right now. Unfortunately, this post is no different. > > I have a single script that calls itself ($PHPSELF) for authentication > against a MySQL database. I can register session variables and print the > values, but when I reload the page it seems as if the values are lost. > Code Follows. > > TIA, > > Chesley > > > <? > /* <snip> */ > > session_start(); > > session_register('UserID'); > session_register('CID'); > session_register('Status'); > > // Tried this also with no better result > // $HTTP_SESSION_VARS["UserID"]=$row["UserName"]; > // $HTTP_SESSION_VARS["CID"]=$row["CustID"]; > // $HTTP_SESSION_VARS["StatID"]=$row["StatID"]; > > $UserID=$row["UserName"]; > $CID=$row["CustID"]; > $StatID=$row["$Status"]; > > // This works, so I know there is data in the $row array > echo $row["UserName"]; > echo $row["CustID"]; > echo $row["StatID"]; > > header ("Location: $PHPSELF?SID"); > > /* <snip> */ > > // After the script calls itself I check for $PHPSESSID then do something. > if ($PHPSESSID) { > session_start(); > htmlheader(); > // for debug purposes > echo "Testing to make sure the conditional was true...It was."; > // Does not print anything... > while (list($var, $value) = each($HTTP_SESSION_VARS)) { > echo "$var = $value<br>\n"; > } > htmlfooter(); > } > > /* <snip> */ > ?> > >

    attached mail follows:


    Ok, I don't have a clue what is happening here.

    I have a script, works perfectly fine. I copy that script to another directory, that script will allways fail with a segmentation fault(11).

    What is going on? Why would it suddenly not work? There is nothing directory specific about the script, I can copy it to a different dir again and suddenly it will work in that dir.

    ARRRRGGHHHHHHH!

    attached mail follows:


    The permissions are fine.

    ----- Original Message ----- From: "ArsenKirillov" <softmipm.lviv.ua> To: "PHP List" <php_listibcnetwork.net> Sent: Wednesday, October 10, 2001 12:29 PM Subject: RE: [PHP] What the ?

    > ARRRRGGHHHHHHH! is not correct - chmod is correct :-))) > > > Ok, > I don't have a clue what is happening here. > > I have a script, works perfectly fine. > I copy that script to another directory, that script will allways fail with > a segmentation fault(11). > > What is going on? Why would it suddenly not work? There is nothing directory > specific about the script, I can copy it to a different dir again and > suddenly it will work in that dir. > > ARRRRGGHHHHHHH! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    ok, here's a story

    "when I start my car it works, but when I drive it to another part of town, then try and start it, it wont start, why ? "

    get the drift, wheres the code ? send us the code snippits and we'll see what we can do.

    --
    

    Chris Lee leemediawaveonline.com

    "Php List" <php_listibcnetwork.net> wrote in message news:0b6101c151b8$81ecb2d0$01c8c8c8ibcserver.local... > Ok, > I don't have a clue what is happening here. > > I have a script, works perfectly fine. > I copy that script to another directory, that script will allways fail with > a segmentation fault(11). > > What is going on? Why would it suddenly not work? There is nothing directory > specific about the script, I can copy it to a different dir again and > suddenly it will work in that dir. > > ARRRRGGHHHHH