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 7 Dec 2006 12:42:34 -0000 Issue 4501

php-general-digest-helplists.php.net
Date: Thu Dec 07 2006 - 06:42:34 CST


php-general Digest 7 Dec 2006 12:42:34 -0000 Issue 4501

Topics (messages 245590 through 245607):

PHP Installation question
        245590 by: Beauford
        245593 by: Chris
        245601 by: Beauford
        245602 by: Chris

Re: How to not be abused by mail form injectors?
        245591 by: Curt Zirzow
        245594 by: Curt Zirzow
        245595 by: Dotan Cohen
        245598 by: bruce
        245599 by: Jochem Maas

Re: taking a one off payment
        245592 by: Mark R. Cervarich
        245605 by: Lester Caine

Re: Newsgroup connect time has become very long
        245596 by: Chuck Anderson
        245597 by: Chuck Anderson

Fatal error: Call to a member function on a non-object
        245600 by: XeRnOuS ThE
        245603 by: Ryan Creaser
        245606 by: T.Lensselink

Re: [PHP-DEV] Making a method called "list" or other "language constructs" names.
        245604 by: Richard Lynch

recursive function problem
        245607 by: Sjef

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:


Hi,

I am trying to install vBulletin and keep getting this error: Fatal error:
Call to undefined function: gzinflate().

The only thing I can find on this is that zlib needs to be configured with
PHP at compile time. So I reinstalled PHP using the following:

./configure --with-mysql --with-apache=../apache_1.3.36 --with-zlib
--with-gd
make
make install

The above finishes with no error.

I rebooted, but still get same error, and zlib or gd doesn't show up in my
phpinfo output. zlib is installed, and from my understanding gd is included
with PHP, all the other libraries for gd are also installed. So what am I
doing wrong?

Also, how do I find out where something is installed? i.e. zlib. If I do a
search on it I get hundreds of hits...

Last. In the above ./configure line I get a message from PHP saying I am
using the built in version of MySQL - if I point it to the actual MySQL
source directory I get the following error.

configure: error: Cannot find libmysqlclient library under ../mysql-5.0.22

Any help is appreciated.

I am using Slacware 10, PHP 4.4.4, MySQL5.0, and Apache 1.3.36

Thanks

attached mail follows:


Beauford wrote:
> Hi,
>
> I am trying to install vBulletin and keep getting this error: Fatal error:
> Call to undefined function: gzinflate().
>
> The only thing I can find on this is that zlib needs to be configured with
> PHP at compile time. So I reinstalled PHP using the following:
>
> ./configure --with-mysql --with-apache=../apache_1.3.36 --with-zlib
> --with-gd
> make
> make install
>
> The above finishes with no error.
>
> I rebooted, but still get same error, and zlib or gd doesn't show up in my
> phpinfo output. zlib is installed, and from my understanding gd is included
> with PHP, all the other libraries for gd are also installed. So what am I
> doing wrong?

Check if you have zlib-devel or zlib-dev package installed. You need
this to be able to compile support into other applications.

No idea how you do this on slackware.

Also try specifying the path to zlib:

--with-zlib=/usr for example.

> Also, how do I find out where something is installed? i.e. zlib. If I do a
> search on it I get hundreds of hits...

No idea about slackware. Do a search or ask a slackware list/forum.

> Last. In the above ./configure line I get a message from PHP saying I am
> using the built in version of MySQL - if I point it to the actual MySQL
> source directory I get the following error.
>
> configure: error: Cannot find libmysqlclient library under ../mysql-5.0.22

Install the mysql-dev/devel &/or mysql-client packages most likely.

Or point it to the right directory. You need to point it to the base of
the mysql package. Eg if mysql is installed in /usr/local/mysql (so
binaries are under /usr/local/mysql/bin & libs are in
/usr/local/mysql/lib) then

--with-mysql=/usr/local/mysql

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


