I have a page that reads from a database and generates html for each entry.
I have placed a html checkbook beside each result from the query, the name of the checkbox is the same as the primary key number of the resource as retrieved from the database.
For example
<INPUT TYPE=CHECKBOX NAME="1">1 “other resource information here”
<INPUT TYPE=CHECKBOX NAME="2">2 “other resource information here”
I end up with about 200 checkboxes with values 1-200
Now as this was generated dynamically in theory the name value could go up indefinitely. My problem is when I check the boxed I want checked in the HTML form and send it to the php script I don’t know how to access the variable because I dont know what its name is it could be anything from 1-200 or higher.
In need to write some code that can handle dynamically generated variables or something. I would be good If I could simply access everything that was sent from the forum without hardcode.
There is probably a simple solution to this I’m just missing
any help is much Appreciated
Here is the code (some of it) that generates the html forum
<?PHP
$query = "select * from links order by linkNo";
$results = mysql_query($query);
$num_results = mysql_num_rows($results);
echo "<form action='filename.php' method='post' name='linkcheck' class=\"linktext2\">";
for ($i=0; $i < $num_results; $i++){
$row = mysql_fetch_array($results);
echo "<INPUT TYPE=CHECKBOX NAME=\"".stripslashes($row["linkNo"])."\">";
echo "<a href='http://".stripslashes($row["linkaddress"])."' target=\"blank\">".stripslashes($row["linktitle"])."</a><br/>";
// more code
}
//more code
?>