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'];
$info2=$_SESSION['details'];
if ($info2){
// $str=implode(",", $info2);
$str='';
foreach ($info2 as $t){
$str.=$t.', ';
}
$str=trim ($str,', ');
echo $str.'<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:
$sql="INSERT INTO onlineform (ilmissue) VALUES ('".implode(",",$_SESSION['details'])."')";
mysql_query($sql);
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. It seems not to find the on the seconds page therefore not inserting it into the MysQl database.
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.

New Topic/Question
Reply




MultiQuote




|