I have zlib-1.2.1.1-i486-1. Whether that is zlib-devel or zlib-dev I have no
idea, and not sure how to find out.

Sort of figured out the MySQL problem, but now I get an error when I run
'make'. This is not a biggie, but the other problem I need to get resolved.

Thanks

-----Original Message-----
From: Chris [mailto:dmagickgmail.com]
Sent: December 6, 2006 7:35 PM
To: Beauford
Cc: php-generallists.php.net
Subject: Re: [PHP] PHP Installation question

Beauford wrote:
> Hi,
>
> I am trying to install vBulletin and keep getting this error: Fatal error:
> Call to undefined function: gzinflate().
>
> The only thing I can find on this is that zlib needs to be configured
> with PHP at compile time. So I reinstalled PHP using the following:
>
> ./configure --with-mysql --with-apache=../apache_1.3.36 --with-zlib
> --with-gd make make install
>
> The above finishes with no error.
>
> I rebooted, but still get same error, and zlib or gd doesn't show up
> in my phpinfo output. zlib is installed, and from my understanding gd
> is included with PHP, all the other libraries for gd are also
> installed. So what am I doing wrong?

Check if you have zlib-devel or zlib-dev package installed. You need this to
be able to compile support into other applications.

No idea how you do this on slackware.

Also try specifying the path to zlib:

--with-zlib=/usr for example.

> Also, how do I find out where something is installed? i.e. zlib. If I
> do a search on it I get hundreds of hits...

No idea about slackware. Do a search or ask a slackware list/forum.

> Last. In the above ./configure line I get a message from PHP saying I
> am using the built in version of MySQL - if I point it to the actual
> MySQL source directory I get the following error.
>
> configure: error: Cannot find libmysqlclient library under
> ../mysql-5.0.22

Install the mysql-dev/devel &/or mysql-client packages most likely.

Or point it to the right directory. You need to point it to the base of the
mysql package. Eg if mysql is installed in /usr/local/mysql (so binaries are
under /usr/local/mysql/bin & libs are in
/usr/local/mysql/lib) then

--with-mysql=/usr/local/mysql

--
Postgresql & php tutorials
http://www.designmagick.com/

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

attached mail follows:


Beauford wrote:
> I have zlib-1.2.1.1-i486-1. Whether that is zlib-devel or zlib-dev I have no
> idea, and not sure how to find out.

Zlib is different to zlib-dev/zlib-devel.

The zlib package only contains the binaries and man pages.

The zlib-devel package contains the header files (zlib.h for example)
you need for compiling against it.

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


On 12/6/06, Peter Lauri <listsdwsasia.com> wrote:
> Hi,
>
>
>
> Are there any general protection methods to minimize the risk of robots
> using your mailing forms as spam senders?
>

Yes, validate and escape data properly, the most important thing you
want to protect is anything that goes into the $headers or
$additional_headers.

in the headers field, you want to be sure that the values dont inject
others so if you'd do something like:

$my_cc = preg_replace('/(\r?\n)', '$1 ', $_POST['CC']);
$headers = ''Cc: $my_cc\r\n"

$my_header = preg_replace('/(\r?\n)', '$1 ', $POST['MyHeader']);
$headers = ''MyHeader: $my_header\r\n"

Which should protect any injection of headers.

I would never even consider any user input being put into $additional_headers.

Curt.

attached mail follows:


On 12/6/06, ryan.fieldingpagesmith.com.au
<ryan.fieldingpagesmith.com.au> wrote:
> I will be out of the office until Monday 11th December. If you have any urgent enquiries, please direct them to Craig Mead on 1300 651 593 or craig.meadpagesmith.com.au.

how stupid people are, i hope mr fielding never needs help from me
cause he has now been plopped into my spam box.

Curt.

attached mail follows:


