Re: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-19 Thread Paul Waring
On 18/04/06, Vernon Webb [EMAIL PROTECTED] wrote:
 I've recently upgraded a server from Fedora Core 3 to Core 5 in the process 
 php had
 been upgraded from either 3 or 4 to php 5. In doing so I had to do a major 
 overhaul of
 a web site as many things stopped working (.i.e $HTTP_POST_VAR, etc).

There is actually an option in php.ini to switch on the $HTTP_*_VAR
variables, although it's off by default in PHP 5. It's still better in
my opinion to use the $_* superglobals ($_POST, $_GET etc), but if
you've got hundreds of scripts and no time to convert them (or you're
running phpBB, which relies on the deprecated behaviour), then enabled
register_long_arrays in php.ini.

Paul

--
Data Circle
http://datacircle.org

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



Re: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-18 Thread John Nichel

Vernon Webb wrote:
I've recently upgraded a server from Fedora Core 3 to Core 5 in the process php had 
been upgraded from either 3 or 4 to php 5. In doing so I had to do a major overhaul of 
a web site as many things stopped working (.i.e $HTTP_POST_VAR, etc). Haven't gotten 
through most of that I know have a problem with a page that is being submitted to 
another page which contains different values for checkboxes. I would pull the values 
from each checkbox using a foreach loop as such: 


foreach ($checkbox as $value) {
echo Value: $valuebr /\n;
}

however the value is no longer being echoed to the page. 


What am I missing here?

This is the code that is being submitted, $num being an incremented value:

input name=checkbox[?php echo $num; ?] type=checkbox id=checkbox[?php echo 
$num; ?] value=?php echo $row_rsADS['customers_id']; ? /


Thanks in advance



Register Globals?

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-18 Thread Jay Blanchard
[snip]
foreach ($checkbox as $value) {
echo Value: $valuebr /\n;
}

however the value is no longer being echoed to the page. 

What am I missing here?

This is the code that is being submitted, $num being an incremented
value:

input name=checkbox[?php echo $num; ?] type=checkbox
id=checkbox[?php echo 
$num; ?] value=?php echo $row_rsADS['customers_id']; ? /

[/snip]

Is the checkbox 'checked'? If not it returns no value.

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



Re: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-18 Thread Vernon Webb
 Register Globals?

You got it. Is there any advantage to having this turned off?

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



Re: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-18 Thread John Nichel

Vernon Webb wrote:

Register Globals?


You got it. Is there any advantage to having this turned off?



One or two

http://us2.php.net/register_globals

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-18 Thread Lester Caine

Vernon Webb wrote:


Register Globals?
You got it. Is there any advantage to having this turned off?


It's a major security hole if left on ;)
And convincing people to plug that hole was not happening, so something 
more major was needed.
As I understand it - PHP6 will not even have the option to enable it at 
all :)


--
Lester Caine - G8HFL
-
L.S.Caine Electronic Services
Treasurer - Firebird Foundation Inc.

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



RE: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-18 Thread Jim Moseby
 
 It's a major security hole if left on ;)
 And convincing people to plug that hole was not happening, so 
 something 
 more major was needed.

Only if the programmer uses it.  As I understand it, register_globals being
on doesn't present a security risk in and of itself as long as the
programmer is not relying on its functionality.

JM

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



Re: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-18 Thread Jochem Maas

Lester Caine wrote:

Vernon Webb wrote:


Register Globals?
You got it. Is there any advantage to having this turned off?



It's a major security hole if left on ;)


it's a major _potential_ security hole. proper initialized of all
[global] variables (and santization of incoming data) means an application
running under register_globals can be as safe as one running without.

the reality of course is that there are millions of security issues out
there due to the problem of global variables not being initialized ... :-P


And convincing people to plug that hole was not

 happening, so something

more major was needed.
As I understand it - PHP6 will not even have the option to enable it at 
all :)


correct - setting register_globals in php6 will cause an error.





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