As for creating a drop menu to search it would help to know what you want in the drop down menu, like is it dynamic data or fixed? And how is it stored, file or database?
As for your example im a little confused by it.
PHP Code:
$TXT[12] = file("".$VAR[5]."/inc/txt/country.txt");
$TXT[14] = "";
foreach ($TXT[12] as $TXT[13])
{
$TXT[13] = trim($TXT[13]);
$SLT[4] = "";
if (isset($_GET['location'])) { if ($_GET['location'] == $TXT[13]) { $SLT
Usually I would load the file to $TXT like this:
PHP Code:
$TXT = file("".$VAR[5]."/inc/txt/country.txt");
Which would put the contents of country.txt into an array.
So if in country.txt you have:
Code:
USA
United Kingdom
Canada
$TXT would equal the following:
$TXT[0] = "USA";
$TXT[1] = "United Kingdom";
$TXT[2] = "Canada";
Basically the numbers are the index in the array. By using [] you are accessing an item in an array. If you dont know what an array is, its a collection of whatever type you assign, eg int, string, object. PHP isnt fussy about object types. Think of it like a bookcase, at the left is book[0] on the right is book[10], book[0] might equal "harry potter", book[10] = "something else".
To clean up your existing code I would use the following:
PHP Code:
$TXT = file("".$VAR[5]."/inc/txt/country.txt");
$TXT[14] = ""; // maybe an entry you dont want?
foreach ($TXT as $location)
{
$location = trim($location);
$SLT[4] = ""; // dont know what that is?
if (isset($_GET['location'])) { if ($_GET['location'] == $location) { $SLT[4] = " selected"; } }
Hope that helps.