Tue Jan 29, 2013 1:17 am
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>search form in php</title>
</head>
<body>
<center>
<table cellspacing="5">
<tr>
<td><form method="get" action="./search.php" name="searchform">
<input type="hidden" name="start" value="0">
<select name="template_type_id" class="searchform2">
<option value="0"> - Type -</option>
<option value='3' >joomla5</option><option value='2' >phpbb2</option>
<option value='1' >phpbb3</option><option value='4' >wordpress</option>
</select>
<select name="template_category_id" id="template_category_id" class="searchform2">
<option value="0"> - Category -</option>
<option value=Animal>Animal</option><option value=Art>Art</option>
<option value=Books>Books</option><option value=Business>Business</option>
<option value=Cars>Cars</option><option value=Children>Children</option>
<option value=Communications>Communications</option>
<option value=Computing>Computing</option><option value=Dating>Dating</option>
<option value=Education>Education</option><option value=Electronics>Electronics</option>
<option value=Entertainment>Entertainment</option><option value=Fashion>Fashion</option>
<option value=Notebook>Notebook</option><option value=Flowers>Flowers</option>
<option value=Food>Food</option><option value=Full screen>Full screen</option>
<option value=Futuristic>Futuristic</option><option value=Gambling>Gambling</option>
<option value=General>General</option><option value=Health>Health</option>
<option value=Hobby>Hobby</option><option value=Hotel>Hotel</option>
<option value=Industry>Industry</option><option value=Interior>Interior</option>
<option value=Jewelry>Jewelry</option><option value=Law>Law</option>
<option value=Marina>Marina</option><option value=Media>Media</option>
<option value=Military>Military</option><option value=Music>Music</option>
<option value=Night club>Night club</option><option value=Personal>Personal</option>
<option value=Photography>Photography</option><option value=Real estate>Real estate</option>
<option value=Religion>Religion</option><option value=Science>Science</option>
<option value=Services>Services</option><option value=Shopping>Shopping</option>
<option value=Society>Society</option><option value=Spiritual>Spiritual</option>
<option value=Sports>Sports</option><option value=Travel>Travel</option>
<option value=Video Art>Video Art</option><option value=Web design>Web design</option>
<option value=Web hosting>Web hosting</option><option value=Wedding>Wedding</option>
</select><input class="searchform" type="text"
name="keywords" value=" - Keywords -"
onFocus="javascript:if (this.value == ' - Keywords -') this.value='';"
onBlur="javascript:if (this.value == '') this.value=' - Keywords -';" />
<input class="searchform" type="text" name="number"
value=" - Number -" onFocus="javascript:if (this.value == ' - Number -') this.value='';"
onBlur="javascript:if (this.value == '') this.value=' - Number -';" />
</form> </td><td><img src='Template/Images/Buttons/search.png'
onclick='javascript:document.searchform.submit();' class='imglink' ></td>
</tr>
</table>
</center>
</body>
</html>
<?php
//require "config.php"; // All database details will be included here
$TYPE_ID=$_GET['template_type_id'];
$folderpath="stylesdata/";
switch($TYPE_ID)
{
case 1:
$html_title = "PhpBB2 Templates | PhpBB2 Themes | Templates Dragon";
break;
case 2:
$html_title = "PhpBB3 Templates | PhpBB3 Themes | Templates Dragon";
break;
default :
$html_title = "PhpBB Templates | PhpBB Themes | Templates Dragon";
break;
}
$STYLE_CATEGORY=$_GET['template_category_id'];
$keywords=$_GET['keywords'];
$pagelink="body/searchbody.php";
include 'Template.php' ;
?>
<div class='content'>
<?php
function GetTypeByID($ID)
{
$query="Select * from type where ID=$ID;";
$results=mysql_query($query);
echo mysql_error();
return $results;
}
@$template_type_id=$_GET['template_type_id'];
@$template_category_id=$_GET['template_category_id'];
@$keywords=$_GET['keywords'];
$subquery=" ";
if($template_type_id=="0"){
echo "<center> Please choose the type of your style </center>";
}
else
{
if($template_type_id!=0){
$Type=GetTypeByID($template_type_id);
$TypeName=mysql_result( $Type,0,'TYPE_NAME');
$folderpath="stylesdata/".$TypeName."/";
$subquery= $subquery."where ID = ".$template_type_id;
if(!$template_category_id==0){
$subquery= $subquery." and CATEGORY = '".$template_category_id."'";
}
if(!($keywords==""||$keywords==" - Keywords -")){
$subquery= $subquery." and STYLE_NAME like '%".$keywords."%'";
}
}else if(!$template_category_id==0){
$subquery= $subquery." where CATEGORY = '".$template_category_id."'";
if(!($keywords==""||$keywords==" - Keywords -")){
$subquery= $subquery." and STYLE_NAME like '%".$keywords."%'";
}
}else if(!($keywords==""||$keywords==" - Keywords -")){
$subquery= $subquery." where STYLE_NAME like '%".$keywords."%'";
}
$query=" SELECT * FROM styles ".$subquery;
//echo"$query";
$result=mysql_query($query);
echo mysql_error();
$num=mysql_num_rows($result);
if($num=="0")
{
echo "<br/><center><h4>Sorry, No results found</h4></center><br/>";
}
else
{
$i=0;
echo "<br/><h4>Search results:</h4><br/>";
echo"<br/><table border=0 cols=%100>";
while($noticia = mysql_fetch_array($result))
{
$image= $folderpath."images/".$noticia['STYLE_ID'].".PNG";
$file= $folderpath."uploads/".$noticia['STYLE_NAME']."_".$noticia['STYLE_ID'].".zip";
if(($i%3)==0)
echo"<tr>";
echo "<td>";
echo " <div class='styleroundcont'>
<div class='styleroundtop'>
<img src='Template/Images/c1.gif'
width='15' height='15' class='corner'
style='display: none' /></div> <center>";
echo "<a style='cursor: hand;' href='phpbb3stylesview.php?styleID=$noticia[STYLE_ID]'>
<strong>$noticia[STYLE_NAME]</strong><br />";
echo "<img name='$image' alt='' src='$image'
border='1'
style='border-color: 777777;'
id = 'tpl_$noticia[STYLE_ID]'/></a><br />";
echo" <script type='text/javascript'>
loadPre('tpl_$noticia[STYLE_ID]',
'Template $noticia[STYLE_ID]',
'http://localhost/mileTemplates2/$image',
430,
442 );
</script>";
echo "Viewed: $noticia[VIEWS]<br />Downloads: $noticia[DOWNLOADS]<br />";
echo " </center><div class='styleroundbottom'>
<img src='Template/Images/c4.gif'
width='15' height='15' class='corner'
style='display: none' /> </div></div>";
echo "</td>";
$i++;
if(($i%3)==0)
echo"</tr>";
}
echo"</tr>";
echo"</table>";
echo"<br />";
}
}
?>
<div>
Tue May 07, 2013 1:35 pm
Sat May 11, 2013 9:26 pm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.