On 07/12/06, Curt Zirzow <czirzowgmail.com> wrote:
> On 12/6/06, ryan.fieldingpagesmith.com.au
> <ryan.fieldingpagesmith.com.au> wrote:
> > I will be out of the office until Monday 11th December. If you have any urgent enquiries, please direct them to Craig Mead on 1300 651 593 or craig.meadpagesmith.com.au.
>
> how stupid people are, i hope mr fielding never needs help from me
> cause he has now been plopped into my spam box.
>

You obviously don't remember Peter Whalley.

http://what-is-what.com/what_is/spam.html

Dotan Cohen
http://lyricslist.com

attached mail follows:


and what's the issue/problem with an out of office reply?

-----Original Message-----
From: Curt Zirzow [mailto:czirzowgmail.com]
Sent: Wednesday, December 06, 2006 5:12 PM
To: ryan.fieldingpagesmith.com.au
Cc: php-generallists.php.net
Subject: Re: [PHP] How to not be abused by mail form injectors?

On 12/6/06, ryan.fieldingpagesmith.com.au
<ryan.fieldingpagesmith.com.au> wrote:
> I will be out of the office until Monday 11th December. If you have any
urgent enquiries, please direct them to Craig Mead on 1300 651 593 or
craig.meadpagesmith.com.au.

how stupid people are, i hope mr fielding never needs help from me
cause he has now been plopped into my spam box.

Curt.

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

attached mail follows:


bruce wrote:
> and what's the issue/problem with an out of office reply?

n*1000 people on this list don't care to recieve it.
basic list etiquette.

>
>
> -----Original Message-----
> From: Curt Zirzow [mailto:czirzowgmail.com]
> Sent: Wednesday, December 06, 2006 5:12 PM
> To: ryan.fieldingpagesmith.com.au
> Cc: php-generallists.php.net
> Subject: Re: [PHP] How to not be abused by mail form injectors?
>
>
> On 12/6/06, ryan.fieldingpagesmith.com.au
> <ryan.fieldingpagesmith.com.au> wrote:
>> I will be out of the office until Monday 11th December. If you have any
> urgent enquiries, please direct them to Craig Mead on 1300 651 593 or
> craig.meadpagesmith.com.au.
>
> how stupid people are, i hope mr fielding never needs help from me
> cause he has now been plopped into my spam box.
>
>
> Curt.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


http://checkout.google.com -- Google's answer to PayPal.
Best part is, they are taking NO FEES from now through 12/31/2007.
So you can use them to receive credit card payments for just over a
year for FREE.

I've used it, and once account was setup, I was paid within 2-3 days.

Best part is, you can, from inside the webpage, click "Send Invoice"
and it will ask you for an email addy, and a description of what you
are billing 'em for. You don't have to create a full shopping cart
system!!!

mark

On Mon, 20 Nov 2006, Richard Lynch wrote:

> On Thu, November 16, 2006 6:23 am, Jochem Maas wrote:
> > Ross wrote:
> >> Hi,
> >>
> >> What is the best way to take a one off payent (non-paypal).
> >
> > cash in a stable currency ;-)
>
> Gold and Diamonds may also be worth considering. :-)
>
> Sorry.
>
> Now for some real suggestions:
>
> If you really really do mean a one-off payment, Paypal may be the
> simplest answer...
>
> If you mean many one-off payments, any of the shopping carts should work.
>
> You could also consider a MONEY ORDER or REGISTERED CHECK.
>
> >> I have used
> >> oscommece but never attempted a one payment like a subscription
> >> charge.
>
> Hmmmm.
>
> Now it sounds like you want a recurring charge.
>
> I dunno about oscommerce, but you should be able to set up a recurring
> charge with the back-end just by flipping a button somewhere -- The
> bank then hands you a "token" sort of deal which lets you cancel the
> subscription payments, but not do much more with it, so you needn't
> store the CC# to maintain state.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Mark R. Cervarich
Shelfspace.com

attached mail follows:


Mark R. Cervarich wrote:
> http://checkout.google.com -- Google's answer to PayPal.
> Best part is, they are taking NO FEES from now through 12/31/2007.
> So you can use them to receive credit card payments for just over a year
> for FREE.

