OSEC

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

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

    php-general Digest 30 Jan 2003 10:44:43 -0000 Issue 1853

    Topics (messages 133557 through 133621):

    Re: Form Variables not getting passed || Apache, MySql, Win 2k Setup
            133557 by: Leif K-Brooks
            133558 by: Philip Olson
            133559 by: Ernest E Vogelsinger
            133562 by: Noah
            133563 by: Noah
            133564 by: Ernest E Vogelsinger
            133565 by: Jim Lucas
            133566 by: Jason Wong
            133567 by: Noah
            133568 by: Ernest E Vogelsinger
            133571 by: Jim Lucas
            133586 by: Noah
            133587 by: Noah
            133589 by: John W. Holmes
            133590 by: Philip Olson

    PHP 4.1.2 session problem
            133560 by: Alex Shi

    strange behaviour with 4.3.0 : warning of an unspecified open_basedir
            133561 by: Robert Mena

    Shared object/component equivalent on *nix
            133569 by: Luke Woollard

    Using Pear Auth
            133570 by: joshmccormack.travelersdiary.com
            133572 by: John W. Holmes
            133597 by: Josh McCormack

    Re: content type header for downloading files
            133573 by: Dara Dowd
            133574 by: John W. Holmes
            133575 by: Dara Dowd
            133603 by: Evan Nemerson
            133613 by: Ernest E Vogelsinger

    if (a == b) ...
            133576 by: Webapprentice
            133577 by: David Freeman
            133580 by: Johannes Schlueter
            133582 by: Cal Evans
            133584 by: Webapprentice
            133585 by: Lee Herron
            133614 by: Ernest E Vogelsinger

    Re: Functions and arguments
            133578 by: R0x0r Mc0wnage
            133579 by: Matt
            133581 by: R0x0r Mc0wnage

    Re: Advice on uploaded files
            133583 by: Jason Sheets

    Random "open_basedir" errors
            133588 by: Chris Cameron

    Best PHP db wrapper?
            133591 by: John Wells
            133593 by: John W. Holmes

    Re: Using custom "button" form element instead of standard "submit"?
            133592 by: Durwood Gafford
            133594 by: Philip Olson

    __PHP_Incomplete_Class Object
            133595 by: Weston Houghton
            133596 by: Philip Hallstrom
            133618 by: Ernest E Vogelsinger

    Is there a bug in fopen() and fsockopen()?
            133598 by: zlu tarch

    Use Pop3
            133599 by: Christian Ista
            133606 by: Jason Wong
            133621 by: Chris Hayes

    Register globals on and off
            133600 by: Davy Obdam

    Problem with xml_parse_into_struct
            133601 by: Phil Powell
            133602 by: Davy Obdam

    Re:[PHP] Register globals on and off
            133604 by: Daniel Leighton

    Re: Is there a bug in fopen() - solved, maybe
            133605 by: zlu tarch
            133616 by: Ernest E Vogelsinger

    iis 5.0 question
            133607 by: Dale
            133609 by: Jason Wong

    Re: domxml memberfunction not dom compliant??
            133608 by: SLanger.spirit21.de
            133611 by: Øyvind Vestavik

    Context
            133610 by: Boaz Yahav

    quick question
            133612 by: Dale
            133615 by: Ernest E Vogelsinger
            133617 by: Jason Wong

    Re: Remembering which option in a SELECT tag the user had chosen
            133619 by: Paul

    Please...
            133620 by: Øyvind Vestavik

    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:


    Mind giving a code snippet?

    Noah wrote:

    >Thanks for the pleasant acronym, Leif.
    >
    >However, setting register_globals on or off makes no difference. The
    >variables are still not getting evaluated........
    >
    >BTW works fine on my laptop (Apache, MySql, Linux)
    >
    >--Noah
    >
    >----- Original Message -----
    >From: "Leif K-Brooks" <eurleifbuyer-brokerage.com>
    >To: "CF High" <noahnewminddesign.com>; <php-generallists.php.net>
    >Sent: Wednesday, January 29, 2003 1:38 PM
    >Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
    >2k Setup
    >
    >
    >
    >
    >>RTFM! Your problem is register_globals.
    >>
    >>CF High wrote:
    >>
    >>
    >>
    >>>Hey all.
    >>>
    >>>This driving me nuts:
    >>>
    >>> I've got Apache, MySql, and Windows 2000 running on my local machine.
    >>>In order to get passed php variables evaluated, whether via a url query
    >>>string, or through a form post, I have to use this syntax:
    >>>
    >>>$_REQUEST[$my_passed_variable]
    >>>
    >>>I have no such problem with our hosting company servers; i.e. I can
    >>>
    >>>
    >access
    >
    >
    >>>query_string and form posted variables as $my_passed_variable.
    >>>
    >>>What is going on here? Is there something in php.ini that needs to be
    >>>adjusted?
    >>>
    >>>Any help whatsoever here is much appreciated,
    >>>
    >>>--Noah
    >>>
    >>>--
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>--
    >>The above message is encrypted with double rot13 encoding. Any
    >>
    >>
    >unauthorized attempt to decrypt it will be prosecuted to the full extent of
    >the law.
    >
    >
    >>
    >>
    >>
    >
    >
    >
    >

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

    attached mail follows:


    One too many $'s in your code, use:

    $_REQUEST['my_passed_variable']

    This is how all arrays work, autoglobals are the same. See also:

    http://www.php.net/variables.external http://www.php.net/variables.predefined

    Regards, Philip

    On Wed, 29 Jan 2003, CF High wrote:

    > Hey all. > > This driving me nuts: > > I've got Apache, MySql, and Windows 2000 running on my local machine. > In order to get passed php variables evaluated, whether via a url query > string, or through a form post, I have to use this syntax: > > $_REQUEST[$my_passed_variable] > > I have no such problem with our hosting company servers; i.e. I can access > query_string and form posted variables as $my_passed_variable. > > What is going on here? Is there something in php.ini that needs to be > adjusted? > > Any help whatsoever here is much appreciated, > > --Noah > > -- > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    At 01:36 30.01.2003, CF High said: --------------------[snip]-------------------- >However, setting register_globals on or off makes no difference. The >variables are still not getting evaluated........ --------------------[snip]--------------------

    I _BET_ it's register_globals. Did you restart the webserver in case PHP is loaded as a module?

    Anyway: it's a lot safer having register_globals set to "off" (see http://www.php.net/manual/en/security.registerglobals.php#security.registerg lobals for a discussion on security issues).

    For example, assuming that a certain cookie value is available, with register_globals on this value may be forged by passing the value as part of the url. A lot of different possibilities arise.

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    Yup. Restarted Apache.

    PHP's still not evaluating the passed form vars whether register globals is set to On or Off........

    --Noah

    ----- Original Message ----- From: "Ernest E Vogelsinger" <ernestvogelsinger.at> To: "CF High" <noahnewminddesign.com> Cc: <php-generallists.php.net> Sent: Wednesday, January 29, 2003 2:23 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

    > At 01:36 30.01.2003, CF High said: > --------------------[snip]-------------------- > >However, setting register_globals on or off makes no difference. The > >variables are still not getting evaluated........ > --------------------[snip]-------------------- > > I _BET_ it's register_globals. > Did you restart the webserver in case PHP is loaded as a module? > > Anyway: it's a lot safer having register_globals set to "off" (see > http://www.php.net/manual/en/security.registerglobals.php#security.registerg > lobals for a discussion on security issues). > > For example, assuming that a certain cookie value is available, with > register_globals on this value may be forged by passing the value as part > of the url. A lot of different possibilities arise. > > > -- > >O Ernest E. Vogelsinger > (\) ICQ #13394035 > ^ http://www.vogelsinger.at/ > >

    attached mail follows:


    I don't want to use $_REQUEST['my_passed_variable'] at all.

    Right now when I do an sql insert on my local machine I have to use the following syntax:

    INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3'])

    I just want to use $var1, $var2, $var3

    --Noah

    ----- Original Message ----- From: "Philip Olson" <philipcornado.com> To: "CF High" <noahnewminddesign.com> Cc: <php-generallists.php.net> Sent: Wednesday, January 29, 2003 2:23 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

    > > One too many $'s in your code, use: > > $_REQUEST['my_passed_variable'] > > This is how all arrays work, autoglobals are the same. > See also: > > http://www.php.net/variables.external > http://www.php.net/variables.predefined > > Regards, > Philip > > On Wed, 29 Jan 2003, CF High wrote: > > > Hey all. > > > > This driving me nuts: > > > > I've got Apache, MySql, and Windows 2000 running on my local machine. > > In order to get passed php variables evaluated, whether via a url query > > string, or through a form post, I have to use this syntax: > > > > $_REQUEST[$my_passed_variable] > > > > I have no such problem with our hosting company servers; i.e. I can access > > query_string and form posted variables as $my_passed_variable. > > > > What is going on here? Is there something in php.ini that needs to be > > adjusted? > > > > Any help whatsoever here is much appreciated, > > > > --Noah > > > > -- > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    At 02:48 30.01.2003, Noah said: --------------------[snip]-------------------- >Yup. Restarted Apache. > >PHP's still not evaluating the passed form vars whether register globals is >set to On or Off........ --------------------[snip]--------------------

    Just thinking the unthinkable...

    Most of the time, default settings are commented out in php.ini, like this: ; register_globals = Off

    I fell into this trap sometimes by overseeing the semicolon and simply changing the value with no effect whatsoever. Would you mind to take a look?

    If this isn't the case here I don't have a clue as to what's going on...

    Did you mention the version? Possibly there's a special build here that never allows to register globals? (config gurus chime in here please)

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    then run extract($_REQUEST); just above where you want to use the var1 var2... and it will place all the key => value pairs into the local scope.

    Jim ----- Original Message ----- From: "Noah" <noahnewminddesign.com> To: "Philip Olson" <philipcornado.com> Cc: <php-generallists.php.net> Sent: Wednesday, January 29, 2003 5:55 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

    > I don't want to use $_REQUEST['my_passed_variable'] at all. > > Right now when I do an sql insert on my local machine I have to use the > following syntax: > > INSERT into tablename (field name list) > VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) > > I just want to use $var1, $var2, $var3 > > --Noah > > ----- Original Message ----- > From: "Philip Olson" <philipcornado.com> > To: "CF High" <noahnewminddesign.com> > Cc: <php-generallists.php.net> > Sent: Wednesday, January 29, 2003 2:23 PM > Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win > 2k Setup > > > > > > One too many $'s in your code, use: > > > > $_REQUEST['my_passed_variable'] > > > > This is how all arrays work, autoglobals are the same. > > See also: > > > > http://www.php.net/variables.external > > http://www.php.net/variables.predefined > > > > Regards, > > Philip > > > > On Wed, 29 Jan 2003, CF High wrote: > > > > > Hey all. > > > > > > This driving me nuts: > > > > > > I've got Apache, MySql, and Windows 2000 running on my local > machine. > > > In order to get passed php variables evaluated, whether via a url query > > > string, or through a form post, I have to use this syntax: > > > > > > $_REQUEST[$my_passed_variable] > > > > > > I have no such problem with our hosting company servers; i.e. I can > access > > > query_string and form posted variables as $my_passed_variable. > > > > > > What is going on here? Is there something in php.ini that needs to be > > > adjusted? > > > > > > Any help whatsoever here is much appreciated, > > > > > > --Noah > > > > > > -- > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    On Thursday 30 January 2003 09:55, Noah wrote: > I don't want to use $_REQUEST['my_passed_variable'] at all. > > Right now when I do an sql insert on my local machine I have to use the > following syntax: > > INSERT into tablename (field name list) > VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) > > I just want to use $var1, $var2, $var3

    Are you trying to use these inside a function? If so, look up variable scope in the manual.

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

    /* Most people have a mind that's open by appointment only. */

    attached mail follows:


    Sure.

    In the code below, class_type is passed in the query_string (e.g. index.php?section_id=12&page_type=class_submit&class_type=apartments)

    Also, below sql values are sent via a post.

    ************ Code Snippet ***************

    switch($_REQUEST['class_type']) { case 'apartments'; dbConnect("INSERT into c_apart_data (submit_date, apart_type_id, location, bedrooms, rent, heat, lease, deposit, pets, phone, email, blurb) Values('$submit_date', '$apart_type_id', '$location', '$bedrooms', '$rent', '$heat', '$lease', '$deposit', '$pets', '$phone', '$email', '$blurb')"); break;

    more code................

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

    Let me know if you need more info,

    --Noah

    ----- Original Message ----- From: Leif K-Brooks To: Noah Cc: php-generallists.php.net Sent: Wednesday, January 29, 2003 2:19 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

    Mind giving a code snippet?

    Noah wrote:

    Thanks for the pleasant acronym, Leif.

    However, setting register_globals on or off makes no difference. The variables are still not getting evaluated........

    BTW works fine on my laptop (Apache, MySql, Linux)

    --Noah

    ----- Original Message ----- From: "Leif K-Brooks" mailto:<eurleifbuyer-brokerage.com To: "CF High" mailto:<noahnewminddesign.com; mailto:<php-generallists.php.net Sent: Wednesday, January 29, 2003 1:38 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

    RTFM! Your problem is register_globals.

    CF High wrote:

    Hey all.

    This driving me nuts:

    I've got Apache, MySql, and Windows 2000 running on my local machine. In order to get passed php variables evaluated, whether via a url query string, or through a form post, I have to use this syntax:

    $_REQUEST[$my_passed_variable]

    I have no such problem with our hosting company servers; i.e. I can access query_string and form posted variables as $my_passed_variable.

    What is going on here? Is there something in php.ini that needs to be adjusted?

    Any help whatsoever here is much appreciated,

    --Noah

    --
    

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

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

    attached mail follows:


    At 02:55 30.01.2003, Noah said: --------------------[snip]-------------------- >I don't want to use $_REQUEST['my_passed_variable'] at all. > >Right now when I do an sql insert on my local machine I have to use the >following syntax: > >INSERT into tablename (field name list) >VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) > >I just want to use $var1, $var2, $var3 --------------------[snip]--------------------

    You can always resort to extract($_REQUEST);

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    why would it matter if he does it just above the place that he is going to use them?

    doesn't matter if he is in a function or not. the $_REQUEST var will always be available.

    if he calls a function then he would have to do it just inside the function or pass it to the function.

    Jim ----- Original Message ----- From: "Jason Wong" <php-generalgremlins.biz> To: <php-generallists.php.net> Sent: Wednesday, January 29, 2003 2:59 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

    > On Thursday 30 January 2003 09:55, Noah wrote: > > I don't want to use $_REQUEST['my_passed_variable'] at all. > > > > Right now when I do an sql insert on my local machine I have to use the > > following syntax: > > > > INSERT into tablename (field name list) > > VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) > > > > I just want to use $var1, $var2, $var3 > > Are you trying to use these inside a function? If so, look up variable scope > in the manual. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Most people have a mind that's open by appointment only. > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Checked out the php.ini file.

    register_globals is set to On -- there is no semicolon or other character that would cause a problem.

    This might be a problem with the Apache, Win2k combination -- I don't know..........

    --Noah

    ----- Original Message ----- From: "Ernest E Vogelsinger" <ernestvogelsinger.at> To: "Noah" <noahnewminddesign.com> Cc: <php-generallists.php.net> Sent: Wednesday, January 29, 2003 2:55 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

    > At 02:48 30.01.2003, Noah said: > --------------------[snip]-------------------- > >Yup. Restarted Apache. > > > >PHP's still not evaluating the passed form vars whether register globals is > >set to On or Off........ > --------------------[snip]-------------------- > > Just thinking the unthinkable... > > Most of the time, default settings are commented out in php.ini, like this: > ; register_globals = Off > > I fell into this trap sometimes by overseeing the semicolon and simply > changing the value with no effect whatsoever. Would you mind to take a look? > > If this isn't the case here I don't have a clue as to what's going on... > > Did you mention the version? Possibly there's a special build here that > never allows to register globals? (config gurus chime in here please) > > > -- > >O Ernest E. Vogelsinger > (\) ICQ #13394035 > ^ http://www.vogelsinger.at/ > >

    attached mail follows:


    Hmmmm.........

    Sounds like "resorting" to extract($REQUEST) might have a downside?

    Otherwise, I'll use it for now.

    Thanks,

    --Noah

    ----- Original Message ----- From: "Ernest E Vogelsinger" <ernestvogelsinger.at> To: "Noah" <noahnewminddesign.com> Cc: "Philip Olson" <philipcornado.com>; <php-generallists.php.net> Sent: Wednesday, January 29, 2003 2:58 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

    > At 02:55 30.01.2003, Noah said: > --------------------[snip]-------------------- > >I don't want to use $_REQUEST['my_passed_variable'] at all. > > > >Right now when I do an sql insert on my local machine I have to use the > >following syntax: > > > >INSERT into tablename (field name list) > >VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) > > > >I just want to use $var1, $var2, $var3 > --------------------[snip]-------------------- > > You can always resort to > extract($_REQUEST); > > > -- > >O Ernest E. Vogelsinger > (\) ICQ #13394035 > ^ http://www.vogelsinger.at/ > >

    attached mail follows:


    You never answered if this was in a function or class method. Is it? Did you say whether it was Apache 1 or 2?

    ---John W. Holmes...

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

    > -----Original Message----- > From: Noah [mailto:noahnewminddesign.com] > Sent: Thursday, January 30, 2003 12:35 AM > To: Ernest E Vogelsinger > Cc: Philip Olson; php-generallists.php.net > Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win > 2k Setup > > Hmmmm......... > > Sounds like "resorting" to extract($REQUEST) might have a downside? > > Otherwise, I'll use it for now. > > Thanks, > > --Noah > > > ----- Original Message ----- > From: "Ernest E Vogelsinger" <ernestvogelsinger.at> > To: "Noah" <noahnewminddesign.com> > Cc: "Philip Olson" <philipcornado.com>; <php-generallists.php.net> > Sent: Wednesday, January 29, 2003 2:58 PM > Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win > 2k Setup > > > > At 02:55 30.01.2003, Noah said: > > --------------------[snip]-------------------- > > >I don't want to use $_REQUEST['my_passed_variable'] at all. > > > > > >Right now when I do an sql insert on my local machine I have to use the > > >following syntax: > > > > > >INSERT into tablename (field name list) > > >VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) > > > > > >I just want to use $var1, $var2, $var3 > > --------------------[snip]-------------------- > > > > You can always resort to > > extract($_REQUEST); > > > > > > -- > > >O Ernest E. Vogelsinger > > (\) ICQ #13394035 > > ^ http://www.vogelsinger.at/ > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    > You never answered if this was in a function or class > method. Is it? Did you say whether it was Apache 1 or 2?

    Also, to check what the register_globals setting really is, make a call to phpinfo() as it will tell you the true setting. Sometimes the wrong php.ini is edited or the web server wasn't restarted or .htaccess/httpd.conf gets in the way or ... ...

    Regards, Philip

    attached mail follows:


    Hi,

    I am sure at least I was not a newbie in the topic I am talking about. But this problem made crazy. I was hoping for a bit of help please.

    The problem is: you have to make double correct logins to get into the session protected area. Here is the situation:

    1. server configuration: PHP 4.1.2, Rapidsite/Apa/1.3.26 (Unix), FrontPage/5.0.2.2510, mod_ssl/2.8.10, OpenSSL/0.9.6e

    2. the the login script: <? session_start (); session_register ('_SS_AUTHEN'); if ($_SS_AUTHEN == 'passed') { header ("Location: protected/index.php"); }

    if ($trying = $HTTP_POST_VARS['trying']) { // for the first time display the page don't check $userID = $HTTP_POST_VARS['userID']; $userPwd = $HTTP_POST_VARS['userPwd']; if (check_user_ok($userID, $userPwd)) { $_SS_AUTHEN = 'passed'; header ("Location: protected/index.php"); } else { $error_msg = 'Error: username/password not matched!'; } } else { $error_msg = ''; // for first time display the page, no error_msg }

    // require login page require 'templates/timereport_login.inc'; // in the login page, $error_msg will be displayed ?>

    3. in the session protected area, each php file must be added with following code at very begining:

    <? // check session session_start (); if ($_SS_AUTHEN != 'passed') { $reDirect_to = '../login.php'; } else { $ReDirect_to = 'thescript.php'; } header ("Location: $ReDirect_to"); ?>

    Again, with the script above, the problem is: you have to make double correct logins then you can get into the protected location.

    The similar scripts have been used in many different projects but only this one get so weird result. So I would prefer to say session behaviour on this server is abnormal....However, I do hope I myself made something wrong thus the bug is possible to be fixed...

    Thanks for any help in advance!

    Alex Shi

    attached mail follows:


    Hi, I've upgraded the php version from 4.2.2 to 4.3.0 yesterday and some of my users started complaining about errors in php scripts.

    The errors do not occur all the times and the messages shown are weird (for me at least) !

    The user is accessing a php file located under /var/www/html/site.com/private/alt.php3. It performs a mysql query.

    I have a virtual host in apache so /var/www/html/site.com/ is mapped as www.site.com.

    The error messages : Warning: Unknown(): open_basedir restriction in effect. File(/var/www/html/site.com/private/alt.php3) is not within the allowed path(s): (/home/httpd/html/anothersite.com/) in Unknown on line 0

    Warning: Unknown(/var/www/html/site.com/private/alt.php3): failed to create stream: Operation not permitted in Unknown on line 0

    Warning: Unknown(): Failed opening '/var/www/html/site.com/private/alt.php3' for inclusion (include_path='.:/usr/local/lib/php/:/home/httpd/html/php/:/home/httpd/html/include/php/') in Unknown on line 0

    The strange part is that the safe_mode is off and it mentions a directory from another virtual host (anothersite.com).

    <VirtualHost IP> ServerAdmin webmaster DocumentRoot /home/httpd/html/site.com/ ServerName www.site.com.br ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ <Directory /home/httpd/html/site.com/> # php_admin_value doc_root "/home/httpd/html/site.com/" php_admin_flag safe_mode off # php_admin_value open_basedir "/home/httpd/html/site.com/:/tmp/" </Directory> </VirtualHost>

    System : Linux / Redhat 7.3 / Apache 1.3

    './configure' '--with-gd' '--with-apxs' '--with-xml' '--with-ftp' '--enable-session' '--enable-trans-sid' '--with-zlib' '--enable-inline-optimization' '--with-mcrypt=/usr/local' '--with-imap=../imap-2001a ' '--with-kerberos' '--with-oci8=/u01/app/oracle/product/8.1.7/' '--enable-sigchild' '--with-gettext' '--with-freetype' '--with-ttf' '--with-ftp' '--enable-ftp'

    __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

    attached mail follows:


    Has anyone got a PHP/*nix equivalent solution to the MS Shared VB Object/Component model?

    See: http://www.cyscape.com/products/country/docs/countryhawk/getselectlist_metho d.htm for an example of a useful component.

    Thanks,

    Luke Woollard

    attached mail follows:


    I'm trying to use Pear on a server that had an old version of Pear, so I put the pear directory in the directory where I'm working, and am including ini_set('include_path', 'path to pear'); at the top of my file. I then have

    require_once('PEAR.php'); require_once('PEAR/Command/Auth.php'); I had to put in the PEAR part for Auth, without it I was getting a:

    Fatal error: Failed opening required 'Auth.php' (...

    and in my code, which is the example code from the Pear site (http://pear.php.net/manual/en/packages.auth.auth.php) for Auth there's the line

    $a = new Auth("DB", $dsn, "loginFunction");

    which is causing this:

    Fatal error: Cannot instantiate non-existent class: auth in /opt/docs/www.xxx.net/passthru.php on line 21

    Anyone know what I'm doing wrong? Is there a better example of functional Auth code out there?

    Josh

    attached mail follows:


    > $a = new Auth("DB", $dsn, "loginFunction"); > > > which is causing this: > > Fatal error: Cannot instantiate non-existent class: auth in > /opt/docs/www.xxx.net/passthru.php on line 21 > > Anyone know what I'm doing wrong? Is there a better example of functional > Auth code out there?

    Since you're using an old version of pair, maybe the class name has changed. If you're successfully including auth.php, open it up and look at what the class is named.

    ---John W. Holmes...

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

    attached mail follows:


    No, I put a new version of Pear in the directory I was developing in. I found this:

    http://news.php.net/article.php?group=php.pear.general&article=3505

    Seems there are lots of problems with Auth, despite Pear's 1.0 version.

    Josh

    John W. Holmes wrote:

    >>$a = new Auth("DB", $dsn, "loginFunction"); >> >> >>which is causing this: >> >>Fatal error: Cannot instantiate non-existent class: auth in >>/opt/docs/www.xxx.net/passthru.php on line 21 >> >>Anyone know what I'm doing wrong? Is there a better example of >> >> >functional > > >>Auth code out there? >> >> > >Since you're using an old version of pair, maybe the class name has >changed. If you're successfully including auth.php, open it up and look >at what the class is named. > >---John W. Holmes... > >PHP Architect - A monthly magazine for PHP Professionals. Get your copy >today. http://www.phparch.com/ > > > >

    attached mail follows:


    $fname is the name of the file i want to download. It works in IE, as in the name of the file to be downloaded appears correctly in the dialog box. I changed 'application/octet' to 'application/octet-stream' and this had no effect.

    Dara ----- Original Message ----- From: Chris Shiflett <shiflettphp.net> Date: Wed, 29 Jan 2003 06:47:17 -0800 (PST) To: Dara Dowd <daradowdcampus.ie>, php-generallists.php.net Subject: Re: [PHP] content type header for downloading files

    > --- Dara Dowd <daradowdcampus.ie> wrote: > > I have the following headers in download.php which forces > > a download dialog box to be opened when a user clicks on > > a desired file: > > > > header("Content-type: application/octet"); > > header("Content-Length: $filelength"); > > header("Content-Disposition: attachment; > > filename=".basename($fname).";"); > > > > This works fine with IE, but Mozilla adds a '.php' > > extension to the filename if i choose the save option, > > and asks me to choose which application to use if I want > > to open the file. > > What is the value of $fname? If you are trying to tell it > the name of your script, then that is why Mozilla names it > so. The filename directive should be the filename you want > assigned to whatever you are sending the browser. > > Also, I think you mean to say application/octet-stream, but > I don't feel like looking it up. I suggest double-checking > that value. > > Chris

    -- 
    For the largest free email in Ireland (25MB) & 
    File Storage space (20MB), visit http://www.campus.ie
    

    Powered by Outblaze

    attached mail follows:


    > $fname is the name of the file i want to download. It works in IE, as in > the name of the file to be downloaded appears correctly in the dialog box. > I changed 'application/octet' to 'application/octet-stream' and this had > no effect.

    Maybe find a site that works correctly on the browser in question and examine the headers it sends?

    ---John W. Holmes...

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

    attached mail follows:


    how do i examine the headers sent? ----- Original Message ----- From: "John W. Holmes" <holmes072000charter.net> Date: Wed, 29 Jan 2003 20:06:47 -0500 To: "''Dara Dowd''" <daradowdcampus.ie>, <shiflettphp.net>, <php-generallists.php.net> Subject: RE: [PHP] content type header for downloading files

    > > $fname is the name of the file i want to download. It works in IE, as > in > > the name of the file to be downloaded appears correctly in the dialog > box. > > I changed 'application/octet' to 'application/octet-stream' and this > had > > no effect. > > Maybe find a site that works correctly on the browser in question and > examine the headers it sends? > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -- 
    For the largest free email in Ireland (25MB) & 
    File Storage space (20MB), visit http://www.campus.ie
    

    Powered by Outblaze

    attached mail follows:


    -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

    Manually connect and request a page using HTTP echo -e "GET / HTTP/1.0\r\n\r\n" | nc server 80 works on many boxes... you may have to use telnet and actually type in the request instead of piping

    On Wednesday 29 January 2003 05:29 pm, Dara Dowd wrote: > how do i examine the headers sent? > ----- Original Message ----- > From: "John W. Holmes" <holmes072000charter.net> > Date: Wed, 29 Jan 2003 20:06:47 -0500 > To: "''Dara Dowd''" <daradowdcampus.ie>, <shiflettphp.net>, > <php-generallists.php.net> Subject: RE: [PHP] content type header for > downloading files > > > > $fname is the name of the file i want to download. It works in IE, as > > > > in > > > > > the name of the file to be downloaded appears correctly in the dialog > > > > box. > > > > > I changed 'application/octet' to 'application/octet-stream' and this > > > > had > > > > > no effect. > > > > Maybe find a site that works correctly on the browser in question and > > examine the headers it sends? > > > > ---John W. Holmes... > > > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > > today. http://www.phparch.com/ > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

    - -- The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up.

    - -George Orwell -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)

    iD8DBQE+ONGu/rncFku1MdIRArmpAJ4uI/X4iTe8SsScdX35uYduYzgJEgCbB36d cNfHRaY/3YMMliv4bqr53Zg= =cwmo -----END PGP SIGNATURE-----

    attached mail follows:


    At 02:04 30.01.2003, Dara Dowd said: --------------------[snip]-------------------- >$fname is the name of the file i want to download. It works in IE, as in the >name of the file to be downloaded appears correctly in the dialog box. I >changed 'application/octet' to 'application/octet-stream' and this had no >effect. --------------------[snip]--------------------

    This is what I do to transmit a file for a save-as download, and it works in all browsers I know and have tested the same (Netscape, IE, Opera/Win; Mozilla, Konqueror et al. / Linux):

    header('Content-type: application/octet-stream'); header('Content-length: ' . strlen($this->export)); header('Content-Disposition: attachment' . (empty($fname) ? '' : ';filename="'.$fname.'.csv"')); echo $this->export; exit();

    Note that it seems to be necessary to surround the filename using quotes to make it work correctly.

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    Hi, I have a conditional: if (a == b)

    a is the number 0, but b is a string "Friday August 22".

    The condition is evaluating as true, which is not what I want. What am I misunderstanding?

    Thanks, Stephen

    attached mail follows:


    > I have a conditional: > if (a == b) > > a is the number 0, but b is a string "Friday August 22". > > The condition is evaluating as true, which is not what I want. > What am I misunderstanding?

    You're comparing a string to a number perhaps?

    I tried this:

    -----8<----- $a = 0; $b = "Friday August 22";

    if ($a == $b) { echo "match"; } else { echo "no match"; } -----8<-----

    and resulted in 'match', then I tried this:

    -----8<----- $a = "0"; $b = "Friday August 22";

    if ($a == $b) { echo "match"; } else { echo "no match"; } -----8<-----

    and resulted in 'no match'.

    It's worth remembering that the number 0 has somewhat special meaning in php as a true/false indication.

    CYA, Dave

    attached mail follows:


    On Thursday 30 January 2003 02:39, David Freeman wrote: > -----8<----- > $a = "0"; > $b = "Friday August 22"; > -----8<----- > > and resulted in 'no match'.

    Or try $a = 0; $c = (string) $a; // Now $c == "0" or if (( (string) $a == (string) $b)) { ...

    The manual could be your friend, too: http://www.php.net/manual/en/language.types.type-juggling.php

    johannes

    attached mail follows:


    Stephen,

    "Friday August 22" evaluates to the number 0. (check the docs for intval()) Therefore the condition would be true.

    I stated in an earlier thread this week. It is bad for to allow PHP todo your conversions for you. At the least it's lazy, at the most it will cause unpredictable results. (as is your case below.)

    If you really MUST compare a string and a number, do an explicit cast first.

    if ($a==intval("Friday August 22")) or if (strval($a)=="Friday August 22")

    In both cases above, since we are explicitly casting, it is easy to predict the results and explain them.

    (In the above, the first should be true and the second should be false.)

    =C=

    * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com *

    -----Original Message----- From: Webapprentice [mailto:webapprenticeonemain.com] Sent: Wednesday, January 29, 2003 7:36 PM To: php-generallists.php.net Subject: [PHP] if (a == b) ...

    Hi, I have a conditional: if (a == b)

    a is the number 0, but b is a string "Friday August 22".

    The condition is evaluating as true, which is not what I want. What am I misunderstanding?

    Thanks, Stephen

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

    attached mail follows:


    Cal, Thanks for the suggestion. I looked up equality on www.php.net, and there are many comments about how == works. I also found out === works too, or is that still lazy?

    Thanks, Stephen

    Cal Evans wrote:

    >Stephen, > >"Friday August 22" evaluates to the number 0. (check the docs for intval()) >Therefore the condition would be true. > >I stated in an earlier thread this week. It is bad for to allow PHP todo >your conversions for you. At the least it's lazy, at the most it will cause >unpredictable results. (as is your case below.) > >If you really MUST compare a string and a number, do an explicit cast first. > >if ($a==intval("Friday August 22")) >or >if (strval($a)=="Friday August 22") > >In both cases above, since we are explicitly casting, it is easy to predict >the results and explain them. > >(In the above, the first should be true and the second should be false.) > >=C= > >* >* Cal Evans >* Stay plugged into your audience. >* http://www.christianperformer.com >* > >

    attached mail follows:


    $a === $b

    TRUE if $a is equal to $b, and they are of the same type. (PHP 4 only)

    > -----Original Message----- > From: David Freeman [mailto:dfreemanoutbackqld.net.au] > Sent: Wednesday, January 29, 2003 7:39 PM > To: php-generallists.php.net > Subject: RE: [PHP] if (a == b) ... > > > > > I have a conditional: > > if (a == b) > > > > a is the number 0, but b is a string "Friday August 22". > > > > The condition is evaluating as true, which is not what I want. > > What am I misunderstanding? > > You're comparing a string to a number perhaps? > > I tried this: > > -----8<----- > $a = 0; > $b = "Friday August 22"; > > if ($a == $b) > { > echo "match"; > } else { > echo "no match"; > } > -----8<----- > > and resulted in 'match', then I tried this: > > -----8<----- > $a = "0"; > $b = "Friday August 22"; > > if ($a == $b) > { > echo "match"; > } else { > echo "no match"; > } > -----8<----- > > and resulted in 'no match'. > > It's worth remembering that the number 0 has somewhat special meaning in > php as a true/false indication. > > CYA, Dave > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    At 02:36 30.01.2003, Webapprentice said: --------------------[snip]-------------------- >Hi, >I have a conditional: >if (a == b) > >a is the number 0, but b is a string "Friday August 22". > >The condition is evaluating as true, which is not what I want. >What am I misunderstanding? --------------------[snip]--------------------

    PHP tries to "help" you - you can only compare data of the same type. So PHP goes ahead and casts this for you, a string to int in this case.

    If you compare it using "===" (typesafe comparison) you will get correct results.

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    > What happens when you run this? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site125/fst/var/www/html/atracker/assignments/index.php on line 15

    ID Number Name Created by Created on Due on Class

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site125/fst/var/www/html/atracker/assignments/index.php on line 33

    There's a lot more mysql_fetch_array warnings, with varying lines. The two lines in question above are:

    :::::::::::::::::::::::::::::CODE::::::::::::::::::::::::::::: $classes = mysql_query("SELECT period1, period2, period3, period4, period5, period6, periodpaws, period0 FROM students WHERE id = $id");

    $classes_array = mysql_fetch_array($classes); :::::::::::::::::::::::::::::CODE:::::::::::::::::::::::::::::

    :::::::::::::::::::::::::::::CODE::::::::::::::::::::::::::::: $class_info = mysql_query("SELECT * FROM classes WHERE $id = ".$classes_array[period0]); $class_info_array = mysql_fetch_array($class_info); :::::::::::::::::::::::::::::CODE:::::::::::::::::::::::::::::

    Would I be getting this kind of error if $id was not set correctly? I was doing a bit of testing and for some reason my sessions aren't registering or something :\

    attached mail follows:


    ----- Original Message ----- From: "R0x0r Mc0wnage" <r0x0rmc0wnage.com> To: <php-generallists.php.net> Sent: Wednesday, January 29, 2003 8:49 PM Subject: Re: [PHP] Functions and arguments

    > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result > resource in > /home/virtual/site125/fst/var/www/html/atracker/assignments/index.php on > line 15 > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL > result resource in > /home/virtual/site125/fst/var/www/html/atracker/assignments/index.php on > line 33 > Would I be getting this kind of error if $id was not set correctly? I was > doing a bit of testing and for some reason my sessions aren't registering or > something :\

    Yes. You should always check the result of the mysql_query statement, and take some action if it returns false. False means the query failed (and not that there were no rows returned), so you should at least log the error from mysql_error(), maybe email it to someone that can do something about it, and perhaps do more depending on the situation. You shouldn't echo mysql_error() out to the browser, except while debugging, so as to prevent information leakage to the bad guys.

    attached mail follows:


    > > What happens when you run this? I made some tweaks to the way I was running sessions, and now it works. I'm still getting an error unfortunately, but it's less conspicuous and spammy this time:

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site125/fst/var/www/html/atracker/assignments/index.php on line 33

    The line(and dependent lines) in question is as follows: :::::::::::::::::::::::::::::CODE:::::::::::::::::::::::::::::

    $classes = mysql_query("SELECT period1, period2, period3, period4, period5, period6, periodpaws, period0 FROM students WHERE id = $id");

    $classes_array = mysql_fetch_array($classes);

    $class_info = mysql_query("SELECT * FROM classes WHERE $id = ".$classes_array[period0]);

    $class_info_array = mysql_fetch_array($class_info); :::::::::::::::::::::::::::::CODE:::::::::::::::::::::::::::::

    Thanks for the help, Blaine von Roeder

    attached mail follows:


    You can do either, many people have responded and given their thoughs on the matter. I personally avoid storing images in a database, the filesystem is better equipped IMO to handle files. On top of the overhead of storing the image in your database you will be creating additional database traffic, every image loaded is at least one more database query on the website.

    Jason On Tue, 2003-01-28 at 17:16, Manuel Ochoa wrote: > > I writting a php program for a small insurance company and they want to receive uploaded digital photos. > > Should I store the photos in a mysql database or in a directory on the hard drive? > > If you have experience with this any advice would be appreciated.

    attached mail follows:


    I'm using PHP 4.2.3, Apache 1.2.24 on OpenBSD 3.1. (http://ardvark.upnix.net/phpinfo.php)

    I'm running a fairly busy server that has a number of virtual hosts. Safe mode is off, I don't (and never did) use open_basedir anywhere and my php.ini file is the default one (untouched) from my PHP install.

    At random times a PHP will give the error:

    Warning: open_basedir restriction in effect. File is in wrong directory in Unknown on line 0

    Warning: Failed opening '/php/page/I/happen/to/be/looking/at.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0

    A simple hit of the reload button will make it go away. This error has showed up on every kind of page. From a Squirrel Mail page, to simple php_info() page.

    Now, that being said, I'm certainly not the only person with this problem. I see it in the mailing lists with no responses, and there have been a few bug reports, which have been closed or dismissed as "Bogus" (which is concerning in itself) http://bugs.php.net/bug.php?id=15302 http://bugs.php.net/bug.php?id=12995

    So I'm in need of a little help here. If I've done something obviously wrong, please point it out. If you've also had this problem, I'd appreciate you sharing it. But I'm running a setup that hasn't changed -at all- for months and this is an error that's just popped up today.

    Thanks, Chris

    -- 
    Chris Cameron
    UpNIX Internet Administrator
    ardvark.upnix.net
    bitbucket.upnix.net
    --
    http://www.upnix.com
    

    attached mail follows:


    Trying to decide between wrappers for a rather large application, and wanted some input from the group as I haven't used any of these to any degree. So far, I've found PearDB, metabase, adodb, and MDB.

    What's the best option? My main concerns are speed and good community support.

    All input is *greatly* appreciated.

    Thanks, John

    attached mail follows:


    > Trying to decide between wrappers for a rather large application, and > wanted some input from the group as I haven't used any of these to any > degree. So far, I've found PearDB, metabase, adodb, and MDB. > > What's the best option? My main concerns are speed and good community > support. > > All input is *greatly* appreciated.

    I use adoDB and like it a lot. Your solution is going to depend on what features you need and exactly what your program is doing...

    ---John W. Holmes...

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

    attached mail follows:


    This suggested solution is not quite what i was looking for (I was aware of it already):

    A: input TYPE=IMAGE NAME="parent" VALUE="foo" SRC="icon.gif">

    The above uses an image as a bitmap and gets the x,y values where it was clicked. I'd like to use an ICON (instead of a standard submit button) and only care about WHICH icon was clicked, not where on the bitmap.

    Presumably the correct HTML is to use the BUTTON type as follows:

    B: <button type="submit" name="parent" value="foo"><img src="icon.gif"></button>

    but this does not work. And of course,

    C: <input type="submit" name="parent" value="foo">

    gives the standard submit button.

    One suggestion was to add a "src=icon.gif" attribute to the submit type directly above (example C), but that didn't change the button ... it still had the standard button.

    I assume i could use solution "A" above, and parse the _x out of the "name" value .. but this seems pretty hoaky and it's my understanding soultion B is "correct" HTML and SHOULD work! Is it a bug in php that it is causing it not to work? or is the "button" construct depricated? or am i misunderstanding how that "BUTTON" construct is supposed to work?

    Sorry to be dense about this but it seems like a simple concept that's frustratingly difficult.

    -Durwood

    "Don Read" <dreadtexas.net> wrote in message news:XFMail.20030129141031.dreadtexas.net... > > On 27-Jan-2003 Durwood Gafford wrote: > > I can't figure out how to tell which button was pressed by a user when i'm > > using a "button" instead of a standard "submit" form element. > > > > This works: > > > > <input type="submit" name="parent" value="foo"> > > $parent will equal "foo" > > > > This doesn't work: > > > > <button type="submit" name="parent" value="foo"><img > > src="icon.gif"></button> > > $parent will equal "<img src="icon.gif"> NOT "foo" > > > > How do I get the value of "foo" to be returned in $parent and still use a > > graphical icon instead of a standard submit button? > > > > <input TYPE=IMAGE NAME="parent" VALUE="foo" SRC="icon.gif"> > > Regards, > -- > Don Read dreadtexas.net > -- "Beer is proof that God loves us and wants us to be happy."

    attached mail follows:


    [snip] > I assume i could use solution "A" above, and parse the _x out of the "name" > value .. but this seems pretty hoaky and it's my understanding soultion B is [snip]

    This is how it's done. If this is set, the button was clicked. For example:

    if (isset($_REQUEST['thebuttonname_x'])) { print "The button was clicked"; }

    Regards, Philip

    attached mail follows:


    Ok, now I'm frustrated.

    I'm trying to register an object in the session, and access that object from 2 different pages.

    I start off in the first file, and do: <?php include("nycmgMail.php"); session_start(); $myMailer = new nycmgMail(); $myMailer->buildRecipients(); $_SESSION['myMailer'] = $myMailer; ?>

    If I print_r the $_SESSION on that page, everything looks fine. So I then move to my second page, and use:

    <?php session_start();

    $myMailer = &$_SESSION['myMailer']; if ($myMailer) { $addressArray = $myMailer->getRecipients(); } else { $addressArray = null; }

    ?>

    Now when I do this, if I look at the $_SESSION object I see that that class is now listed as: [myMailer] => __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => nycmgmail ...

    and in the error log I see: [29-Jan-2003 23:58:09] PHP Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition <b>nycmgmail</b> of the object you are trying to operate on was loaded _before_ the session was started in /.../.../.../.../admin/addresses.php on line 6

    I swear I have done all of this before, but it is just not working now, and for the life of me I can't see anything right in front of me.

    Help! Please?

    thanks, Wes

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

    ---
    The selection and placement of letters on this page was
    determined automatically by a computer program. Any
    resemblance to actual words, sentences, or paragraphs is
    pure coincidence, and no liability will be assumed for
    such coincidences.
    ------------------------------------------------------------------------ 
    ---
    

    attached mail follows:


    I don't see where you include() your class definition in that second file... add include("nycmgMail.php") right before the session_start() line and see if that makes a difference.

    -philip

    On Thu, 30 Jan 2003, Weston Houghton wrote:

    > > Ok, now I'm frustrated. > > I'm trying to register an object in the session, and access that object > from 2 different pages. > > I start off in the first file, and do: > <?php > include("nycmgMail.php"); > session_start(); > $myMailer = new nycmgMail(); > $myMailer->buildRecipients(); > $_SESSION['myMailer'] = $myMailer; > ?> > > If I print_r the $_SESSION on that page, everything looks fine. So I > then move to my second page, and use: > > <?php > session_start(); > > $myMailer = &$_SESSION['myMailer']; > if ($myMailer) { > $addressArray = $myMailer->getRecipients(); > } else { > $addressArray = null; > } > > ?> > > Now when I do this, if I look at the $_SESSION object I see that that > class is now listed as: > [myMailer] => __PHP_Incomplete_Class Object > ( > [__PHP_Incomplete_Class_Name] => nycmgmail > ... > > and in the error log I see: > [29-Jan-2003 23:58:09] PHP Fatal error: Unknown(): The script tried to > execute a method or access a property of an incomplete object. Please > ensure that the class definition <b>nycmgmail</b> of the object you are > trying to operate on was loaded _before_ the session was started in > /.../.../.../.../admin/addresses.php on line 6 > > I swear I have done all of this before, but it is just not working now, > and for the life of me I can't see anything right in front of me. > > Help! Please? > > thanks, > Wes > > > > ------------------------------------------------------------------------ > --- > The selection and placement of letters on this page was > determined automatically by a computer program. Any > resemblance to actual words, sentences, or paragraphs is > pure coincidence, and no liability will be assumed for > such coincidences. > ------------------------------------------------------------------------ > --- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    At 06:20 30.01.2003, Weston Houghton said: --------------------[snip]-------------------- >I'm trying to register an object in the session, and access that object >from 2 different pages. > >I start off in the first file, and do: ><?php >include("nycmgMail.php"); >session_start(); >$myMailer = new nycmgMail(); > > ... > >If I print_r the $_SESSION on that page, everything looks fine. So I >then move to my second page, and use: > >... > >Now when I do this, if I look at the $_SESSION object I see that that >class is now listed as: >[myMailer] => __PHP_Incomplete_Class Object --------------------[snip]--------------------

    You need to include the class definition of an object _before_ instantiating it. If you omit the class definition, PHP has no chance to assign the correct class and uses a builtin default class.

    Include your class definition file before session_start() and you'll be fine.

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    Hi,

    I think fopen() and fsockopen() have a bug. For example, while I had no problem connecting to "http://www2.barchart.com" using a browser, it was not possible to open a socket connection uisng either fopen() or fsockopen() (i.e., none could initilize the socket).

    I was wondering if anyone else had similar problems. Please let me know if there is a bug, or I was doing something wrong.

    Thanks,

    Zlutarch

    P.S., both fopen() and fsockopen() can be used to connect to "www.barchart.com", but NOT "www2.barchart.com". Isn't this weird?

    __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

    attached mail follows:


    Hello,

    Is it possible via PHP to : - join a pop3 server - make a "query" to recover mails header, subject, date, sender,.... to create a list. - we I have the list when I click on an element of the list recever the email content (text and attachment) and why not see the email's header - Have the possibility to delete a specific message (or more) - Send email too.

    Thanks for your help,

    Christian,

    attached mail follows:


    On Thursday 30 January 2003 14:49, Christian Ista wrote:

    > Is it possible via PHP to : > - join a pop3 server > - make a "query" to recover mails header, subject, date, sender,.... to > create a list. > - we I have the list when I click on an element of the list recever the > email content (text and attachment) and why not see the email's header > - Have the possibility to delete a specific message (or more) > - Send email too.

    Yes to all the above.

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

    /* "America is a stronger nation for the ACLU's uncompromising effort." -- President John F. Kennedy */

    attached mail follows:


    At 07:49 30-1-2003, you wrote: >Hello, > >Is it possible via PHP to : >- join a pop3 server >- make a "query" to recover mails header, subject, date, sender,.... to >create a list. >- we I have the list when I click on an element of the list recever the >email content (text and attachment) and why not see the email's header >- Have the possibility to delete a specific message (or more) >- Send email too. search for the phpclasses site with Manuel Lemos' s class for POP3

    attached mail follows:


    Hello people,

    On my development machine (win XP/Apache 2.0.44/PHP 4.3.0/MySQL 3.23.55) i have several websites that i made some time ago that require register globals to be On in the php.ini. Ofcourse i know thats not a good idea at all for security, but rewriting all this code is not an option. However in my php.ini i have set register globals to Off because that better. Is it possible to configure my webserver/php so that only those sites that require register globals to be On have that setting, for instance in a .htacces file?? Any help is appreciated:-)

    Best regards,

    Davy Obdam mailto:infodavyobdam.com

    attached mail follows:


    I have various XML files that might contain <> tags inside the element body, for example:

    <news id="1" shortDescription="Stuff Happened Today">Today on <b>1/29/03</b>, stuff happened</news>

    Because of this I can't use xml_parse_into_struct; when I do this happens:

    array ( ... [attributes] => array ( [ID] = "1" [SHORTDESCRIPTION] = "Stuff Happened Today" ) [values] = "Today on" )

    and it stops right there on the <b> tag.

    What I need to do is this: Clean out ALL occurrences of <tags> that are NOT part of the original XML structure from the contents read from the XML file:

    $fileID = fopen('/phil/xml/news.xml', 'r') or die('Could not open XML'); $stuff = fread($fileID, filesize('/phil/xml/news.xml')); fclose($fileID);

    $stuff contains the contents of news.xml, so I would have to do my cleanup in $stuff, BUT.. I can't use preg_replace for tags because then ALL of my tags would be altered and xml_parse_into_struct would fail altogether.

    How then do I make sure to ONLY remove the <trash tags> from each XML row body and nowhere else???

    Thanx Phil

    attached mail follows:


    Hi Phil,

    Your XML is not well formed, not properly nested use:

    <news id="1" shortDescription="Stuff Happened Today"><![CDATA[Today on <b>1/29/03</b>, stuff happened]]></news>

    This way the XML parser wil accept <b> and </b>, otherwise it sees it as XML elements. I hope this helps.

    Best regards,

    Davy Obdam mailto:infodavyobdam.com

    Phil Powell wrote:

    >I have various XML files that might contain <> tags inside the element body, for example: > ><news id="1" shortDescription="Stuff Happened Today">Today on <b>1/29/03</b>, stuff happened</news> > >Because of this I can't use xml_parse_into_struct; when I do this happens: > >array ( > ... > [attributes] => array ( > [ID] = "1" > [SHORTDESCRIPTION] = "Stuff Happened Today" > ) > [values] = "Today on" >) > >and it stops right there on the <b> tag. > >What I need to do is this: Clean out ALL occurrences of <tags> that are NOT part of the original XML structure from the contents read from the XML file: > >$fileID = fopen('/phil/xml/news.xml', 'r') or die('Could not open XML'); >$stuff = fread($fileID, filesize('/phil/xml/news.xml')); >fclose($fileID); > >$stuff contains the contents of news.xml, so I would have to do my cleanup in $stuff, BUT.. I can't use preg_replace for tags because then ALL of my tags would be altered and xml_parse_into_struct would fail altogether. > >How then do I make sure to ONLY remove the <trash tags> from each XML row body and nowhere else??? > >Thanx >Phil > >===============================================================Deze e-mail is door E-mail VirusScanner van Planet Internet gecontroleerd op virussen. >Op http://www.planet.nl/evs staat een verwijzing naar de actuele lijst waar op wordt gecontroleerd. > > >

    -- 
    --------------------------------------------------------------------
    Davy Obdam - Obdam webdesign©
    mailto:infodavyobdam.com   web: www.davyobdam.com
    --------------------------------------------------------------------
    

    attached mail follows:


    Hi Davy,

    I found the following in the php manual:

    Please note that register_globals cannot be set at runtime (ini_set()). Although, you can use .htaccess if your host allows it as described above. An example .htaccess entry: php_flag register_globals on.

    on this page: http://www.php.net/manual/en/configuration.directives.php

    I've also used this format in apache conf files and, I believe, in .htaccess files: php_value include_path /web/lib/php:.

    Daniel

    At 7:52 AM +0100 on 1/30/03, Davy Obdam wrote:

    >Hello people, > >On my development machine (win XP/Apache 2.0.44/PHP 4.3.0/MySQL 3.23.55) i have several websites that i made some time ago that require register globals to be On in the php.ini. Ofcourse i know thats not a good idea at all for security, but rewriting all this code is not an option. However in my php.ini i have set register globals to Off because that better. Is it possible to configure my webserver/php so that only those sites that require register globals to be On have that setting, for instance in a .htacces file?? Any help is appreciated:-) > >Best regards, > >Davy Obdam >mailto:infodavyobdam.com > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    

    Daniel Leighton Chief Technology Officer Webolution http://www.webolution.com

    This email may contain material that is confidential and privileged for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

    attached mail follows:


    I was not able to either telnet (via port 80), or connect using fopen() to www2.barchart.com.

    But it seems that it is fine now. Perhaps it was a temp problem on the site's server, but still, I had no problems connecting to the site via a browser while fopen and telnet were not working.

    It would be interesting to see if anyone else experienced similar problems.

    --- Evan Nemerson <evancoeus-group.com> wrote: > Perhaps you could post the pertinant code, so we can > determine why it doesn't > work... > > > > On Wednesday 29 January 2003 10:29 pm, zlu tarch > wrote: > > Hi, > > > > I think fopen() and fsockopen() have a bug. For > > example, while I had no problem connecting to > > "http://www2.barchart.com" using a browser, it was > not > > possible to open a socket connection uisng either > > fopen() or fsockopen() (i.e., none could initilize > the > > socket). > > > > I was wondering if anyone else had similar > problems. > > Please let me know if there is a bug, or I was > doing > > something wrong. > > > > Thanks, > > > > Zlutarch > > > > P.S., both fopen() and fsockopen() can be used to > > connect to "www.barchart.com", but NOT > > "www2.barchart.com". Isn't this weird? > > > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > > http://mailplus.yahoo.com > > -- > To think is to differ. > > -Clarence Darrow >

    __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

    attached mail follows:


    At 08:33 30.01.2003, zlu tarch said: --------------------[snip]-------------------- >I was not able to either telnet (via port 80), or >connect using fopen() to www2.barchart.com. > >But it seems that it is fine now. Perhaps it was a >temp problem on the site's server, but still, I had no >problems connecting to the site via a browser while >fopen and telnet were not working. > >It would be interesting to see if anyone else >experienced similar problems. --------------------[snip]--------------------

    Possibly the server is behind a firewall and is not allowed to make an outgoing connection on the specific port?

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    I have a program called ImageMagick installed which allows me to resize pictures and do some other fun things. I am, however, unable to run any of the executables. I installed the software and it installed under program files. I then created a virtual dir under my website. When I try to run the executable from the php code, the executable doesn't seem to be working because I think the path being used is relative to my website not the hard drive.

    Any ideas?

    Thanks.

    - Dale

    Here the code is:

    <?

    if ($add == "true")

    {

    //UPLOAD THE FILES TO THE SERVER

    $fs_part = "images2/";

    $group_name_fix = ereg_replace(" ", "_", $file_name);

    $gi_httpd_part = $group_name_fix;

    $gi_local_file = $fs_part.$gi_httpd_part;

    copy("$file", "$gi_local_file");

    $th = "/".$group_name_fix."_thumb.jpg";

    $com = "convert -geometry 110 x 110 $gi_local_file, ($fs_part.$th)";

    exec($com);

    }

    ?>

    <html>

    <head>

    <title>Untitled Document</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    </head>

    <body bgcolor="#FFFFFF" text="#000000">

    <form name="form1" enctype="multipart/form-data" method="post" action="">

    <input type="file" name="file">

    <br>

    <input type="submit" name="Submit" value="Submit">

    <INPUT type=hidden value=true name=add>

    </form>

    </body>

    </html>

    attached mail follows:


    On Thursday 30 January 2003 15:51, Dale wrote: > I have a program called ImageMagick installed which allows me to resize > pictures and do some other fun things. I am, however, unable to run any of > the executables. I installed the software and it installed under program > files. I then created a virtual dir under my website. When I try to run the > executable from the php code, the executable doesn't seem to be working > because I think the path being used is relative to my website not the hard > drive.

    If that's the case then use absolute paths.

    > Here the code is: > > <? > > if ($add == "true") > > { > > //UPLOAD THE FILES TO THE SERVER > > > $fs_part = "images2/"; > > $group_name_fix = ereg_replace(" ", "_", $file_name); > > $gi_httpd_part = $group_name_fix; > > $gi_local_file = $fs_part.$gi_httpd_part; > > > copy("$file", "$gi_local_file"); > > $th = "/".$group_name_fix."_thumb.jpg"; > > $com = "convert -geometry 110 x 110 $gi_local_file, ($fs_part.$th)";

    1) You may want to try the using the full path to the executable as well here. 2) Shouldn't geometry be something like 110x110 (no spaces) 3) What's the comma doing there? 4) Ditto the parantheses? Surely they're not part of the filename?

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

    /* You can no more win a war than you can win an earthquake. -- Jeannette Rankin */

    attached mail follows:


    Hello As far as I rememeber according to DOM Level 2 Elementnodes contain Attributenodes but the Attributenode has no association with its Elementnode meaning you can't tell from an Attributenode which Elementnode it belongs to unless you remember it in your code. Thus an Attributenode is not part of the Domtree as an Elementnode and will not be returned as a Child of that Node. The only way to retrieve Attributenodes is by going throught the Elementnode and retrieving the attributes explicitly. In other words Attributenodes are special nodes which do not get nested in the DOMtree as children of their corresponding Elementnode. This leaves space for optimizing the DOMTree by inserting a single attributenode for multiple Elementnodes. (At least that is what I'm guessing...)

    Please correct me if I'm mistaken

    Stefan

    attached mail follows:


    Thanks for your reply Stefan.

    I hadn't really read the manual, had just been working with DOM level 2 in java before, and the fact that attributes are not children of elements, puzzled me. But after reading the DOM level 2 spesification, it may seem that you are right.

    To me, the fact that attributes are not children of the element they are contain within seems to defy the purpose of DOM, which is to represent the entire document as a tree/trees depending on the documenttype. This tree should be made up of Node interfaces, and as attributes inherit from the Node interface (like element, text and so on) it seems odd to me that the attribute is not part of the dom tree.

    But I guess it is easier to rewrite my code according to the "shortcommings" in dom than to change DOM level 2 and subsequently to change the libxml-libraries :-)

    vennlig hilsen Øyvind

    On Thu, 30 Jan 2003 SLangerspirit21.de wrote:

    > Hello > As far as I rememeber according to DOM Level 2 Elementnodes contain > Attributenodes but the Attributenode has no association with its > Elementnode meaning you can't tell from an Attributenode which Elementnode > it belongs to unless you remember it in your code. Thus an Attributenode > is not part of the Domtree as an Elementnode and will not be returned as a > Child of that Node. The only way to retrieve Attributenodes is by going > throught the Elementnode and retrieving the attributes explicitly. > In other words Attributenodes are special nodes which do not get nested in > the DOMtree as children of their corresponding Elementnode. This leaves > space for optimizing the DOMTree by inserting a single attributenode for > multiple Elementnodes. (At least that is what I'm guessing...) > > Please correct me if I'm mistaken > > Stefan

    attached mail follows:


    HI

    I was reading this article : http://www.devarticles.com/art/1/397/2 And am a bit confused now.

    If I understand correctly, the author claims that :

    <?php $php_tags = "PHP Tags" ?> Combining HTML output and <?php echo $php_tags; ?> tags really wastes my time.

    Runs "slightly" faster than

    <?php $php_tags = "PHP Tags"; echo "Never breaking out of $php_tags is much less irritating."; ?>

    IS this true? Is echo more consuming than entering and exiting in and out of context?

    berber

    attached mail follows:


    I need to specify a absolute path to a file on my harddrive, but you can't use backslashes in php. Right?

    Thanks, Dale

    attached mail follows:


    At 10:25 30.01.2003, Dale said: --------------------[snip]-------------------- >I need to specify a absolute path to a file on my harddrive, but you can't >use backslashes in php. Right? --------------------[snip]--------------------

    Oh yes, you can. Just pay attention that the backslash is an "escape" character telling PHP to take the next character literally. So if you want a backslash you need to type 2 of them:

    "C:\Program Files\php" ==> "C:\\Program Files\\php"

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    On Thursday 30 January 2003 17:25, Dale wrote: > I need to specify a absolute path to a file on my harddrive, but you can't > use backslashes in php. Right?

    Please use a descriptive subject.

    You escape an intended literal backslash with a backslash.

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

    /* World War Three can be averted by adherence to a strictly enforced dress code! */

    attached mail follows:


    Inside HTML code, parsed as php, in a select, I've been using the below. It's a bit longer than your plan to use arrays, but it works fine.

    <select name="country"> <option value="">-- Select a country --</option> <option value="USA" <?php if ($country == 'USA') { echo " selected"; } ?>>United States</option> <option value="AFG" <?php if ($country == 'AFG') { echo " selected"; } ?>>Afghanistan</option>

    and so forth....

    attached mail follows:


    Thanks dave for our comments on the use of the list, and sorry for sending this mail to your adress the first time around.

    When we're at it: If a question has already been answered, please do not follow up with a new reply that doesn't add important information/corrections.

    Regards Øyvind

    On Thu, 30 Jan 2003, David Freeman wrote:

    > > G'day Scott > > > Just curious, is there a PHP function that will break up the > > string for us? > > I'm not specifically having a go at you but more observing that some > people use this list as a first line of question rather than doing some > work themselves. > > Assuming that I didn't already know what function provides this > capability I could do the following: > > 1. Go to the online manual at http://www.php.net/manual/ > > 2. Since my problem deals with strings I would then go to the string > functions page of the function reference section of the manual. > > 3. I would then look through the various functions listed here, each of > which includes a short description of what the function does. > > 4. I would notice that within the first dozen entries there's a > function called explode with a description of "Split a string by > string". > > 5. I would guess that this explode function might be fairly close to > what I'm looking for and load it's page. > > 6. I would glance at some of the user contributed notes and see > examples of using explode and even some pitfalls to be aware of in it's > use. > > At this point, my question is answered and I've managed to find out > things in the process. If I've been paying attention I've probably > gained a small appreciation of a few other string related functions that > I didn't know about and filed it away for future use too. > > Just a thought... > > CYA, Dave > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >