From:             [EMAIL PROTECTED]
Operating system: Windows 2000
PHP version:      4.0.6
PHP Bug Type:     Scripting Engine problem
Bug description:  form variables undefined on action page under certain conditions

Under certain conditions form variables are not defined. When I access a
form variable by printing it out using print or print_r( get_defined_vars()
), the form variable is available and has the correct value as expected.
However, when I do not print the variable and use the form variable in a
foreach construct the variable is not defined. 

* register_globals is On according to phpinfo();

* I'm using session variables

* I'm using ob_start() to discard unwanted output.

* I did a standard/default installation.

I've tried simplifying the scripts to narrow down where or what is causing
the problem but all my simplier scripts work fine. The following are
excerpts from the original longer and more complex scripts.

// The Form page
// FileNameX strings were simplied from
"c:\inetpub\wwwroot\ProjectName\Project.php"

<form action='Action.php' method='get'>
<input type='hidden' name='FormIncludes[]' value='FileName1'>
<input type='hidden' name='FormIncludes[]' value='FileName2'>
<input type='hidden' name='FormIncludes[]' value='FileName3'>
<input type='hidden' name='FormIncludes[]' value='FileName4'>
<table cols=2 width='400'>
.... HTML code omitted...
</table>
</form>


// Action.php 

<?php
// These 2 lines have been inserted into the script for debug purposes. 
// If left in as-is the variables are defined and print OK, if I comment
out these 2 lines parser complains
// at the foreach loop that $FormIncludes is undefined.

        print_r( get_defined_vars() );
        print( $FormIncludes );
        
        ob_start();
                
        foreach( $FormIncludes as $FileName )
        {
                include_once( $FileName );
        }
                
        session_start();
        
        global $Form;
        
        $Form->PageProcess( $Submit );
?>

-- 
Edit bug report at: http://bugs.php.net/?id=14811&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to