At 2% + $20 per transaction they needed to do something to get take-up

> I've used it, and once account was setup, I was paid within 2-3 days.
>
> Best part is, you can, from inside the webpage, click "Send Invoice" and
> it will ask you for an email addy, and a description of what you are
> billing 'em for. You don't have to create a full shopping cart system!!!

I'm assuming that this is US only?
An international alternative to Paypal would be nice if only to ensure
that rates are kept competitive.

--
Lester Caine - G8HFL
-----------------------------
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop -
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

attached mail follows:


Al wrote:
> Anyone having problems connecting the last few days? Or, is there something
> wrong on my end. All other sites are working just fine.
>
> Thanks.....
>

Same here. The group has become nearly unusable. I've been ignoring it
for days as most of the time I get a timeout - from Thunderbird -
connecting to news.php.net.

--
*****************************
 Chuck Anderson • Boulder, CO
 http://www.CycleTourist.com
*****************************

attached mail follows:


Al wrote:
> Anyone having problems connecting the last few days? Or, is there something
> wrong on my end. All other sites are working just fine.
>
> Thanks.....
>

Same here. The group has become nearly unusable. I've been ignoring it
for days as most of the time I get a timeout - from Thunderbird -
connecting to news.php.net.

--
*****************************
 Chuck Anderson • Boulder, CO
 http://www.CycleTourist.com
*****************************

attached mail follows:


I am working on a set of PHP framework so to speak, designed to create
module based community & content management based scripts. I just started
updating the authentication handlers, which are all PHP 4 classes, and
reworking a long list of changes. The new version i am coding is near
completely incompatible with the old version hence it is extremely hard for
me to compare the new to the old for these errors.

The problem here is PHP is returning the error "Fatal error: Call to a
member function on a non-object in
/home/thenubs/public_html/nauth7b/classes/Auth.class.php on line 24"

Out of this I have two questions which are
First, if a fatal error is occurring on line 24, why is it executing line 24
successfully and returning data?
And second, if there’s a fatal error on line 24, why is line 25 still
processed?

If anyone sees an alternative way to do what I am doing that might work
better to solve the script errors then I am more than welcome to it as well
seeing how my goal is just to get the script to run right. It seems like
this might just be an error in PHP anyways, but I haven’t found anything on
the net about similar occurrences yet.

The explanation and all of the code that you should need in order to see
what’s going in is below.

The output of the entire page is:

SELECT userid, username, password FROM users WHERE username='XeRnOuS'
Resource id #15
stdClass Object ( [userid] => 1 [username] => XeRnOuS [password] =>
$1$684gXdqL$MwtGhJGa7WkEbQoXe/474. ) 55

Fatal error: Call to a member function on a non-object in
/home/thenubs/public_html/nauth7b/classes/Auth.class.php on line 24

Finally here is the code for the first part of the Auth class that i am
working on.

<?php

class Auth
{
        var $loggedIN = false;
        var $userID = null;
        var $authSID;
        var $userIP;

        var $sql;
        var $err;
        var $perms;
        var $config;
        var $userperms = null;

