lol, lots of little things going to sheet kinda. I had the search box changed on my site, and a button added for a search button instead of default one, and im not sure if that messed it up, but search lil wacked too. i dont know if this does anything, but when hitting submit for search, its just refreshing home.php instead of going to search.php. worked perfect before changing the search box/add jpg button, and been so busy lately havent even had any time to try and pick it apart.
CODE
<?
require('config.php');
//echo "This is Search Page";
if($_POST['Submit']!="Search")
{
include('home.php');
}
if($_SESSION['login']!="true")
{
$msg="Gotta Login Before Searching";
include('home.php');
}
else
if($_POST['Submit']=="search" && $_SESSION['login']=="true")
{
$XX = "No Matches Found, Please Search Again";
$search=$_POST['search'];
$sql = "SELECT * FROM `topics` WHERE `topic_key` LIKE '%$search%' LIMIT 0, 50";
$query = mysql_query($sql);
if(!$query)
{
echo mysql_error();
}
//echo $sql;
?>
<table width="500" border="1" cellpadding="2" cellspacing="0" bordercolor="#000033">
<tr align="center" valign="middle" bgcolor="#CDE4FE">
<td width="180" height="30" bgcolor="#CDE4FE"><strong><font color="#000033" size="3" face="Tahoma">Category</font></strong></td>
<td width="150" height="30" bgcolor="#CDE4FE"><strong><font color="#000033" size="3" face="Tahoma">File
Name</font></strong></td>
<td bgcolor="#CDE4FE"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Description</strong></font></td>
</tr>
<?
while($row = mysql_fetch_assoc($query))
{
$variable1=$row["topic_name"];
$decid=$row["topic_id"];
$variable2=$row["topic_des"];
$variable3=$row["sub_id"];
$q="select * from `subjects` where `id`='".$row["sub_id"]."'";
$r=mysql_query($q);
$rw=@mysql_fetch_array($r);
$category=$rw[1];
$category=str_replace("-"," >> ",$category);
$category=str_replace("_"," ",$category);
?>
<tr align="left" valign="middle">
<td height="25"> <font size="2" face="Tahoma">
<?=$category;?>
</font></td>
<td height="25"> <a href=index.php?cmd=browse&&mainsub=<?=$rw[0];?>&&chieldsub=<?=$rw[1];?>&&decid=<?=$decid;?>>
<font size="2" face="Tahoma">
<?=str_replace("_"," ",$variable1);?>
</font> </a> </td>
<td><a href=index.php?cmd=browse&&mainsub=<?=$rw[0];?>&&chieldsub=<?=$rw[1];?>&&decid=<?=$decid;?>><font size="1" face="Tahoma">
<?=$variable2;?>
</font></a></td>
</tr>
<?
}
?>
</table>
<? //below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
}
?>
and this is the search box on the index
CODE
<tr>
<td align="center" valign="top"><table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="left" valign="left" bgcolor="#CDE4FE"><font size="2" face="Georgia,Times New Roman,serif" color="#000033"> Search
Through Exams By Key Subjects, Ideas, Concepts</font></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#CDE4FE"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><form action="" method="post" name="form1" style="margin-bottom:5px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#E8F2FF">
<td align="left" valign="middle"> <font size="2" face="Georgia,Times New Roman,serif"> Enter Topic
Here</font><font size="2" face="Georgia,Times New Roman,serif"> </font>
<input name="search" type="text" id="search2" size="48">
</td>
<td width="60" height="30"> <input name="imageField" type="image" src="images/button.gif" width="49" height="20" border="0"></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
sorry to throw all on you lol, but though id start new topic so i could thank you again for another solution
This post has been edited by King8654: 2 Jun, 2008 - 02:00 PM