II have many entries in list box.
I am submitting form using post method to update.php.
Now i want all the entries present in the list box and put them in the database table using mysql.
please tell me the solution.
Here's as much as im giving you for now:
[php]
<?php
if(isset($_POST['submitIt']))
{
$_values = $_POST['listboxA'];
foreach( $_values AS $_x)
{
echo $_x . "<br />";
// here you would insert into database
}
}
else
{
?>
<html>
<head></head>
<body>
<form name="" action="" method="post">
<select name="listboxA[]" size="3" multiple="true">
<option value="Option 1" selected>Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option>
<option value="Option 4">Option 4</option>
<option value="Option 5">Option 5</option>
</select>
<input type="submit" name="submitIt">
</form>
</body>
<?php
}
?>
[/php]
Here's a tutorial for getting you started on mysql.