Classic Global function definition problem
inside the function, insert the line global $footercontent;
Also technically, the exit command can be quite messy, a 'cleaner' method
would be to use something like
function generate_footer()
{
?>
<!-- footer -->
</BODY>
</HTML>
<?
}
and then call it at the end of your script, or if using case statements for
many functions, then call it once at the bottom
<?
// Could consider using a common header function here
switch($something)
{
case "First_Option":
first_code();
break;
case "Second_Option":
second_thing();
break
default:
content($loginID);
}
generate_footer();
?>
Hope this helps
Kevin Williams
----- Original Message -----
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Sunday, December 26, 1999 6:33 PM
Subject: [PHP] Can Variables be in functions?
> I have a function as follows:
>
> function myExit(){
> print("</table>$footercontent");
> exit;
> }
>
> $footercontent does have the footer information in it because I echo it
> right before I make the function.
>
> when I use the function all it echoes is: </table>
>
> Anyone want to tell me what I'm doing wrong this time?
>
> Thanks
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
>
> --
> PHP General 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]
>
>
--
PHP General 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]