etully,
First, a hearty thanks for a lovely response. And my apologies for taking so long to respond. Between house guests and playing with session variables, I've been distracted.
[ The key thing to remember here is that you are performing two different kinds of searches. Therefore, your Search Results page will also need to determine which type of search the user wants to perform.]
I'm well aware of that, and in fact the Search Results will actually have to deal with other types of searches I didn't talk about.
[ One way to do that is to pass an additional variable that indicates the search type. The other way to do it is to pass one variable (for example, $town_letter) for one kind of search and a different variable ($town_name) for the other kind of search. If you choose the 2nd method, then you will check to see if $town_letter has a value. If so, then execute the code that searches for towns that start with that letter. If $town_letter has no value and $town_name does, then you perform the other kind of search showing all the churches in that town.]
My thought is constuct a string passed in the URI that contains different codes that communicate the type of search of search and the search parameter(s). For example,
/display.php?en|hm|tn=Arcins
or
/display.php?fr|hm|tl=A
The string after the ? gives 1) the language chosen by a visitor, 2) the 2nd page visited (necessarily the home page), 3) the type of search selected then, where tn is Town Name and tl is Town Letter.
[I prefer to do this with two variables because invariably, your client will complicate the user interface and there could (hypothetically) be situations where both $town_letter and $town_name have values and your code won't know which search to perform.]
Since I am the client, I have absolute control.
[ To answer your question about syntax, here's how you put variables in a URL. Change your <a href> tag to this:
<a href='displaypage.php?town_letter=A&search_type=1'>A</a>]
I see you separated the params in the string after the ? by &s. Is that a convention, necessary, or ??? As you see in my example above, I'd thought to use |s, then use $_SERVER['REQUEST_URI'] to retrieve the URI, so I could parse out what I wanted.
[[When someone clicks the letter "A", the following page (displaypage.php) can determine which letter was clicked like this:
$town_letter = $_REQUEST['town_letter'] ;
Similarly, you will want to access the other variables:
$search_type = $REQUEST['search_type'] ;
$town_name = $REQUEST['town_name'] ;]
I see you're using $_REQUEST to get the parameters from the URI. I can't seem to find any documentation on doing that. Where I would look to find more on this? It's easier than what I've started to implement.
[<form action="displaypage.php" method="post">
Choose your town: <select name=town_name>
<option value="Paris">Paris
<option value="Lille">Lille
<option value="Marque En Borough">Marque En Borough
</select>
<input type="submit" value="Show Churches in this town">
<input type="hidden" name="search_type" value="2">
</form>[/QUOTE]]
I'll be doing some of that, although given the fact that there are over 500 towns and over 1000 churches, it's not practical to display complete lists (unless the user asks for them). So on the basic search page (the Home Page), the user can type in the name of a town or church he's interested in if he knows it.
And I see you've answered a question I haven't yet asked, namely, how to hide data on a page, i.e., input type=hidden. That lets me hide a parameter indicating the language chosen by the user.
Thanks again for a clear and cogent response.
Harvey