php-general Digest 1 Jan 2003 17:26:29 -0000 Issue 1797

Topics (messages 129824 through 129854):

Re: makeing an array
        129824 by: Timothy Hitchens \(HiTCHO\)
        129826 by: Philip J. Newman
        129827 by: Timothy Hitchens \(HiTCHO\)
        129840 by: Sean Malloy
        129841 by: Timothy Hitchens \(HiTCHO\)

Re: Serializing a DOM object
        129825 by: Tom Rogers

Re: PHP3 + session handling limitation
        129828 by: Dan Rossi
        129829 by: Dan Rossi
        129830 by: Tom Rogers
        129831 by: Justin French

Re: Alternatives for Meta Refresh
        129832 by: Justin French
        129833 by: Timothy Hitchens \(HiTCHO\)

Securing areas of a web site with PHP
        129834 by: Jean-Christian Imbeault
        129837 by: Tularis
        129838 by: Jean-Christian Imbeault
        129846 by: Michael J. Pawlowsky
        129848 by: michael kimsal

Need Help.
        129835 by: thkiat
        129851 by: Jason Sheets

error on include_path=(''c:\php4\pear")
        129836 by: anand.texsurat.com

Re: loading a db table into a php array from mysql
        129839 by: David T-G

Re: How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL
        129842 by: . Nilaab
        129843 by: Thomas Seifert

Windows XP
        129844 by: Stephen
        129847 by: Mat Harris

call_user_method_array
        129845 by: Boget, Chris
        129849 by: Marco Tabini
        129850 by: Boget, Chris

error when conecting to mysql
        129852 by: Paul Roberts
        129853 by: Michael J. Pawlowsky

Re: Php 4.3.0 and Mail() function
        129854 by: Carl Bélanger

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Example of an Array:

$my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third');

You can now access these like so:

echo $my_first_array[1];   etc etc

of if you had this:  $my_first_array = array('first_name' => 'Philip',
'last_name' => 'Newman');

You could do this:

echo $my_first_array['first_name'];

The thing to remember is that array's start at 0 "see below!!" (I started at
1 at the top to make it easier).

You can also make an array like so:

$first[] = 'Philip';
$first[] = 'John';
$first[] = 'Paul';

Now you can simply do:

echo $first[0];  // this could output 'Philip';

You can then look at multi dimensional etc...

I trust this get's you on your way.


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


HiTCHO | Open Platform Web Development
Consulting - Outsourcing - Training - Support


----- Original Message -----
From: "Philip J. Newman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 2:57 PM
Subject: [PHP] makeing an array


> Can someone help me make an array ...
>
> I have $foo amount of loops to preform (1-20), and would like to make the
> veriable work for me like $comment_1, $comment_2 etc etc.
>
> http://nz.php.net/manual/en/function.array.php makes no sence to me after
i
> read it and read it ...
>
> help me please
>
> ---
> Philip J. Newman.
> Head Developer.
> PhilipNZ.com New Zealand Ltd.
> http://www.philipnz.com/
> [EMAIL PROTECTED]
>
> Mob: +64 (25) 6144012.
> Tele: +64 (9) 5769491.
>
> VitalKiwi Site:
> Philip J. Newman
> Internet Developer
> http://www.newman.net.nz/
> [EMAIL PROTECTED]
>
> *****************************
>   Friends are like Stars,
>   You can't always see them,
>   But you know they are there.
>
> *****************************
>
> ICQ#: 20482482
> MSN ID: [EMAIL PROTECTED]
> Yahoo: [EMAIL PROTECTED]
> AIM: newmanpjkiwi
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
So in saything that I could do this ...

$s = 10

$comment[1] = '$comment_1';
$comment[2] = '$comment_2';
$comment[3] = '$comment_2';

for($i = 0; $i <= $s; $i++) {

     echo $comment[$i]."<br>";

}



----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
To: "Philip J. Newman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 6:12 PM
Subject: Re: [PHP] makeing an array


> Example of an Array:
>
> $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third');
>
> You can now access these like so:
>
> echo $my_first_array[1];   etc etc
>
> of if you had this:  $my_first_array = array('first_name' => 'Philip',
> 'last_name' => 'Newman');
>
> You could do this:
>
> echo $my_first_array['first_name'];
>
> The thing to remember is that array's start at 0 "see below!!" (I started
at
> 1 at the top to make it easier).
>
> You can also make an array like so:
>
> $first[] = 'Philip';
> $first[] = 'John';
> $first[] = 'Paul';
>
> Now you can simply do:
>
> echo $first[0];  // this could output 'Philip';
>
> You can then look at multi dimensional etc...
>
> I trust this get's you on your way.
>
>
> Timothy Hitchens (HiTCHO)
> [EMAIL PROTECTED]
>
>
> HiTCHO | Open Platform Web Development
> Consulting - Outsourcing - Training - Support
>
>
> ----- Original Message -----
> From: "Philip J. Newman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 01, 2003 2:57 PM
> Subject: [PHP] makeing an array
>
>
> > Can someone help me make an array ...
> >
> > I have $foo amount of loops to preform (1-20), and would like to make
the
> > veriable work for me like $comment_1, $comment_2 etc etc.
> >
> > http://nz.php.net/manual/en/function.array.php makes no sence to me
after
> i
> > read it and read it ...
> >
> > help me please
> >
> > ---
> > Philip J. Newman.
> > Head Developer.
> > PhilipNZ.com New Zealand Ltd.
> > http://www.philipnz.com/
> > [EMAIL PROTECTED]
> >
> > Mob: +64 (25) 6144012.
> > Tele: +64 (9) 5769491.
> >
> > VitalKiwi Site:
> > Philip J. Newman
> > Internet Developer
> > http://www.newman.net.nz/
> > [EMAIL PROTECTED]
> >
> > *****************************
> >   Friends are like Stars,
> >   You can't always see them,
> >   But you know they are there.
> >
> > *****************************
> >
> > ICQ#: 20482482
> > MSN ID: [EMAIL PROTECTED]
> > Yahoo: [EMAIL PROTECTED]
> > AIM: newmanpjkiwi
> >
> >
> > --
> > 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
>

