Well i made a quick one.
have a page called search.php have something like:
<body>
<?php echo "<form method=\"POST\" action=\"search.php\">"; ?>
<div align="center">
<center>
<table border="1" cellpadding="2" cellspacing="0" bordercolor="#000000" width="218">
<tr>
<td bordercolor="#52799A" bgcolor="#52799A" width="210"><font face="Verdana" size="2" color="#FFFFFF">JJ's
Search Script</font></td>
</tr>
</center>
<tr>
<td bgcolor="#FFFFFF" bordercolor="#FFFFFF" width="210">
<div align="center">
<center>
<table border="0" cellpadding="7" cellspacing="0" width="90%">
<tr>
<td width="100%"><font face="Verdana" size="1">Posted
By:<br>
<input type="text" name="searchusername" size="20"><br>
Key Words:<br>
<input type="text" name="keywrd" size="20"></font></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
<center>
<tr>
<td bgcolor="#FFFFFF" bordercolor="#FFFFFF" width="210">
<p align="center"><input type="submit" value="Search" name="B1" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
</table>
</center>
</div>
</form>
<center>
<p><?php if ($feild == "2") {echo "<font face=\"verdana\" size=\"1\" color=\"FF0000\">No information sent!</font>";} ?></p>
<p align="center">
<?php if ($feild == "1")
{echo "<table border=\"1\" borderColor=\"#000000\" cellSpacing=\"0\" width=\"90%\"><tr><td bgColor=\"#52799A\" borderColor=\"#52799A\" width=\"100%\"><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\"> Search Results:</font></td></tr><tr><td bgColor=\"#FFFFFF\" borderColor=\"#FFFFFF\" vAlign=\"top\" width=\"683\"><table bgColor=\"#ffffff\" border=\"0\" width=\"100%\"><tbody><tr><td>";
if ($dsd == "")
{$dsd = "Where id = \"\"";}
$db = mysql_connect("localhost", "root", "[password]");
mysql_select_db("info",$db);
$sql="SELECT * FROM [table_name] $statment order by id desc LIMIT 0, 4";
$result=mysql_query($sql,$db);
// This script is made by JJ
while ($row = mysql_fetch_array($result))
{
$id = $row["id"];
$theuser = $row["username"];
$themsg = $row["themsg"];
echo "$theuser<br><b>$themsg</b><br><hr align=\"left\" width=\"100%\" noshade size=\"0\" color=\"#b4b4b4\">";}
if (!$id)
{echo "<font face=\"Verdana\" size=\"1\" color=\"FF0000\">No results found.</font>";}
echo "</table>";} ?>
</td>
</tr>
</table>
</body>
Then have a document called search.php
which has the following:
<?php
if (($searchusername != "") && ($keywrd != ""))
{
$statement = "where username LIKE \"%$searchusername%\" && themsg LIKE \"%$keywrd%\"";
$feild = "1";
include("search.html");
exit();
}
if ($searchusername != "")
{
$statement = "where username LIKE \"%$searchusername%\"";
$feild = "1";
include("search.html");
exit();
}
if ($keywrd != "")
{
$statement = "where themsg LIKE \"%$keywrd%\"";
$feild = "1";
include("search.html");
exit();
}
$feild = "2";
include("search.html");
exit();
?>