Jump to content

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%'")

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.