i need to know how to get the selected value from a drop down box in php
for example :
while($row=mysql_fetch_array($query))
{
echo"<option value='category'>".$row["cat_name"]."</option>";

}

i want in another page to get the selected value and perform some operation on it

Recommended Answers

All 3 Replies

i need to know how to get the selected value from a drop down box in php
for example :
while($row=mysql_fetch_array($query))
{
echo"<option value='category'>".$row["cat_name"]."</option>";

}

i want in another page to get the selected value and perform some operation on it

you just call it by the name of the from element with the $_POST or $_GET array like so:

echo $_GET['selectname'];
//or
echo $_POST['selectname'];

I Tried it but it's not workin !!

try this in this way :

$hunt="SELECT dukja FROM anything WHERE id=$gngr";
$pols=$mysqli->qyery(query);
while($row=$pols->fetch_object())
{
$liger=$row->dukja;
?>"<option value='category'>"<?php echo $liger ?>"</option>"<?php;
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.