--- End Message ---
--- Begin Message ---
Use the count like following inside to ensure that you don't
call on a non existent index.

for ($i = 0, $x = count($comment); $i < $x; $i++)
{
    echo $comment[$i].'<br />';
}

Why do you want to echo out $comment_1 ???



Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


HiTCHO | Open Platform Web Development
Consulting - Outsourcing - Training - Support


----- Original Message -----
From: "Philip J. Newman" <[EMAIL PROTECTED]>
To: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 3:29 PM
Subject: Re: [PHP] makeing an array


> So in saything that I could do this ...
>
> $s = 10
>
> $comment[1] = '$comment_1';
> $comment[2] = '$comment_2';
> $comment[3] = '$comment_2';
>
> for($i = 0; $i <= $s; $i++) {
>
>      echo $comment[$i]."<br>";
>
> }
>
>
>
> ----- Original Message -----
> From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
> To: "Philip J. Newman" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
> Sent: Wednesday, January 01, 2003 6:12 PM
> Subject: Re: [PHP] makeing an array
>
>
> > Example of an Array:
> >
> > $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third');
> >
> > You can now access these like so:
> >
> > echo $my_first_array[1];   etc etc
> >
> > of if you had this:  $my_first_array = array('first_name' => 'Philip',
> > 'last_name' => 'Newman');
> >
> > You could do this:
> >
> > echo $my_first_array['first_name'];
> >
> > The thing to remember is that array's start at 0 "see below!!" (I
started
> at
> > 1 at the top to make it easier).
> >
> > You can also make an array like so:
> >
> > $first[] = 'Philip';
> > $first[] = 'John';
> > $first[] = 'Paul';
> >
> > Now you can simply do:
> >
> > echo $first[0];  // this could output 'Philip';
> >
> > You can then look at multi dimensional etc...
> >
> > I trust this get's you on your way.
> >
> >
> > Timothy Hitchens (HiTCHO)
> > [EMAIL PROTECTED]
> >
> >
> > HiTCHO | Open Platform Web Development
> > Consulting - Outsourcing - Training - Support
> >
> >
> > ----- Original Message -----
> > From: "Philip J. Newman" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 01, 2003 2:57 PM
> > Subject: [PHP] makeing an array
> >
> >
> > > Can someone help me make an array ...
> > >
> > > I have $foo amount of loops to preform (1-20), and would like to make
> the
> > > veriable work for me like $comment_1, $comment_2 etc etc.
> > >
> > > http://nz.php.net/manual/en/function.array.php makes no sence to me
> after
> > i
> > > read it and read it ...
> > >
> > > help me please
> > >
> > > ---
> > > Philip J. Newman.
> > > Head Developer.
> > > PhilipNZ.com New Zealand Ltd.
> > > http://www.philipnz.com/
> > > [EMAIL PROTECTED]
> > >
> > > Mob: +64 (25) 6144012.
> > > Tele: +64 (9) 5769491.
> > >
> > > VitalKiwi Site:
> > > Philip J. Newman
> > > Internet Developer
> > > http://www.newman.net.nz/
> > > [EMAIL PROTECTED]
> > >
> > > *****************************
> > >   Friends are like Stars,
> > >   You can't always see them,
> > >   But you know they are there.
> > >
> > > *****************************
> > >
> > > ICQ#: 20482482
> > > MSN ID: [EMAIL PROTECTED]
> > > Yahoo: [EMAIL PROTECTED]
> > > AIM: newmanpjkiwi
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
why the $x variable aswell?!

for ($i = 0; $i < count($comment); $i++)
{
    echo $comment[$i].'<br />';
}

or even faster:

$i = count($comment);
while ($i--)
{
    echo $comment[$i].'<br />';
}

> -----Original Message-----
> From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 1 January 2003 4:41 PM
> To: Philip J. Newman; [EMAIL PROTECTED]
> Subject: Re: [PHP] makeing an array
>
>
> Use the count like following inside to ensure that you don't
> call on a non existent index.
>
> for ($i = 0, $x = count($comment); $i < $x; $i++)
> {
>     echo $comment[$i].'<br />';
> }
>
> Why do you want to echo out $comment_1 ???
>
>
>
> Timothy Hitchens (HiTCHO)
> [EMAIL PROTECTED]
>
>
> HiTCHO | Open Platform Web Development
> Consulting - Outsourcing - Training - Support
>
>
> ----- Original Message -----
> From: "Philip J. Newman" <[EMAIL PROTECTED]>
> To: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Wednesday, January 01, 2003 3:29 PM
> Subject: Re: [PHP] makeing an array
>
>
> > So in saything that I could do this ...
> >
> > $s = 10
> >
> > $comment[1] = '$comment_1';
> > $comment[2] = '$comment_2';
> > $comment[3] = '$comment_2';
> >
> > for($i = 0; $i <= $s; $i++) {
> >
> >      echo $comment[$i]."<br>";
> >
> > }
> >
> >
> >
> > ----- Original Message -----
> > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
> > To: "Philip J. Newman" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 01, 2003 6:12 PM
> > Subject: Re: [PHP] makeing an array
> >
> >
> > > Example of an Array:
> > >
> > > $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third');
> > >
> > > You can now access these like so:
> > >
> > > echo $my_first_array[1];   etc etc
> > >
> > > of if you had this:  $my_first_array = array('first_name' => 'Philip',
> > > 'last_name' => 'Newman');
> > >
> > > You could do this:
> > >
> > > echo $my_first_array['first_name'];
> > >
> > > The thing to remember is that array's start at 0 "see below!!" (I
> started
> > at
> > > 1 at the top to make it easier).
> > >
> > > You can also make an array like so:
> > >
> > > $first[] = 'Philip';
> > > $first[] = 'John';
> > > $first[] = 'Paul';
> > >
> > > Now you can simply do:
> > >
> > > echo $first[0];  // this could output 'Philip';
> > >
> > > You can then look at multi dimensional etc...
> > >
> > > I trust this get's you on your way.
> > >
> > >
> > > Timothy Hitchens (HiTCHO)
> > > [EMAIL PROTECTED]
> > >
> > >
> > > HiTCHO | Open Platform Web Development
> > > Consulting - Outsourcing - Training - Support
> > >
> > >
> > > ----- Original Message -----
> > > From: "Philip J. Newman" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, January 01, 2003 2:57 PM
> > > Subject: [PHP] makeing an array
> > >
> > >
> > > > Can someone help me make an array ...
> > > >
> > > > I have $foo amount of loops to preform (1-20), and would
> like to make
> > the
> > > > veriable work for me like $comment_1, $comment_2 etc etc.
> > > >
> > > > http://nz.php.net/manual/en/function.array.php makes no sence to me
> > after
> > > i
> > > > read it and read it ...
> > > >
> > > > help me please
> > > >
> > > > ---
> > > > Philip J. Newman.
> > > > Head Developer.
> > > > PhilipNZ.com New Zealand Ltd.
> > > > http://www.philipnz.com/
> > > > [EMAIL PROTECTED]
> > > >
> > > > Mob: +64 (25) 6144012.
> > > > Tele: +64 (9) 5769491.
> > > >
> > > > VitalKiwi Site:
> > > > Philip J. Newman
> > > > Internet Developer
> > > > http://www.newman.net.nz/
> > > > [EMAIL PROTECTED]
> > > >
> > > > *****************************
> > > >   Friends are like Stars,
> > > >   You can't always see them,
> > > >   But you know they are there.
> > > >
> > > > *****************************
> > > >
> > > > ICQ#: 20482482
> > > > MSN ID: [EMAIL PROTECTED]
> > > > Yahoo: [EMAIL PROTECTED]
> > > > AIM: newmanpjkiwi
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > --
> > PHP 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
>

