have checkboxes relating to options drawn from a database:
as below
Problem is when the user clicks on a checkbox, and click to proceed tothe next page,
the information is not brought with them
they are already in a session which is continued on each page:
can any one tell me where i am going wrong?
This is the code on the product page
$f1 = $rS->Fields(0); //product code
$f2 = $rS->Fields(1); //price name
$f3 = $rS->Fields(2); //product price
$f4 = $rS->Fields(3);//my image column
$i =0;
while (!$rS->EOF )
{
echo "<tr><td align='center'>".$f2->value."</td>
<td align='center'> ".$f3->value."</td>
<td align='center'> <img src='../images/".$f4->value." '/></td>
<td align='center'><input type='checkbox' name='checkbox".$f1->value."'></td></tr>";
$rS->MoveNext();
$i++;
}
This is the code so far on the next page.
$rS = $conn->execute("SELECT * FROM goods");
$f1 = $rS->Fields(0); //product code
$f2 = $rS->Fields(1); //price name
$f3 = $rS->Fields(2); //product price
$f4 = $rS->Fields(3);//my image column
$i =0;
$name = $_POST['checkbox".$f1->value."'];
foreach ($_POST['checkbox'] as $name => $value)
{
echo '<input type="checkbox" checked="checked" name="checkbox".$f1->value."" value="'.$f1->value.'"/>'."\n";
}
information going to next page
Moderator: General Moderators
Re: information going to next page
You don't show any code to start the session, nor any code to store the data, nor any code to read the data.
? ? ? ? ?
If you post more code, please use the special tags to make the code more readable, like this:
The easy way to do this is to use the "Code" button right above the data entry box when you write your post, then change code=text to code=php in the opening tag.
? ? ? ? ?
If you post more code, please use the special tags to make the code more readable, like this:
Code: Select all
$f1 = $rS->Fields(0); //product code