From:             [EMAIL PROTECTED]
Operating system: Linux 2.3 (Suse 7.0)
PHP version:      4.0.6
PHP Bug Type:     Arrays related
Bug description:  Gettype reports var as string; echo complains as array and it is an 
array

Below some code.

The array PM_method is setup as a HTML form that is fed to the next stage
where $act = 1.

Note that gettype reports it as a string and echo can't print it because
it is an array.

Regards

Nico
[EMAIL PROTECTED]


<?php

#phpinfo();

if ($act == 1){


echo "Print Vars <p>";

$TT = gettype($var);


while (list($var, $value) = each($HTTP_POST_VARS)) {

$TT = gettype($var);

#echo "TTT $TT XX $var YY $PM_method[2] bb <p>";
echo "Gettype sees \$$var as a $TT<p>";
echo "Echo sees \$$var as an array $PM_method<p>";

        
echo "POST $var = $value<br>\n";
                
                } # end while


} # end if ($act == 1)




if ($act == 0 || empty($act)){

?>

<form action="<?php echo $PHP_SELF ?>" method="post" name="form">

<table><tr><td style="text-align: right;">Bank Transfer:</td><td> <input
type="checkbox" name="PM_method[2]" value="2" checked></td>
<td style="text-align: right;">Cash:</td><td> <input type="checkbox"
name="PM_method[1]" value="1" checked></td>
<td style="text-align: right;">Cheque:</td><td> <input type="checkbox"
name="PM_method[3]" value="3" checked></td>
<td style="text-align: right;">Company Order:</td><td> <input
type="checkbox" name="PM_method[10]" value="10" checked></td>
</tr>

<tr>
<td style="text-align: right;">Voucher:</td><td> <input type="checkbox"
name="PM_method[9]" value="9"></td>
<td style="text-align: right;">American Express:</td><td> <input
type="checkbox" name="PM_method[4]" value="4"></td>
<td style="text-align: right;">Diners Club:</td><td> <input
type="checkbox" name="PM_method[5]" value="5"></td>
<td style="text-align: right;">Eurocard:</td><td> <input type="checkbox"
name="PM_method[8]" value="8"></td>
</tr>

<tr>
<td style="text-align: right;">Master Card:</td><td> <input
type="checkbox" name="PM_method[7]" value="7"></td>
<td style="text-align: right;">VISA:</td><td> <input type="checkbox"
name="PM_method[6]" value="6"></td>
</tr>
</table>

<input type="hidden" name="act" value="1">
<input type="submit" name="Submit" class="button" value="Register
Supplier">
<input type="Reset" class="button"></div>
</FORM>

<?php 

;} # end if ($act == 0 || empty($act)

?>

-- 
Edit bug report at http://bugs.php.net/?id=16096&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16096&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16096&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16096&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16096&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16096&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16096&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16096&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16096&r=submittedtwice

Reply via email to