--- End Message ---
--- Begin Message ---
Your example of:

for ($i = 0; $i < count($comment); $i++)

Is very bad as the count will be parsed each loop.

The count as I had it gets parsed only once.


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


HiTCHO | Open Platform Web Development
Consulting - Outsourcing - Training - Support


----- Original Message -----
From: "Sean Malloy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 9:40 PM
Subject: RE: [PHP] makeing an array


> why the $x variable aswell?!
>
> for ($i = 0; $i < count($comment); $i++)
> {
>     echo $comment[$i].'<br />';
> }
>
> or even faster:
>
> $i = count($comment);
> while ($i--)
> {
>     echo $comment[$i].'<br />';
> }
>
> > -----Original Message-----
> > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, 1 January 2003 4:41 PM
> > To: Philip J. Newman; [EMAIL PROTECTED]
> > Subject: Re: [PHP] makeing an array
> >
> >
> > Use the count like following inside to ensure that you don't
> > call on a non existent index.
> >
> > for ($i = 0, $x = count($comment); $i < $x; $i++)
> > {
> >     echo $comment[$i].'<br />';
> > }
> >
> > Why do you want to echo out $comment_1 ???
> >
> >
> >
> > Timothy Hitchens (HiTCHO)
> > [EMAIL PROTECTED]
> >
> >
> > HiTCHO | Open Platform Web Development
> > Consulting - Outsourcing - Training - Support
> >
> >
> > ----- Original Message -----
> > From: "Philip J. Newman" <[EMAIL PROTECTED]>
> > To: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 01, 2003 3:29 PM
> > Subject: Re: [PHP] makeing an array
> >
> >
> > > So in saything that I could do this ...
> > >
> > > $s = 10
> > >
> > > $comment[1] = '$comment_1';
> > > $comment[2] = '$comment_2';
> > > $comment[3] = '$comment_2';
> > >
> > > for($i = 0; $i <= $s; $i++) {
> > >
> > >      echo $comment[$i]."<br>";
> > >
> > > }
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
> > > To: "Philip J. Newman" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > > Sent: Wednesday, January 01, 2003 6:12 PM
> > > Subject: Re: [PHP] makeing an array
> > >
> > >
> > > > Example of an Array:
> > > >
> > > > $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third');
> > > >
> > > > You can now access these like so:
> > > >
> > > > echo $my_first_array[1];   etc etc
> > > >
> > > > of if you had this:  $my_first_array = array('first_name' =>
'Philip',
> > > > 'last_name' => 'Newman');
> > > >
> > > > You could do this:
> > > >
> > > > echo $my_first_array['first_name'];
> > > >
> > > > The thing to remember is that array's start at 0 "see below!!" (I
> > started
> > > at
> > > > 1 at the top to make it easier).
> > > >
> > > > You can also make an array like so:
> > > >
> > > > $first[] = 'Philip';
> > > > $first[] = 'John';
> > > > $first[] = 'Paul';
> > > >
> > > > Now you can simply do:
> > > >
> > > > echo $first[0];  // this could output 'Philip';
> > > >
> > > > You can then look at multi dimensional etc...
> > > >
> > > > I trust this get's you on your way.
> > > >
> > > >
> > > > Timothy Hitchens (HiTCHO)
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > > > HiTCHO | Open Platform Web Development
> > > > Consulting - Outsourcing - Training - Support
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Philip J. Newman" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Wednesday, January 01, 2003 2:57 PM
> > > > Subject: [PHP] makeing an array
> > > >
> > > >
> > > > > Can someone help me make an array ...
> > > > >
> > > > > I have $foo amount of loops to preform (1-20), and would
> > like to make
> > > the
> > > > > veriable work for me like $comment_1, $comment_2 etc etc.
> > > > >
> > > > > http://nz.php.net/manual/en/function.array.php makes no sence to
me
> > > after
> > > > i
> > > > > read it and read it ...
> > > > >
> > > > > help me please
> > > > >
> > > > > ---
> > > > > Philip J. Newman.
> > > > > Head Developer.
> > > > > PhilipNZ.com New Zealand Ltd.
> > > > > http://www.philipnz.com/
> > > > > [EMAIL PROTECTED]
> > > > >
> > > > > Mob: +64 (25) 6144012.
> > > > > Tele: +64 (9) 5769491.
> > > > >
> > > > > VitalKiwi Site:
> > > > > Philip J. Newman
> > > > > Internet Developer
> > > > > http://www.newman.net.nz/
> > > > > [EMAIL PROTECTED]
> > > > >
> > > > > *****************************
> > > > >   Friends are like Stars,
> > > > >   You can't always see them,
> > > > >   But you know they are there.
> > > > >
> > > > > *****************************
> > > > >
> > > > > ICQ#: 20482482
> > > > > MSN ID: [EMAIL PROTECTED]
> > > > > Yahoo: [EMAIL PROTECTED]
> > > > > AIM: newmanpjkiwi
> > > > >
> > > > >
> > > > > --
> > > > > PHP General Mailing List (http://www.php.net/)
> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi,

Wednesday, January 1, 2003, 5:28:43 AM, you wrote:
>> Try encoding like this:
>> $retval = base64_encode(serialize( domxml_open_mem( $xml )));
>> and on the next page:
>> $xml = unserialize(base64_decode($xml));
>> It works via html but don't know enough about soap

BC> Well, you don't have to use soap - you can use sessions and get the
BC> same result.
BC> As for your suggestion, it didn't work. :(  I can do a print_r() and a
BC> var_dump() on the variable before and after I serialize/encode it and
BC> get the save values each time:

BC> var_dump():

BC> object(domdocument)(9) {
BC>   ["name"]=>
BC>   string(9) "#document"
BC>   ["url"]=>
BC>   string(0) ""
BC>   ["version"]=>
BC>   string(3) "1.0"
BC>   ["standalone"]=>
BC>   int(-1)
BC>   ["type"]=>
BC>   int(9)
BC>   ["compression"]=>
BC>   int(-1)
BC>   ["charset"]=>
BC>   int(1)
BC>   [0]=>
BC>   int(14)
BC>   [1]=>
BC>   int(138478176)
BC> }

BC> print_r():

BC> domdocument Object
BC> (
BC>     [name] => #document
BC>     [url] =>
BC>     [version] => 1.0
BC>     [standalone] => -1
BC>     [type] => 9
BC>     [compression] => -1
BC>     [charset] => 1
BC>     [0] => 14
BC>     [1] => 138478176
BC> )


BC> When I try to $DOMobject->dump_mem() before I serialize/encode it, I
BC> get the underlying XML.  However, when I use dump_mem() afterwards, I
BC> am getting those errors mentioned in my previous post.
BC> I just don't understand why.  I'm having no problems serializing and
BC> passing (through sessions or otherwise) other object, I'm just not
BC> having any luck with the internal DOM object.

BC> Chris
Well to get rid of the error message you need to create a dummy dom object b4
you unserialize like:

$obj = domxml_new_doc('1.0');

But I could not get serialize to do the whole dom object only the first
level....

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
yes sorry to be vague i've started to try and implement this , but is
tedious to get going, plus it has the pear db like functions so upgrading
shouldnt be a problem then when it comes round to it

-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 7:57 PM
To: electroteque
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] RE: PHP3 + session handling limitation


