Heloo everyone. I have this code for a form in PHP...but when I use $POST['collection'] or any other from th drop down lists I cannot access the vaalue of the variable passed:
<form enctype="multipart/form-data" action="insert_validation.php" method="post">
<table border="0">
<tr><th>Choose category:
<tr><td><select name="category">
<?php
$sql=mysql_query('SELECT category from Category order by category');
$numRows = mysql_num_rows($sql);
for ($i = 1; $i <= $numRows; $i++)
{
$crtRow = mysql_fetch_array($sql);
$idCat = $crtRow["idCategory"];
$cat = $crtRow["category"];
print("<option value=\"$idCat\">$cat</option>");
}
?>
</select>
<tr><th>Choose collection:
<tr><td><select name="collection">
<?php
$sql=mysql_query('SELECT collection from collection order by collection');
$numRows = mysql_num_rows($sql);
for ($i = 1; $i <= $numRows; $i++)
{
$crtRow = mysql_fetch_array($sql);
$idCol = $crtRow["idCollection"];
$coll = $crtRow["collection"];
print("<option value=\"$idCol\">$coll</option>");
}
?>
<tr>
<input type="hidden" name="collection" value="<?php print("$idCol");?>">
<input type="hidden" name="ins" value="Insert">
</select>
<tr><th>Choose metal type:
<tr><td><select name="metal">
<?php
$sql=mysql_query('SELECT metal from MetalType order by metal');
$numRows = mysql_num_rows($sql);
for ($i = 1; $i <= $numRows; $i++)
{
$crtRow = mysql_fetch_array($sql);
$idMet = $crtRow["idMetalType"];
$met = $crtRow["metal"];
print("<option value=\"$idMet\">$met</option>");
}
?>
</select>
<tr><th>Choose stone:
<tr><td><select name="stone">
<?php
$sql=mysql_query('SELECT stone from stone order by stone');
$numRows = mysql_num_rows($sql);
for ($i = 1; $i <= $numRows; $i++)
{
$crtRow = mysql_fetch_array($sql);
$idSt = $crtRow["idStone"];
$st = $crtRow["stone"];
print("<option value=\"$idSt\">$st</option>");
}
?>
<tr>
<td>Model: </td><td><input type="text" name="model" /> </td>
</tr>
<tr>
<td>Picture </td><td><input type="text" name="picture" /></td>
</tr>
<tr>
<td>Stock: </td><td><input type="number" name="stock" /> </td>
</tr>
<tr>
<td> Price </td><td><input type="(float)number" name="price" /></td>
</tr>
</table>
<input type="submit" name= "ins" value="Insert" />
</form>
<