Jump to content

[SOLVED] Making an HTML form input case-insensitive


ArizonaJohn

Recommended Posts

Hello,

 

The HTML form and PHP below allow the user to lookup a table from a MySQL database with the table-name matching the variable "find."  It works great, but I would like to make the user's input case-insensitive.  If the user includes capital letters, I would like all of these to be converted into lower-case letters.  How can I do this?

 

Thanks in advance,

 

John

 

  <form action="tsearch12.php" method="post">
  <label>Enter Topic:
  <input type="text" name="find" size="55"/>
  <input type="hidden" name="searching" value="yes" />
  <input type="submit" name="search" value="Search" />
  </label>
  </form>

<?

if ($searching =="yes")
{


if ($find == "")
{
echo "<p>You forgot to enter a search term";
exit;
unset($_SESSION['find']);	

}

mysql_connect("mysqlv3", "username", "password") or die(mysql_error());
mysql_select_db("sand2") or die(mysql_error());


$find = strip_tags($find);
$find = trim ($find);

$result=mysql_query("SHOW TABLES FROM sand2 LIKE '%$find%'")

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.