Hi,

Tuesday, December 31, 2002, 4:54:36 PM, you wrote:
e> hi i've just started a job and they are sadly using php3 ,  what is the
work
e> around for the session handling limitation ? i have an authentication
class
e> which will not work now beause it cant handles sessions :|

Have a look at phplib

http://www.sanisoft.com/phplib/manual/intro.php#intro.whatis.phplib

--
regards,
Tom

--- End Message ---
--- Begin Message ---
oh have you got an example proper usage of it ? i had it working then
suddenly i didnt :|

-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 7:57 PM
To: electroteque
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] RE: PHP3 + session handling limitation


Hi,

Tuesday, December 31, 2002, 4:54:36 PM, you wrote:
e> hi i've just started a job and they are sadly using php3 ,  what is the
work
e> around for the session handling limitation ? i have an authentication
class
e> which will not work now beause it cant handles sessions :|

Have a look at phplib

http://www.sanisoft.com/phplib/manual/intro.php#intro.whatis.phplib

--
regards,
Tom

--- End Message ---
--- Begin Message ---
Hi,

Wednesday, January 1, 2003, 4:01:35 PM, you wrote:
DR> oh have you got an example proper usage of it ? i had it working then
DR> suddenly i didnt :|

DR> -----Original Message-----
DR> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
DR> Sent: Tuesday, December 31, 2002 7:57 PM
DR> To: electroteque
DR> Cc: [EMAIL PROTECTED]
DR> Subject: Re: [PHP] RE: PHP3 + session handling limitation


DR> Hi,

DR> Tuesday, December 31, 2002, 4:54:36 PM, you wrote:
e>> hi i've just started a job and they are sadly using php3 ,  what is the
DR> work
e>> around for the session handling limitation ? i have an authentication
DR> class
e>> which will not work now beause it cant handles sessions :|

DR> Have a look at phplib

DR> http://www.sanisoft.com/phplib/manual/intro.php#intro.whatis.phplib

DR> --
DR> regards,
DR> Tom

I have never had to use it for session functions so I don't have any examples.
There should be some in the docs I would think.

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
on 31/12/02 5:54 PM, electroteque ([EMAIL PROTECTED]) wrote:

> hi i've just started a job and they are sadly using php3 ,  what is the work
> around for the session handling limitation ? i have an authentication class
> which will not work now beause it cant handles sessions :|

I don't think there's a work-around that will be able to port your class
into the PHP3 environment.  Using PHP3 (in ye olde days) meant either:

a) rolling your own session handling system
b) using PHPLib, a library of files and document templates that include
session handling

Either way, you're probably talking about a pretty major redevelopment /
extension of your code to suit.

The easiest solution is to just upgrade or move to a host using PHP4...
really, it's been YEARS since PHP4, and I can't see any reason to hang
around with PHP3.


Good luck,

Justin

--- End Message ---
--- Begin Message ---
on 31/12/02 2:48 AM, Stephen ([EMAIL PROTECTED]) wrote:

