How can write a list as an interface for selecting

  Heping 18:50 08 Aug 06
Locked

Hi,

I'm currently working on the design of a PHP/MySQL web search engine... The result is a list of candidates (words) which are considered good words and provided to user in order to he/she select some of the candidates and add them into the initial query (i.e., for modifying the query).

I can write the candidate list to the web. But the problem is I do not know how to write the list as a form of an interface which provides the list to user and also allows the user to tick/select words from the list.

Any ideas?

Regards,
Heping

  ade.h 20:44 08 Aug 06

So you just want a drop-down then?

<<select id="dropdown1" name="dropdown1">
<<option value="example1" SELECTED>Example 1</option>
<<option value="example2">Example 2</option>
<</select>

Put that into your form.

  ade.h 20:44 08 Aug 06

Use single left chevrons. The seocnd ones were added because they do not normally display on this forum.

  harristweed 11:30 09 Aug 06

I came up with this, bit basic! perhaps you can build on it....

<?php
$add_word=$_GET[add];
$search=$_GET[search];
if($search=="")
{
?>
<form <?php echo "ACTION=\"$_SERVER[PHP_SELF]\" METHOD=\"GET\" "; ?>>
<p>Search Words <input name="search" type="text" id="search" size="20">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<?php
exit;
}
echo" This is the original search: ";
echo $search."<br />\n";
//generate list of words add to search
$one="Red";
$two="Blue";
$three="Yellow";
$four="Black";
//etc
echo "Please refine your search, choose from below <br />\n";
echo"<a href= \"$_SERVER[PHP_SELF]?add=$one&search=$search\">$one</a><br />\n";
echo"<a href= \"$_SERVER[PHP_SELF]?add=$two&search=$search\">$two</a><br />\n";
echo"<a href= \"$_SERVER[PHP_SELF]?add=$three&search=$search\">$three</a><br />\n";
echo"<a href= \"$_SERVER[PHP_SELF]?add=$four&search=$search\">$four</a><br />\n";
$add_word=trim($add_word);
if($add_word!=="")
{
$search.=" ".$add_word;
echo "<br /><br />Here is the new search:".$search;
}
echo"<br /><br /><a href= \"$_SERVER[PHP_SELF]\">Try Aagin</a>\n";
?>

see it in action...
click here

  ade.h 15:44 11 Aug 06

Any joy? Did harristweed's (excellent) code help?

This thread is now locked and can not be replied to.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

The updated 'Corel Painter inside Photoshop' plugin ParticleShop offers new brushes

New MacBook Pro 2017 release date, UK price and tech specs: Kaby Lake MacBook Pro to launch in…