<?php
?>
<script src="jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#lap1").click(function(){
prodtype="laptop";
$("#cam").hide();
$("#mob").hide();
$("#scarves").hide();
$("#bag").hide();
$("#glass").hide();
$("#pants").hide();
$("#jw").hide();
$("#sand").hide();
$("#lapy").show(function(){
rates=document.getElementsByName('lap');
for(var i=0;i<rates.length;i++)
{
rates[i].checked=false;
}
});
$.ajax({
type:'GET',
url:'alldisplay.php',
data:"prodtype="+prodtype,
success:function(response){
document.getElementById("right").innerHTML=response;
}
});
});
$("#came").click(function(){
prodtype="camera";
$("#mob").hide();
$("#scarves").hide();
$("#bag").hide();
$("#glass").hide();
$("#pants").hide();
$("#jw").hide();
$("#sand").hide();
$("#lapy").hide();
$("#cam").show(function(){
rates=document.getElementsByName('lap');
for(var i=0;i<rates.length;i++)
{
rates[i].checked=false;
}
});
$.ajax({
type:'GET',
url:'alldisplay.php',
data:"prodtype="+prodtype,
success:function(response){
document.getElementById("right").innerHTML=response;
}
});
});
$("#mobi").click(function(){
prodtype="mobile";
$("#scarves").hide();
$("#bag").hide();
$("#glass").hide();
$("#pants").hide();
$("#jw").hide();
$("#sand").hide();
$("#lapy").hide();
$("#cam").hide();
$("#mob").show(function(){
rates=document.getElementsByName('lap');
for(var i=0;i<rates.length;i++)
{
rates[i].checked=false;
}
});
$.ajax({
type:'GET',
url:'alldisplay.php',
data:"prodtype="+prodtype,
success:function(response){
document.getElementById("right").innerHTML=response;
}
});
});
$("#scrv").click(function(){
prodtype="clothes";
$("#scarves").hide();
$("#bag").hide();
$("#glass").hide();
$("#pants").hide();
$("#jw").hide();
$("#sand").hide();
$("#lapy").hide();
$("#cam").hide();
$("#mob").hide();
$("#scarves").show(function(){
rates=document.getElementsByName('lap');
for(var i=0;i<rates.length;i++)
{
rates[i].checked=false;
}
});
$.ajax({
type:'GET',
url:'alldisplay.php',
data:"prodtype="+prodtype,
success:function(response){
document.getElementById("right").innerHTML=response;
}
});
});
$("#bagg").click(function(){
prodtype="bags";
$("#scarves").hide();
$("#glass").hide();
$("#pants").hide();
$("#jw").hide();
$("#sand").hide();
$("#lapy").hide();
$("#cam").hide();
$("#mob").hide();
$("#bag").show(function(){
rates=document.getElementsByName('lap');
for(var i=0;i<rates.length;i++)
{
rates[i].checked=false;
}
});
$.ajax({
type:'GET',
url:'alldisplay.php',
data:"prodtype="+prodtype,
success:function(response){
document.getElementById("right").innerHTML=response;
}
});
});
$("#glasss").click(function(){
prodtype="glass";
$("#scarves").hide();
$("#pants").hide();
$("#jw").hide();
$("#sand").hide();
$("#lapy").hide();
$("#cam").hide();
$("#mob").hide();
$("#bag").hide();
$("#glass").show(function(){
rates=document.getElementsByName('lap');
for(var i=0;i<rates.length;i++)
{
rates[i].checked=false;
}
});
$.ajax({
type:'GET',
url:'alldisplay.php',
data:"prodtype="+prodtype,
success:function(response){
document.getElementById("right").innerHTML=response;
}
});
});
$("#left").click(function(){
rates = document.getElementsByName('lap');
for(var i = 0; i < rates.length; i++){
if(rates[i].checked){
rate_value = rates[i].value;
alert(rate_value);
$.ajax({
type:'GET',
url:'branddisplay.php',
data:'brand='+rate_value+"&prodtype="+prodtype,
success:function(response){
document.getElementById("right").innerHTML=response;
}
});
}
}
});
});
</script>
<center>
<div id="menu" style="font-size:20px;text-decoration:none;height:30px;width:800px;background-color:#A0A0A0 ">
<span id="lap1">laptop   </span>
<span id="came">camera   </span>
<span id="mobi">mobile   </span>
<span id="scrv">Scarves   </span>
<span id="bagg">Bag   </span>
<span id="glasss">Glass   </span>
</div>
</center><br>
<div id="left" style="float:left;text-decoration:none;height:1000px;width:200px;background-color:#66CCFF ">
<div id="lapy">
<form name="input" method="get">
<input type="radio" name="lap" value="sony" /> sony<br />
<input type="radio" name="lap" value="samsuze" /> samsuze<br />
<input type="radio" name="lap" value="sony " /> sony<br />
<input type="radio" name="lap" value="tosiba" /> tosiba<br />
</form>
</div>
<div id="cam">
<form name="input" method="get">
<input type="radio" name="lap" value="sony" /> sony<br />
<input type="radio" name="lap" value="niccon" /> niccon<br />
<input type="radio" name="lap" value="fijjj" /> fijjj<br />
</form>
</div>
<div id="mob">
<form name="input" method="get">
<input type="radio" name="lap" value="lg" /> lg<br />
<input type="radio" name="lap" value="samsuze" /> samsuze<br />
<input type="radio" name="lap" value="samsuze" /> samsuze<br />
</form>
</div>
<div id="scarves">
<form name="input" method="get">
<input type="radio" name="lap" value="simple" /> simple<br />
<input type="radio" name="lap" value="cool" />cool <br />
<input type="radio" name="lap" value="curvi" /> carvi<br />
<input type="radio" name="lap" value="cafu" /> cafu<br />
</form>
</div>
<div id="bag">
<form>
<input type="radio" name="lap" value="Bag1" /> Bag1<br />
<input type="radio" name="lap" value="Bag2" />Bag2 <br />
<input type="radio" name="lap" value="Bag3" /> Bag3<br />
<input type="radio" name="lap" value="Bag4" /> Bag4<br />
</form>
</div>
<div id="glass">
<form name="input" method="get">
<input type="radio" name="lap" value="reben1" /> reben1<br />
<input type="radio" name="lap" value="reben2" />reben2 <br />
<input type="radio" name="lap" value="reben3" /> reben3<br />
<input type="radio" name="lap" value="reben4" /> reben4<br />
</form>
</div>
<div id="pants">
<form name="input" method="get">
<input type="radio" name="lap" value="levis" /> levis <br />
<input type="radio" name="lap" value="gazz" />gazz <br />
<input type="radio" name="lap" value="disel" /> disel <br />
<input type="radio" name="lap" value="killer" /> killer <br />
</form>
</div>
<div id="jw">
<form name="input" method="get">
<input type="radio" name="lap" value="gold" /> gold<br />
<input type="radio" name="lap" value="gold" />gold <br />
</form>
</div>
<div id="sand">
<form name="input" method="get">
<input type="radio" name="lap" value="parago" /> paragon <br />
<input type="radio" name="lap" value="paragon" /> paragon <br />
</form>
</div>
</div >
<center>
<div id="right" style="margin-left:40px;float:left;text-decoration:none;height:900px;width:900px;background-color:#FFFFFF">
<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("seo",$con);
$sql="SELECT * FROM search";
$response=mysql_query($sql,$con);
echo "<table border='1'> ";
while($row=mysql_fetch_array($response))
{
echo "<tr><td>Product name:".$row['pname']."<br>Product Type:".$row['ptype']."<br>City Name:".$row['cname'];
echo "<td><img style='margin-left:50px;margin-right:50px;height:100px;width:100px' src='upload/".$row['pimg']."'/></tr>";
}
echo "</table>";
?>
</div></center>
我是用这种方式实现的。如果你喜欢可以参考一下....