Hi,
I am creating an online form which should take information to from one page using a multiple-select box then display the selected fields in order confirmation page. This part of the code works fine, Then I press the submit (complete order) button and the information should then get stored into the MySQL database as a string. So if I selected jan,feb and apr it will store into MySQL like jan,feb,apr all in the same field.
I think the main problem is that the information that is stored in the confirmation page is not being registered with the final order complete page.
Here is the code:
FirstPage:
CODE
<select name="ilm[]" size="7" multiple="multiple">
<option value="January"> January </option>
<option value="February"> February </option>
<option value="April"> April </option>
<option value="May-Buyers-Guide"> May Buyers Guide </option>
<option value="July"> July </option>
<option value="August"> August </option>
<option value="October"> October </option>
</select></center> </td>
Just a normal Multiple-select table.
Second page:
CODE
<?php
$_SESSION['details'] =$_POST['ilm'];
$infoilm=$_SESSION['details'];
if ($infoilm){
// $str=implode(",", $info2);
$ilmstr='';
foreach ($infoilm as $ilmt){
$ilmstr.=$ilmt.', ';
}
$ilmstr=trim ($ilmstr,', ');
echo $ilmstr.'<br>';
}
?>
This is the code I use to display the select information from the table as a string.
Third Page:
This is the code that I am using to try and put the string into mysql
CODE
$ilm = $_SESSION['info'];
foreach($ilm as $val)'<br />';
$ilmstring = implode(',' , $ilm);
echo $ilmstring.'<br />';
foreach($ilm as $val)
$insert="INSERT INTO dealerguide (ilmissue) VALUES ('$ilmstring')";
mysql_query($insert);
I have tried echo'ing the string and it does not display the it probably meaning there is something else wrong which I cannot find.
Any help will be appreciated.
Thanks
PS: I have got SESSION_Start on all the pages at the very top. Also the code does not display teh forms thats because I would be sending you about 700lines of code that is unnecessary.
CODE
<form name="form1" method="post" action="./onlineFormPage2.php">
all of the form headers look like this and are pointing to the correct php page.