> I'm writing a PHP chat script and I'm rather stumped on this. I either want
> the chat window to refresh when there's a new message or refresh every few
> seconds but not with meta refresh, rather something with less noise (the
> infamous IE clicking sound) and/or something faster. The only thing I can
> think of is the header function. Any ideas?

The header() function (like everything in PHP) happens SERVER SIDE before
the page hits the browser, so this won't help.

META refresh is the only standard, HTML way to do it, AFAIK -- and even
then, i'm not 100% sure that all browsers and user agents support it.

Another option would be for javascript to refresh the page, but again, this
will probably invoke the IE clicking sound.


Most chat programs do use either meta refresh, or some sort of Java applet
instead of refreshing.


I think there are also some Flash chat things out there too.


Cheers,

Justin

--- End Message ---
--- Begin Message ---
Let me give you a direction with this one.

You can use a http/1.1 stream and keep flushing the buffer with an script
timeout set to 0.

Simply open the page then just add something to the buffer and flush and
then
wait a little while then flush... just like a database would do.

I do have a working application somewhere.

No clicking... but remember that IE has a 2 connection limit per domain.
(without registry changes)


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


HiTCHO | Open Platform Web Development
Consulting - Outsourcing - Training - Support


----- Original Message -----
From: "Justin French" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
<[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 5:42 PM
Subject: Re: [PHP] Alternatives for Meta Refresh


> on 31/12/02 2:48 AM, Stephen ([EMAIL PROTECTED]) wrote:
>
> > I'm writing a PHP chat script and I'm rather stumped on this. I either
want
> > the chat window to refresh when there's a new message or refresh every
few
> > seconds but not with meta refresh, rather something with less noise (the
> > infamous IE clicking sound) and/or something faster. The only thing I
can
> > think of is the header function. Any ideas?
>
> The header() function (like everything in PHP) happens SERVER SIDE before
> the page hits the browser, so this won't help.
>
> META refresh is the only standard, HTML way to do it, AFAIK -- and even
> then, i'm not 100% sure that all browsers and user agents support it.
>
> Another option would be for javascript to refresh the page, but again,
this
> will probably invoke the IE clicking sound.
>
>
> Most chat programs do use either meta refresh, or some sort of Java applet
> instead of refreshing.
>
>
> I think there are also some Flash chat things out there too.
>
>
> Cheers,
>
> Justin
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message --- On my web site there are some areas that I want to make accessible only after a user has logged in (for example when placing an order, etc ...) I have been able to achieve this however I have the following problem:

1- user logs in
2- user goes to restricted area
3- user views pages, orders an item, changes his account settings, etc ...
4- user logs out
5- user is sent to log out page
6- user hits back button ...

And here my problems start ... even though the user has logged out, all the "restricted" pages he saw are still cached by his browser and accessible ...

I have tried using a script that checks a session variable that indicates if a user is logged in or not and take appropriate action at the start of all "restricted" pages, but that doesn't work since when the user hits the back button, the PHP script is not re-executed, the page is simply loaded from the browser cache.

What are some PHP techniques I could use so that a user can no longer access/use pages once he has logged out?

Basically I would like to have sort of state machine so I that I can simply check where a user is coming from and his login "state" to decide if a certain page should be presented or not (i.e. you can't get here form there or you can't view that page with your current login status).

But it seemed that creating a state machine is not the right way to go about it since hitting the back button pretty much allows a user to circumvent this ...

Eventually the web site I will build will actually have many "areas", each needing a separate/different login, (and you can be logged in to multiple "areas" at once) so I would like to be able to generalize this problem and understand how I can use PHP to implement the needed functionality.

Just as a simple example, once a user has placed an order, he should not be able to go back to the "order placing/processing" pages ...

Any tips, hints, or pointers to tutorials are appreciated!

Thanks,

Jc

--- End Message ---
--- Begin Message ---
Jean-Christian Imbeault wrote:
1- user logs in
2- user goes to restricted area
3- user views pages, orders an item, changes his account settings, etc ...
4- user logs out
5- user is sent to log out page
6- user hits back button ...

And here my problems start ... even though the user has logged out, all the "restricted" pages he saw are still cached by his browser and accessible ...

I have tried using a script that checks a session variable that indicates if a user is logged in or not and take appropriate action at the start of all "restricted" pages, but that doesn't work since when the user hits the back button, the PHP script is not re-executed, the page is simply loaded from the browser cache.

What are some PHP techniques I could use so that a user can no longer access/use pages once he has logged out?

I adives to make sure the browser doesn't cache it *at all*.
This can be done using (one, or more) of the following headers:

// HTTP 1.1 compliant:
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP 1.0 compliant:
header("Pragma: no-cache");

Hope that helps,
- Tularis

--- End Message ---
--- Begin Message ---
Tularis wrote:
I adives to make sure the browser doesn't cache it *at all*.
This can be done using (one, or more) of the following headers:

// HTTP 1.1 compliant:
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP 1.0 compliant:
header("Pragma: no-cache");
I'll try this out and see what I get. Though I have read that not all browsers follow cache-control directives ...

This would cause the load on my web server to increase for those pages though ... might there be another way?

If not then it will have to do ...

Thanks for the advice!

Jc

--- End Message ---
--- Begin Message ---
It's not a PHP thing but a browser thing. Basically you need to expire a page as soon 
as the browser has loaded it.
This can be done using the meta key expires.


<meta http-equiv="Expires" content="expiration date">

As in

<META HTTP-EQUIV="Expires" CONTENT="Mon, 01 Jan 1996 01:01:01 GMT">


If you are running an IIS server look at the server properties...  you need to enable 
this in there.




*********** REPLY SEPARATOR  ***********

On 01/01/2003 at 5:22 PM Jean-Christian Imbeault wrote:

>On my web site there are some areas that I want to make accessible only
>after a user has logged in (for example when placing an order, etc ...)
>I have been able to achieve this however I have the following problem:
>
>1- user logs in
>2- user goes to restricted area
>3- user views pages, orders an item, changes his account settings, etc ...
>4- user logs out
>5- user is sent to log out page
>6- user hits back button ...
>
>And here my problems start ... even though the user has logged out, all
>the "restricted" pages he saw are still cached by his browser and
>accessible ...
>
>I have tried using a script that checks a session variable that
>indicates if a user is logged in or not and take appropriate action at
>the start of all "restricted" pages, but that doesn't work since when
>the user hits the back button, the PHP script is not re-executed, the
>page is simply loaded from the browser cache.
>
>What are some PHP techniques I could use so that a user can no longer
>access/use pages once he has logged out?
>
>Basically I would like to have sort of state machine so I that I can
>simply check where a user is coming from and his login "state" to decide
>if a certain page should be presented or not (i.e. you can't get here
>form there or you can't view that page with your current login status).
>
>But it seemed that creating a state machine is not the right way to go
>about it since hitting the back button pretty much allows a user to
>circumvent this ...

>
>Eventually the web site I will build will actually have many "areas",
>each needing a separate/different login, (and you can be logged in to
>multiple "areas" at once) so I would like to be able to generalize this
>problem and understand how I can use PHP to implement the needed
>functionality.
>
>Just as a simple example, once a user has placed an order, he should not
>be able to go back to the "order placing/processing" pages ...
>
>Any tips, hints, or pointers to tutorials are appreciated!
>
>Thanks,
>
>Jc
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
Jean-Christian Imbeault wrote:


I'll try this out and see what I get. Though I have read that not all browsers follow cache-control directives ...
Exactly - and some don't follow other HTTP header directives to the letter either. You will not be able to 'secure' this stuff 100% simply
because you only control 50% of the environment (the server, not the client). The cache-control stuff people have already replied is good, but realize nothing's 100%. You also can't prevent someone from taking a snapshot of the page, or control who sees a piece of paper with the information printed on it either. :)



--- End Message ---
--- Begin Message ---
Hi, I'm a newbie for PHP. Just installed IIS & PHP on my PC. A test run gave me this:-
Warning: main(quote.php) [function.main]: failed to create stream: No such file or 
directory in C:\Documents and Settings\aaa\My Documents\My 
Webs\excelpoint.org\index.php on line 139

Warning: main() [function.main]: Failed opening 'quote.php' for inclusion 
(include_path='.;c:\php4\pear') in C:\Documents and Settings\aaa\My Documents\My 
Webs\excelpoint.org\index.php on line 139

Somehow, I don't have this problem when I run this file on my remote webserver.

Please advise. TQ!!!
--- End Message ---
--- Begin Message ---
Your include path is not setup so that the web server can find the file
you are trying to include, if the file is in a sub directory make sure
you are properly including it include_once('include/main.php') not just
include_once('main.php').

And make sure the file you are trying to include exists in the location
you think it does.

Jason
On Wed, 2003-01-01 at 01:28, thkiat wrote:
> Hi, I'm a newbie for PHP. Just installed IIS & PHP on my PC. A test run gave me 
>this:-
> Warning: main(quote.php) [function.main]: failed to create stream: No such file or 
>directory in C:\Documents and Settings\aaa\My Documents\My 
>Webs\excelpoint.org\index.php on line 139
> 
> Warning: main() [function.main]: Failed opening 'quote.php' for inclusion 
>(include_path='.;c:\php4\pear') in C:\Documents and Settings\aaa\My Documents\My 
>Webs\excelpoint.org\index.php on line 139
> 
> Somehow, I don't have this problem when I run this file on my remote webserver.
> 
> Please advise. TQ!!!

--- End Message ---
--- Begin Message ---
hi friends
i find some problem in installing this script
it gives me same error in both IIS and apache server it is like below

Fatal error: Failed opening required '/home/phpshop/etc/phpshop.cfg'
(include_path=''c:\php4\pear") in
c:\nusphere\apache\nsdocs\phpshop\bin\index.php on line 19
and in apache it is like

Fatal error: Failed opening required '/home/phpshop/etc/phpshop.cfg'
(include_path='') in c:\nusphere\apache\nsdocs\phpshop\bin\index.php on line
19

where i have php 4.2.3 version
even on my system there is no any directory like php4/pear why it shows me
this error.



--- End Message ---
--- Begin Message ---
Rick, et al --

...and then Rick Widmer said...
% 
% At 02:57 PM 12/31/02 -0500, David T-G wrote:
% >...and then Tularis said...
% >%
% >% Usually,
% >% using mysql to handle your tables is *way* faster than letting php
% >% handle it.
% 
% Yes, do as much as you can in the database.  The people who wrote it spent 
% a lot of time trying to optimize it.

Yeah :-)


% 
% >% In your case, you could just do a complex join I think. That would give
% >
% >Ahhh...  A new term.  Back to the books for me!
% 
% Here is a query from one of my projects...
...

Wow.  Some piece of work.


% 
% Every field in the Schedule table is a key to another table that has to be 
% looked up and translated to something people will understand.  Note the two 

Exactly my situation (by design; I at least know that I wouldn't want to
store a name string in the schedule again and again and again :-)


% different ways of connecting tables with LEFT JOIN.  USING( fieldname ) 
% connects the  table being joined, with the table listed right before it, 
% using the same fieldname in both.  The ON syntax allows you to use 
% differently named fields, and/or a different table.

I still don't get what a left or right or outer or inner join is...  I've
read the mysql docs for the syntax and some examples, but this is a place
where I'll need to go to outside tutorials.  Do you know of any (on the
web) which will give me the background?


