Hi everyone,
I am new to PHP. I have a problem. I have a simple HTML form where when I select the country from select / option list provided, i want PHP to echo message on country I selected. Also I want PHP include function to list the form specific to that country name (by concatanating). Can someone please help me by pointing where I went wrong. I am new to PHP, self taught and have no idea if this approach is correct. Thanks in advance for anticipated help.
<form name="form1" method="post" action="component_project_in_countries.php">
<label for="country">View outlets in which country? </label>
<select name="country_chosen" onchange="document.form1.submit()" id="country">
<option value="">All Middle Eastern Countries</option>
<option value="Iraq">Iraq</option>
<option value="Kuwait">Kuwait</option>
<option value="Bahrain">Bahrain</option>
<option value="Saudi">Saudi Arabia</option>
<option value="Qatar">Qatar</option>
<option value="Oman">Oman</option>
<option value="Yemen">Yemen</option>
<option value="Jordan">Jordan</option>
<option value="Israel">Israel</option>
</select>
</form>
<br>
<?php
$country_selected = '';
$country_selected = $_POST['country_chosen'];
echo "You have chosen to view outlets in " . $country_selected;
include ("inc/OutletsIn" . $country_selected .".php";) //Want to concatanate country name and .php to the end
?>