retrieve and show post values of dropdown box in php

Discussion in 'PHP' started by hulkrana, Jan 10, 2008.

  1. #1
    hello frds

    i have to post the value of form along with showing last posted value on the same page while submiting the posted value.plz suggest me how to perform it

    thx
     
    hulkrana, Jan 10, 2008 IP
  2. WeBuster

    WeBuster Member

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #2
    
    <?php
    while($cat = mysql_fetch_assoc($cats))
    {
    	if($cat[ID] == $fors[category])
    		echo '<option value="'.$cat[ID].'" selected="selected">'.$cat[title].'</option>';
    	else
    		echo '<option value="'.$cat[ID].'">'.$cat[title].'</option>';
    }
    ?>
    
    PHP:
    Is that what you mean?
     
    WeBuster, Jan 10, 2008 IP