# PHP and popup form

**URL:** <https://forum.kirupa.com/t/php-and-popup-form/222571>\
**Category:** programming\
**Created:** [April 14, 2007, 11:16pm UTC](https://forum.kirupa.com/t/php-and-popup-form/222571 "2007-04-14T23:16:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marSoul](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/marsoul/32/3456_2.png) [@marSoul](https://forum.kirupa.com/u/marSoul)\
**Post date:** [April 14, 2007, 11:16pm UTC](https://forum.kirupa.com/t/php-and-popup-form/222571/1 "2007-04-14T23:16:12Z")

</div>

Hi all,  
I have a registration form that includes a popup form for countries, the problem is when a user enters its details and press submit the selected country remain highlighted if other parts of form are not completed.  
The code is :

```php

<option selected value='<?php if(isset($_POST["country"])) echo $country ?>' <?php if(isset($_POST["country"])) echo $country ?> </option> 
<option value="Afganistan"> Afghanistan</option></option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
and so on...

```

i put the selected value a if segment from php that checks if country is selected or not but when i select another country and submit the page the list shows a blank row in country list ! how can i make it remain in the list  
thanks !