TIA & Thanks for the example & Happy New Year

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg91196/pgp00000.pgp
Description: PGP signature

--- End Message ---
--- Begin Message ---
Jason, thanks, but see if you can you read the initial question and try to
answer that one for me. You are a great help with resources when I need
them. Your help is always appreciated. The origial clip is as follows
(concentrate on the ending question):



Hello Everyone,

I want to DELETE multiple items of multiple TABLES in a MySQL database. My
version of MySQL is 3.23, which means this version doesn't support the
DELETE functionality on multiple tables. The following is my PHP code, where
$item_id is a multi-dimensional array containing the ids of the many items I
want to delete from the table.

   # DELETE records
   for ($i = 0; $i < count($item_id); $i++) {
     $query_item2 .=  "DELETE QUICK FROM item_dimension WHERE item_id =
'".$item_id[$i][0]."'; ";
     $query_item2 .= "DELETE QUICK FROM item_popup WHERE item_id =
'".$item_id[$i][0]."'; ";
   }

When I run this through the database using PHP, it returns a syntax error in
the SQL. So what I did was echo out $query_item2, then copied and pasted the
SQL into the MySQL application manually, and ran it through. Well the exact
same SQL statement that I used in PHP worked when I entered it manually in
MySQL. In other words it didn't work doing it through PHP, but it worked in
MySQL directly. What gives?

