NEW TO ALL THIS SO PLEASE BE PATIENT!
I have a script which creates an input form based on a table of area names to display area name and check box (this replaces an existing html form to give flexibility over use of areas which can be added or removed without re-writing form).
$area=$row["area"];
$findarea=$row["findarea"];
echo '<tr>';
echo'<TD vAlign=top height=20><p align=left><font size="2" face="Times New Roman">';
echo'<INPUT type=checkbox value=ON name="';
echo strtoupper($findarea);
echo'">';
echo $area;
echo'</td>';
Form passes variables to another php script eg: $manchester (value passed ON).
The second script creates a query based on the values of the various variables
if($manchester=="ON"
{
$findarea.=" or harea='manchester'";
}
if($stockport=="ON"
{
$findarea.=" or harea='Stockport'";
}
I currently update this script when I know new areas have been added to the table but now I want to use the same table to generate this script based on the selected records. I was planning to use text routines to declare a variable called $scharea by adding a "$"to the area name so record "$" plus value Manchester gives "$manchester" but can't see how to use that created variable to do the above. Can anybody understand what I mean? If so please help.
Still very new to this so please keep it simple and give me an example which I can play with please %-)
I have a script which creates an input form based on a table of area names to display area name and check box (this replaces an existing html form to give flexibility over use of areas which can be added or removed without re-writing form).
$area=$row["area"];
$findarea=$row["findarea"];
echo '<tr>';
echo'<TD vAlign=top height=20><p align=left><font size="2" face="Times New Roman">';
echo'<INPUT type=checkbox value=ON name="';
echo strtoupper($findarea);
echo'">';
echo $area;
echo'</td>';
Form passes variables to another php script eg: $manchester (value passed ON).
The second script creates a query based on the values of the various variables
if($manchester=="ON"

$findarea.=" or harea='manchester'";
}
if($stockport=="ON"

$findarea.=" or harea='Stockport'";
}
I currently update this script when I know new areas have been added to the table but now I want to use the same table to generate this script based on the selected records. I was planning to use text routines to declare a variable called $scharea by adding a "$"to the area name so record "$" plus value Manchester gives "$manchester" but can't see how to use that created variable to do the above. Can anybody understand what I mean? If so please help.
Still very new to this so please keep it simple and give me an example which I can play with please %-)