How can i use $_GET to return the values from the URL bar?
Checkboxes are ticked in a form, this is the part that concerns the $_GET variable (I have cut some of it out):
<form action= "<?php echo $_SERVER['PHP_SELF'];?>" method="get">
echo "<table border='1'>";
// Start of the table
while($row = mysql_fetch_array($result))
// The while loop enables each of the stock codes to have
// a separate page within the table, based on the stock code.
{
echo "<tr>";
// Starts the table row.
echo "<td>Stock Code: " . $row['stock_code'] . "
</br> Stock Name: " . $row['stock_name'] . "</td>";
$num = 0;
echo "<td><input type='checkbox' id='select" . $num . "' name='select" . $num . "' value=".$row['stock_code']."></input></td>";
$num = $num+1; }
When I click submit, the stock codes go into the URL bar like this:
submitcheckbox.php?select72=DFC107&select74=DFC120&select79=DFC123
I need it to loop through the $_GET values, check which boxes are set and then update the database if they have been checked with a marker.
I am looking at using a while loop, using isset to check whether the checkboxes have been selected:
$numrows = count($row);
$i=0;
while ($i<=$numrows){
if (isset ($_GET['select.i']));
echo $_GET['select.i'];
$i++;
$save = $_GET['select.i'];
echo $save;
Haven't been very successful so far... wondering if there may be a better to way to do it like using arrays?