Working with PHP script and Joomla - When I define a variable in the script (see example 1 below), install the compoment in joomla, select the menu item, nothing happens. The error log says:
PHP Notice: Undefined variable: act in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\joomla\\components\ \com_ectpequipmentlist\\ectpequipmentlist.php on line 37, referer: http://localhost/joomla/index.php
If I hard code a value in the default option of the script (see example 2), install the compoment, select the menu item the data appears correctly.
Example 1: Code that does not work:[php]global $database;
echo 'made it here';
include("class/ectpequipmentlist.php");
$EL = new EquipmentList();
switch( $act )
{
case 'search':
$EL->searchPosition($buildingid, $floor, $pos);
break;
case 'view':
$EL->viewPosition($positionid);
break;
default:
$EL->searchForm();
break;
}[/php]Example 2: Code that does work:[php]global $database;
include("class/ectpequipmentlist.php");
$EL = new EquipmentList();
switch( $act )
{
case 'search':
$EL->searchPosition($buildingid, $floor, $pos);
break;
case 'view':
$EL->viewPosition($positionid);
break;
default:
$EL->viewPosition('200');
break;
}[/php]