Is there a better way to delete multiple items
from multiple tables with one SQL string? I don't want to separate the two
DELETE functions and run them through two separate times because of overhead
concerns. I tried looking on the MySQL and PHP website for better ways of
using DELETE syntax on multiple tables, but I had no luck finding anything
useful with my version of MySQL. Any help would be greatly appreciated.


--- End Message ---
--- Begin Message ---
there is no need to close and open the connection for every query.
just run the mysql_query again and again and again on the open connection.
Still Stephen's quote is true, you can't run more than one query by one call to 
mysql_query.


Thomas

On Tue, 31 Dec 2002 16:30:38 -0600 [EMAIL PROTECTED] (@ Nilaab) wrote:

> I was hoping for better news. Thanks for the suggestion, but it will put a
> very big strain on my application since every DELETE query will open and
> close the mysql connection everytime. Think about deleting 100s of records
> one at a time. Surely someone has thought of a better way to do this with
> MySQL 3.23. Also, I don't want to run persistent connections, as I only have
> a limited number of simultaneous connections to the database currently. Is
> there a better way to do all this? Anyone?
> 
> > -----Original Message-----
> > From: Stephen [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, December 31, 2002 1:10 PM
> > To: @ Nilaab
> > Cc: PHP List
> > Subject: Re: [PHP] How To Delete Multiple Items Of Multiple Tables Using
> > PHP and MySQL
> >
> >
> > From experience, I don't think you can run more then one SQL statement at
> > once in a single time. Try assigning each variable with delete, then query
> > them all seperately. I also don't think you need the ; in the SQL
> > statement...
> >
> >
> > ----- Original Message -----
> > From: "@ Nilaab" <[EMAIL PROTECTED]>
> > To: "Php-General" <[EMAIL PROTECTED]>
> > Sent: Tuesday, December 31, 2002 1:36 PM
> > Subject: [PHP] How To Delete Multiple Items Of Multiple Tables
> > Using PHP and
> > MySQL
> >
> >
> > : Hello Everyone,
> > :
> > : I want to DELETE multiple items of multiple TABLES in a MySQL
> > database. My
> > : version of MySQL is 3.23, which means this version doesn't support the
> > : DELETE functionality on multiple tables. The following is my PHP code,
> > where
> > : $item_id is a multi-dimensional array containing the ids of the items I
> > want
> > : to delete from the table.
> > :
> > :    # DELETE records
> > :    for ($i = 0; $i < count($item_id); $i++) {
> > :      $query_item2 .=  "DELETE QUICK FROM item_dimension WHERE item_id =
> > : '".$item_id[$i][0]."'; ";
> > :      $query_item2 .= "DELETE QUICK FROM item_popup WHERE item_id =
> > : '".$item_id[$i][0]."'; ";
> > :    }
> > :
> > : When I run this through the database using PHP, it returns a
> > syntax error
> > in
> > : the SQL. So what I did was echo out $query_item2, then copied and pasted
> > the
> > : SQL into the MySQL application manually, and ran it through. Well the
> > exact
> > : same SQL statement that I used in PHP worked when I entered it
> > manually in
> > : MySQL. In other words it didn't work doing it through PHP, but it worked
> > in
> > : MySQL directly. What gives? Is there a better way to delete
> > multiple items
> > : from multiple tables with one SQL string? I don't want to
> > separate the two
> > : DELETE functions and run them through two separate times because of
> > overhead
> > : concerns. I tried looking on the MySQL and PHP website for
> > better ways of
> > : using DELETE syntax on multiple tables, but I had no luck
> > finding anything
> > : useful with my version of MySQL. Any help would be greatly appreciated.
> > :
> > :
> > : --
> > : 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
> >
> >
> 
--- End Message ---
--- Begin Message ---
Ok, this is very off topic but this is strange. I woke up this morning and turned on my computer like always, only today to find my normal Windows XP theme to be changed to the classic style and the normal style is gone, I can't change it back. Any ideas why and how to fix it maybe?
 
Oh, and happy new years from Indiana! ^_^

Thanks,
Stephen Craton
http://www.melchior.us
 
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
--- End Message ---
--- Begin Message ---
Stephen wrote:
Ok, this is very off topic but this is strange. I woke up this morning and turned on my computer like always, only today to find my normal Windows XP theme to be changed to the classic style and the normal style is gone, I can't change it back. Any ideas why and how to fix it maybe?
Oh, and happy new years from Indiana! ^_^

Thanks,
Stephen Craton
http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us

off topic isn't the word, and please don't send mails is 'fancy mode'

--
--
Mat Harrison			Network Systems Administrator
[EMAIL PROTECTED]	www.genestate.com

Attachment: msg91196/pgp00001.pgp
Description: PGP signature

--- End Message ---
--- Begin Message ---
How does this function really work?  I've been
beating my head against the wall for the last
8 hours trying to figure it out.  This is what
I'm trying and it isn't working:
{this is a very simplified version}

class MyClass {
  function myFunc( $stringVar, $arrayVar ) {
    echo "$stringVar<br>\n";
    echo "<pre>\n";
    print_r( $arrayVar );
    echo "</pre>\n";

  }
}

$myClass = new MyClass();

$myStringVar = "Hello!";
$myArrayVar  = array( "this" => "that" );

call_user_method_array( 'myFunc', 
                        &$myClass,
                        array( $myStringVar, $myArrayVar ));

What's happening is that the values in the array 
are not being passed individually but instead is
being passed as an array.  Shouldn't it be passing
them individually?  If not, it wouldn't seem as if
you could use this function generically.  You'd have
to specificy write your method so it can (possibly)
be called by this function.  And that just doesn't
seem right.

Any light anyone can shed on this would be very much
appreciated!!

Chris
--- End Message ---
--- Begin Message ---
Chris--

On my system, the function works as expected (at least as I understand
it): myFunc receives the parameters "Hello!" and array("this"=>"that"),
which is what you pass to it in the first place. Were you expecting it
to expand $myArrayVar into individual parameters? If so, that's not how
it works--it expands the values of the array you pass to it (which, in
this case, you build explicitly during the call), but doesn't expand any
arrays that may be within that array.

Also, call_user_method_array is now deprecated--you should use
call_user_func_array instead (the manual page for call_user_method_array
explains how to do this with a class method).

Cheers,


Marco
-- 
----------------
php|architect - The Monthly Magazine for PHP Professionals
Come check us out on the web at http://www.phparch.com!
--- Begin Message ---
How does this function really work?  I've been
beating my head against the wall for the last
8 hours trying to figure it out.  This is what
I'm trying and it isn't working:
{this is a very simplified version}

class MyClass {
  function myFunc( $stringVar, $arrayVar ) {
    echo "$stringVar<br>\n";
    echo "<pre>\n";
    print_r( $arrayVar );
    echo "</pre>\n";

  }
}

$myClass = new MyClass();

$myStringVar = "Hello!";
$myArrayVar  = array( "this" => "that" );

call_user_method_array( 'myFunc', 
                        &$myClass,
                        array( $myStringVar, $myArrayVar ));

What's happening is that the values in the array 
are not being passed individually but instead is
being passed as an array.  Shouldn't it be passing
them individually?  If not, it wouldn't seem as if
you could use this function generically.  You'd have
to specificy write your method so it can (possibly)
be called by this function.  And that just doesn't
seem right.

Any light anyone can shed on this would be very much
appreciated!!

Chris
--- End Message ---
--- End Message ---
--- Begin Message ---
> On my system, the function works as expected (at least as I 
> understand it): myFunc receives the parameters "Hello!" and 
> array("this"=>"that"), which is what you pass to it in the 
> first place. 

See, that's not what I'm getting... :|

> Were you expecting it to expand $myArrayVar into individual 
> parameters? 

No.  Just pass those parameters by value, just as they are.

> Also, call_user_method_array is now deprecated--you should 
> use call_user_func_array instead 

This isn't my choice.  What I'm trying to do is use the PEAR
Cache class.  Actually, one of the containers therein.  And
the class is using call_user_method_array().  Sure, I could
change it manually but if I ever upgrade PEAR, all my changes 
are gone.  As such, I'm just leaving as is.

The functionality I'm trying to create is to cache a call to
a SOAP service.  It seems like it should be easy enough since
I'm just caching a call to a method of the SOAP class I'm using.
To see exactly what I'm doing, you can go do the following page:

http://www.melancholy.org/test/xml/soap/soap_client.phps

and to run the page to see the results, just remove the trailing
's'.  The SOAP service is here:

http://www.melancholy.org/test/xml/soap/db_service.phps.

And if you aren't familiar with PEAR, you can see the class I'm
trying to use here:

http://pear.php.net/package-info.php?pacid=40

Anyways, what's happening in the Cache_Function class is that
it's executing this line of code:

$result = call_user_method_array($method, $$object, $arguments);

using the values I pass on this line of my soap_client.php script:

$xmlStr = $cache->call( 'soapclient->call', array( 'returnRecordXML',
$parameters ));

"call" is the $method, "soapclient" is the object and the above
defined array is "arguments".  However, as you can see when you
go to the soapclient.php page, arguments is being passed as an
array and not as the individual elements of the array.

And I can't figure out why... :|

If you or anyone else can tell me what's going on, I'd be very happy
to hear!

Chris
--- End Message ---
--- Begin Message ---
Hi

my server started reporting an error when connecting to mysql

Warning: Can't connect to local MySQL server through socket 
'/var/lib/mysql/mysql.sock' (2) 
in /path/to/web//login.php on line 35 

it's happened a few times now and I'm wondering if it's me or a problem on the server 
(shared, I'm on a virtual host, Cobalt raq, apache )

any pointers to what might could cause the error.

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++
--- End Message ---
--- Begin Message ---
Sound like your ISP is at fault.

MySql is not acceptind any more connection perhaps.


Mike


*********** REPLY SEPARATOR  ***********

On 01/01/2003 at 4:28 PM Paul Roberts wrote:

>Hi
>
>my server started reporting an error when connecting to mysql
>
>Warning: Can't connect to local MySQL server through socket
>'/var/lib/mysql/mysql.sock' (2)
>in /path/to/web//login.php on line 35
>
>it's happened a few times now and I'm wondering if it's me or a problem on
>the server (shared, I'm on a virtual host, Cobalt raq, apache )
>
>any pointers to what might could cause the error.
>
>Best Wishes & Happy New Year
>
>Paul Roberts
>[EMAIL PROTECTED]
>++++++++++++++++++++++++




--- End Message ---
--- Begin Message --- Exactly!!

"checking for sendmail... no"

I've browsed the configure's help and I can't find an option to specify the path to sendmail (which is not at a regular place as we run qmail). Is the a "--with-sendmail-path" option or something like that?

Thanks a lot!

Carl

Rick Widmer wrote:

At 10:11 AM 12/31/02 -0500, Carl Bélanger wrote:

I just upgraded to php 4.3.0 and all by bulletin board are now returning error about the mail function:

Fatal error: Call to undefined function: mail() in /var/wwwx/htdocs/forum/private.php on line 687


What could be missing?


./configure looks for sendmail if it is not found the mail function is not compiled in, resulting in the undefined function call. Mine is in /usr/sbin/sendmail. Grep the results of ./configure for 'sendmail' to see what happened.


./configure ... > tempfile

grep sendmail tempfile


Rick




--- End Message ---

Reply via email to