(I repost the info with code and output added, as asked on the list )
The variables created in one part of my page ( my element element
'myheader' in 'code-compat')
Seems to be unpassable to one other part of the page (in the content
element of the body they seem undefined)
I can't believe it's a Midgard limitation so can you point me my error or
to a tutorial/helper on how to do it correctly...
To give you all the details :
Part1 of my php code (which is in 'code-compat') receive params and use
them to construct a form via a
private FORM class, in some case, this part redirect to another page
(success on posting info).
this part includes 2 class FORM (form handling) and CONNEXION (database
handling) :
*************part 1 (simplified)**************
include( "/usr/local/apache/htdocs/connexion.php3" );
$db = new CONNEXION();
include( "/usr/local/apache/htdocs/form.php3" );
$f = new FORM( $db , 1 , "candidat_bo" );
$debug.='OK<br>'; // just for debugging
purpose
if( $REQUEST_METHOD == 'POST' ) {
$debug.='POST<br>';
$f->store( $HTTP_POST_VARS );
if( $f->check() ) {
// Some code here
$debug.='UPDATE<br>';
if( isset( $HTTP_POST_VARS['modif'] )) {
// UPDATE
// Some code here
} else {
// INSERT
$debug.='INSERT<br>';
// Some code here
}
$debug.='REDIRECT<br>';
header( "Location: ok.php3" );
exit;
}
}
if( $ref) {
$debug.='EXIST<br>';
// Some code here
}
********end part1****************
Part2 of my php code (in the 'content' element of 'BODY') should display a
form based on the value of the FORM object
built by part1 .
************part 2 (simplified)***********
(<?php echo $debug ?>)
<FORM action="candidat.php" method=POST >
<CENTER>
<TABLE cellpadding=3 cellspacing=0 width=600 border=0 >
<?php $tab = $f->field_list(); for( reset($tab) ; $name = current($tab) ;
next($tab)) { ?>
<TR valign=top <? echo $f->is_error( $name , "bgcolor=#FFAAAA" ) ?> >
<TD>
<B><FONT size=-1 ><? echo $f->caption( $name ) ?><? echo
$f->is_notnull( $name , "<FONT color=red >*</FONT>" ) ?></FONT></B><BR>
</TD>
<TD rowspan=2 ><? echo $f->draw( $name ) ?></TD>
</TR>
<TR valign=top <? echo $f->is_error( $name , "bgcolor=#FFAAAA" ) ?> >
<TD><FONT size=-2 ><? echo $f->comment( $name ) ?></FONT></TD>
</TR>
<? } ?>
</TABLE>
</CENTER>
</FORM>
*********end of part 2*******
the problem : The FORM object and all value that I defined in part1 seem
undefined in part2...
*****output******
()
Object f not found in content on line 7
***end output***
you see that $debug is empty and the error message seems to indicate that
$f is not defined...
(line 7 = <?php $tab = $f->field_list(); for( reset($tab) ; $name =
current($tab) ; next($tab)) { ?>)
Arnaud ASSAD.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]