I have a php file that reads in information from a txt file and prints it on the screen into lines such as
1st line [ x ]
2nd line[ x ]
etc etc etc
i am trying to add checkboxes next to all the lines of information, i managed to do a for loop that creates checkboxes depening on how many lines are read.
Now the final thing which i am stuck on is that i want the user to be able to click on any checkboxes and then click the submit button which should print out the chosen information on a new php file.
If the user ticked 1st line and submitted then it should display the text string "1st line" on the opening php file
I done some research and managed to use isset method to find out if it was checked, that worked but im still unsure how to read the information that was checked onto a new php file any help would be appreciated thank you
$filename = "file.txt";
$filepointer = fopen($filename, "r"); //open for read
$myarray = file ($filename);
// get number of elements in array with count
for ($counts = 0; $counts < count($myarray); $counts++)
{ //one line at a time
$aline = $myarray[$counts];
//$par = array();
$par = getvalue($aline);
if ($par[1] <= 200)
{
print "<input type=checkbox name='test'/>"." ".$par[0]." ";
print $par[1]." ";
print $par[2]." ";
print $par[3]." ";
}
}