[FX.php List] Returning FX Object From Function

Greg Lane glane at moyergroup.com
Sat Dec 10 00:00:23 MST 2005


Welcome Chuck!

The variables (except $layout) inside your NewFX function don't  
contain the values you might expect. Try adding the following line to  
your function, immediately after the "{" line:

   global $serverIP, $webCompanionPort, $laurelFile, $webPW, $webUN;

Variables inside of a function have a local scope unless you've  
specified otherwise. See the PHP manual page on variable scope for  
more info <http://us3.php.net/manual/en/language.variables.scope.php>.

Greg


On Dec 9, 2005, at 8:53 PM, Charles Ross wrote:

> My thought was to create a function to perform these three lines of  
> code:
>
> function NewFX($layout)
> {
>   $fxphp = new FX($serverIP, $webCompanionPort);
>   $fxphp->SetDBData($laurelFile, $layout);
>   $fxphp->SetDBPassword($webPW, $webUN);
>
>   return $fxphp;
> }



More information about the FX.php_List mailing list