        function Auth(&$sql, &$err, &$perms)
        {
                //set realtive variables for the sql, err, and perms classes
into the current class for easy access.
                $this->sql = &$sql;
                $this->err = &$err;
                $this->perms = &$perms;
                $this->config = &$GLOBALS['config'];

                $userdat = $sql->fetch_object($sql->query("SELECT userid,
username, password FROM users WHERE username='XeRnOuS'"));
                echo '<h1>';print_r($userdat); echo '55</h1>';

                $this->authSID = session_id();
                $this->userIP = $_SERVER['REMOTE_ADDR'];

                if(!is_object($this->sql)) echo '<h1>$sql IS NOT VALID
OBJECT</h1>';
                if(!method_exists($this->sql, 'query')) echo '<h1>QUERY IS
NOT A VALID METHOD</h1>';
                //destroy timed-out login sessions. Standard users will stay
logged for 1 hour before session is destroyed
                $time = time() - 60 * 60; #60 minutes * 60 seconds per
minute = 1 hour ago.

                //if user is logged into the website, update it in
$this->loggedIN for quick access for class
                //also change $this->userperms from guest permissions to
$this->userID's specific permissions.
                if($_SESSION['loggedIN'] === true &&
!is_null($_SESSION['userID']))
                {
                        //check to see if user's session is still active in
sql.auth_sessions
                        if($this->Auth($_SESSION['userID'], session_id(),
$_SESSION['userIP']))
                        {
                                $this->userID = $_SESSION['userID'];
                                $this->userperms =
$this->perms->getUserPerms($this->userID);

                                //check to see if sql.auth_sessions.flogout
is set, force user logout if is
                                //otherwise update
sql.auth_sessions.lastaccess to current unix time stamp

                                $userdat =
$this->sql->fetch_object($this->sql->query("SELECT flogout FROM
auth_sessions WHERE userID=\"$this->userID\" AND authSID=\"$this->authSID\"
AND userIP=\"$this->userIP\""));
                                if($userdat->flogout === 1)
                                {
                                        $this->Logout();
                                }
                                else
                                {
                                        $this->sql->query("UPDATE
auth_sessions SET lastaccess=\"".time()."\" WHERE userID=\"$this->userID\"
AND authSID=\"$this->authSID\" AND userIP=\"$this->userIP\"");
                                }
                        }
                        else
                        {
                                //users session has timed out, unset session
information, for auth, set userperms to guest permissions
                                $_SESSION['loggedIN'] = false;
                                $_SESSION['userID'] = null;
                                $this->userperms = $perms->getGuestPerms();
                        }

                }
                else
                {
                        //set user permissions file to guest permissions
                        $this->userperms = $this->perms->getGuestPerms();
                }
                return true;
        }

As you can see i have three main classes, and the scripts use pointers to
point to the original definitions of these classes to simplify the access
and save memory.
$sql is a class that has all the php4 compatible mysql functions defined in
it. The syntax is the same as normal mysql function calls, but i added
additional processing and error handling on the side of them, and changed a
few of the default values. This is mostly used for development purposes so i
can debug everything quickly.

the $sql->query function has the following code in it:

      function query($res, $fatal=0)
      {
              echo '<h3>'.$res;
              $res = mysql_query($res, $this->db_link);
              if(!$res)
              {
                      $this->addError('SQL->query', 'SQL Error', 'Failed to
execute the MySQL Query.', $fatal);
              }
              else
              {
                      echo ' '.$res.'</h3>';
                      return $res;
              }
              return false;
      }

Now when we look at line 24 and 25 of the Auth class i have there, we find
these two lines specifically

                $userdat = $sql->fetch_object($sql->query("SELECT userid,
username, password FROM users WHERE username='XeRnOuS'"));
                echo '<h1>';print_r($userdat); echo '55</h1>';

with that in mind its easy to see how the data is generated for the most
part.
it calls sql->query which outputs the SQL query and the resource id for that
sql query, defines the object, then outputs what the objects values are with
the letter 55 in big h1 letters.

It's calling both of those SQL functions properly otherwise it wouldn’t be
displaying any data.
Yet for some reason it is saying that there’s a Fatal Error on line 24, and
I’m calling a member function on a non-object.

Hence once more my questions are:
First, if a fatal error is occurring on line 24, why is it executing line 24
successfully and returning data?
Second, if there’s a fatal error on line 24, why is line 25 still processed?

I've been working on this for the better part of four hours and i would
appreciate any help you guys can give me.

Thanks
- XeRnOuS

_________________________________________________________________
WIN up to $10,000 in cash or prizes – enter the Microsoft Office Live
Sweepstakes http://clk..atdmt.com/MRT/go/aub0050001581mrt/direct/01/

attached mail follows:


XeRnOuS ThE wrote:
>
> First, if a fatal error is occurring on line 24, why is it executing
> line 24 successfully and returning data?
> Second, if there’s a fatal error on line 24, why is line 25 still
> processed?
>

Maybe because you're running it twice? Line 41 with the $this->Auth( ...
seems to be running the constructor again, it might be failing there?

- rjc

attached mail follows:


Not only that. think you are also passing the wrong parameters to the constructor.

On Thu, 07 Dec 2006 15:48:10 +1030, Ryan Creaser <rjcreaserinternode.on.net> wrote:
>
> XeRnOuS ThE wrote:
>>
>> First, if a fatal error is occurring on line 24, why is it executing
>> line 24 successfully and returning data?
>> Second, if there’s a fatal error on line 24, why is line 25 still
>> processed?
>>
>
> Maybe because you're running it twice? Line 41 with the $this->Auth( ...
> seems to be running the constructor again, it might be failing there?
>
> - rjc
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


If you want to write a new parser, or even just submit a patch to
"fix" this, you'll probably figure out why you can't use "list" as a
method name in your class...

Or you'll actually submit a useful patch. :-)

Either way, the problem will be solved, eh?
:-) :-) :-)

On Wed, December 6, 2006 12:22 am, Urbanose wrote:
>
> Yes, list() is a reservred word, but not instance->list(), nor
> className::list(), nor $string = 'This is a list()';, etc. It makes
> no sense.
>
>
> Le 5 déc. 06 à 19:24, Richard Lynch a écrit :
>
>>
>>
>> list is a reserved word.
>>
>> Don't do that.
>>
>> On Mon, December 4, 2006 8:22 am, Urbanose wrote:
>>> Hello there :]
>>>
>>> I wanted to build a method called "list". The problem is that once
>>> I
>>> do that, I get a
>>> "PHP Parse error: syntax error, unexpected T_LIST, expecting
>>> T_STRING"
>>> error, because it's a "language construct".
>>>
>>> Here's the code that leads me to this error :
>>>
>>> <?php
>>> class Foo {
>>> function __construct () {
>>>
>>> }
>>> function list () {
>>> echo "Hello";
>>> }
>>> }
>>> $bar = new Foo ();
>>> $bar->list();
>>> ?>
>>>
>>> So I made it working with a "__call" magic method, like this :
>>>
>>> <?php
>>> class Foo {
>>> function __construct () {
>>>
>>> }
>>> function __call ($name, $arguments) {
>>> echo "Hello";
>>> }
>>> }
>>> $bar = new Foo ();
>>> $bar->list();
>>> ?>
>>>
>>> And it works. So there's my question : why can't we make methods
>>> with
>>> the same name as those used by "language constructs" ? I don't see
>>> the point. Even less if you can make it work with the __call magic
>>> method.
>>>
>>> Does someone have an explanation ? Is there a way to make this
>>> possible for future versions of PHP, so that the classes namespace
>>> is
>>> really independent ?
>>>
>>> Don't tell me to use another name. Writting code like :
>>> $books->list('all');
>>> or :
>>> class Books extends Controller {
>>> function list () {
>>> # Instructions to list all books
>>> }
>>> }
>>> makes things so much easier to read and self explanatory than
>>> putting, for example, a "_" in front of it (_list).
>>>
>>> Thanks :]
>>>
>>> Urbanose
>>>
>>> --
>>> PHP Internals - PHP Runtime Development Mailing List
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>>
>> --
>> Some people have a "gift" link here.
>> Know what I want?
>> I want you to buy a CD from some starving artist.
>> http://cdbaby.com/browse/from/lynch
>> Yeah, I get a buck. So?
>>
>
> Urbanose
>
>
>
>

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Hello!
I wrote a recursive function, but when running the function appache stalls,
the error log says:

module mod_php4.c is already running, skipping

Is this a bug, or am I doing something wrong?

Thanxs, Sjef