Re: [PHP] multi dimensional arraySOLVED

2005-05-06 Thread Richard Lynch
On Thu, May 5, 2005 3:37 am, Angelo Zanetti said:
 this is quite weird but apparently on the one server if you user $user
 as a variable name thats what causes the problem.
 I simply renamed my variable to something else and it worked, I find it
 strange that it worked on 1 server and not the other, is it possible
 that the different apache versions are responsible for this situation??

This would indicate to me that you've got register_globals ON and that
your EGPCS settings are clobbering your $user variable with data from, say
the environment $_ENV

I'm betting that if you do:
echo ENV $_ENV[user]br /\n;
echo GET $_GET[user]br /\n;
echo POST $_POST[user]br /\n;
echo SESSION $_SESSION[user]br /\n;
echo COOKIE $_COOKIE[user]br /\n;

in the script that was giving you trouble, you'll find that one of those
is set.

Actually, since they could be set to the empty string, you should be
echo-in isset($_XXX['user']) in the above test.

The correct solution, then, is to turn register_globals OFF.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] multi dimensional arraySOLVED

2005-05-06 Thread Angelo Zanetti
thanks richard.

In the PHP.ini its set to on but in the .htaccess file we've set it to
OFF. could this still be causing the problem??

thanks again

Angelo Zanetti
Z Logic
www.zlogic.co.za
[c] +27 72 441 3355
[t] +27 21 469 1052



Richard Lynch wrote:

On Thu, May 5, 2005 3:37 am, Angelo Zanetti said:
  

this is quite weird but apparently on the one server if you user $user
as a variable name thats what causes the problem.
I simply renamed my variable to something else and it worked, I find it
strange that it worked on 1 server and not the other, is it possible
that the different apache versions are responsible for this situation??



This would indicate to me that you've got register_globals ON and that
your EGPCS settings are clobbering your $user variable with data from, say
the environment $_ENV

I'm betting that if you do:
echo ENV $_ENV[user]br /\n;
echo GET $_GET[user]br /\n;
echo POST $_POST[user]br /\n;
echo SESSION $_SESSION[user]br /\n;
echo COOKIE $_COOKIE[user]br /\n;

in the script that was giving you trouble, you'll find that one of those
is set.

Actually, since they could be set to the empty string, you should be
echo-in isset($_XXX['user']) in the above test.

The correct solution, then, is to turn register_globals OFF.

  



Re: [PHP] multi dimensional arraySOLVED

2005-05-06 Thread Marek Kilimajer
Angelo Zanetti wrote:
thanks richard.
In the PHP.ini its set to on but in the .htaccess file we've set it to
OFF. could this still be causing the problem??
run phpinfo() inside the directory
thanks again
Angelo Zanetti
Z Logic
www.zlogic.co.za
[c] +27 72 441 3355
[t] +27 21 469 1052

Richard Lynch wrote:

On Thu, May 5, 2005 3:37 am, Angelo Zanetti said:

this is quite weird but apparently on the one server if you user $user
as a variable name thats what causes the problem.
I simply renamed my variable to something else and it worked, I find it
strange that it worked on 1 server and not the other, is it possible
that the different apache versions are responsible for this situation??
  

This would indicate to me that you've got register_globals ON and that
your EGPCS settings are clobbering your $user variable with data from, say
the environment $_ENV
I'm betting that if you do:
echo ENV $_ENV[user]br /\n;
echo GET $_GET[user]br /\n;
echo POST $_POST[user]br /\n;
echo SESSION $_SESSION[user]br /\n;
echo COOKIE $_COOKIE[user]br /\n;
in the script that was giving you trouble, you'll find that one of those
is set.
Actually, since they could be set to the empty string, you should be
echo-in isset($_XXX['user']) in the above test.
The correct solution, then, is to turn register_globals OFF.


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


Re: [PHP] multi dimensional arraySOLVED

2005-05-05 Thread Angelo Zanetti
this is quite weird but apparently on the one server if you user $user
as a variable name thats what causes the problem.
I simply renamed my variable to something else and it worked, I find it
strange that it worked on 1 server and not the other, is it possible
that the different apache versions are responsible for this situation??

TIA


Angelo Zanetti wrote:

Hi guys,

I have a problem where I use a multi dimensional array on one server and
now have moved it to another server and it just doesnt work:

$result2 = $userdb-listUsers($clubID);
$i=0;

while ( $row2 = mysql_fetch_array($result2) )
{
//echo $row2['firstname'];
$user[$i]['firstname']=$row2['firstname'];
$user[$i]['lastname']=$row2['lastname'];
$user[$i]['userid']=$row2['userid'];   
$i++;
   }

the loop is definitely getting the values from the database as i can see
them when I echo out the recordset variables ($row[)

I'm thinking that there is some sort of configuration issue here with
the other server. Its running Apache 1 and the server that works is
running Apache 2.
I've tried single and double quotes and neither work, does anybody else
know what can be causing this not to assign the value to the
multidimensional array?

AFAIK both servers have register_globals OFF

TIA

  


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