How can write a list as an interface for selecting

  Heping 18:50 08 Aug 2006
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 2006

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 2006

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

  harristweed 11:30 09 Aug 2006

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 2006

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

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

Elsewhere on IDG sites

Xiaomi Mi Mix 2 review

What went wrong at the Designs of the Year 2017

iPhone X news: Release date, price, new features & specs

Comment créer, modifier et réinitialiser un compte Apple ?