SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up having problem with my designing table.

    hi all,

    now i am designing one table per column should be display 5 records. now it works well but when i click my first value from combo box it displayed some spaces. i want to reduce that space. so please help me.

    PHP Code:
    <? ob_start();
    session_start();
    include 
    'includes/connectdb.php'
    $name1=$_REQUEST['name'];
    $id=$_REQUEST['name'];
    $makeid=$_REQUEST['cbmake'];
    $make=$_REQUEST['makeid'];
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Welcome to Biker Domain</title>
    <style type="text/css">
    <!--
    body {
        background-color: #000000;
        margin-left: 0px;
        margin-top: 0px;
        margin-right: 0px;
        margin-bottom: 0px;
    }
    -->
    </style>
    <link href="bikerdomain.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }

    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }

    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    </head>

    <body onLoad="MM_preloadImages('images/biker_11.gif','images/biker_12.gif','images/biker_13.gif','images/biker_14.gif')">
    <form name="frm" action="" method="post">
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><? include 'includes/header.php';?>
          <map name="Map">
            <area shape="rect" coords="65,90,162,110" href="#">
          </map></td>
      </tr>
      <tr>
        <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="118" align="center" valign="middle"><? include 'topbanner.php';?></td>
          </tr>
          <tr>
            <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="178" align="right" valign="top"><table width="168" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><? include 'leftbanner.php'?></td>
                  </tr>
                </table></td>
                <td width="10">&nbsp;</td>
                <td align="left" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td bgcolor="#767A7D"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td><table width="100%"  border="0" cellpadding="0" cellspacing="0" class="BoderBlack">
                              <tr>
                                <td width="55%"><a href="#" class="LinkVerdana10NBlue">Home</a> <span class="TextTahama11BBlack">&gt; <? 
                                
    if(isset($_REQUEST['cbmake']))
                                    {
                                        
    $sql1="select * from bike_make where makeid='$makeid'";
                                        
    $result1=mysql_query($sql1);
                                        
    $info1=mysql_fetch_array($result1);
            
                                        echo 
    $make=$info1['makename'];        
            
                                    }
                                else
                                    {
                                        echo 
    $name1;        
                                    }
                                    
    ?></span></td>
                                <td width="45%">&nbsp;</td>
                              </tr>
                              <tr>
                                <td height="40" class="Heading3"><? 
                                
    if(isset($_REQUEST['cbmake']))
                                    {
                                        
    $sql1="select * from bike_make where makeid='$makeid'";
                                        
    $result1=mysql_query($sql1);
                                        
    $info1=mysql_fetch_array($result1);
            
                                        echo 
    $make=$info1['makename'];    
                                        
                                        
    $sql="select bike_make,bike_model,count(*) from bike_details where bike_make='$makeid' GROUP BY bike_model";
                                        
    $result=mysql_query($sql);
                                        
    $num=mysql_num_rows($result);
                                        while(
    $info=mysql_fetch_array($result))
                                        {   
            
                                        
    $cnt=$info[2];
                                        
    $cnt1=$cnt1+$cnt;
                                        }
                                        echo 
    "(".$cnt1.")";
                            
                                    }
                                else
                                    {
                                        echo 
    $name1;
                                         
    $sql="select bike_make,bike_model,count(*) from bike_details where bike_make='$make' GROUP BY bike_model";
                                        
    $result=mysql_query($sql);
                                        
    $num=mysql_num_rows($result);
                                        while(
    $info=mysql_fetch_array($result))
                                        {
                                            
    $cnt=$info[2];
                                            
    $cnt1=$cnt1+$cnt;
                                        }
                                        
    ?>
                                     <span class="TextArial12BBlue">(<?=$cnt1;?>)</span> 
    <? ?></td>
                                <td width="45%" class="TextTahama11BBlack">Browse Comunity:
                                    <select name="cbmake">
          <?
          $sql
    ="select * from bike_make order by makename";
    $result=mysql_query($sql);
          
    ?>
    <? 
    while($row=mysql_fetch_array($result))
    {
    $name=$row['makename'];
    $mkid=$row['makeid'];
     
    ?>      
          <option value="<?=$mkid?>"><?=$name?></option>
    <?
    }
    ?>      
          
          </select>
                                   <input name="Submit" type="submit" class="Button1" value="Go"></td>
                              </tr>
                              <tr>
                                <td height="40" class="Heading3"><P class=TextArial12NBlk>Welcome to the largest collection of custom <? 
                                
    if(isset($_REQUEST['cbmake']))
                                    {
                                        
    $sql1="select * from bike_make where makeid='$makeid'";
                                        
    $result1=mysql_query($sql1);
                                        
    $info1=mysql_fetch_array($result1);
            
                                        echo 
    $make=$info1['makename'];        
            
                                    }
                                else
                                    {
                                        echo 
    $name1;

            
                                    }
                                    
    ?> rides from around the world. Meet new friends, get inspired, ask questions, and scope out all the great rides. </P></td>
                                
                              </tr>
                              <tr>
                                <td height="8" colspan="2" class="Heading3"></td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td height="7"><img src="images/spacer.gif" width="1" height="1"></td>
                          </tr>
                          <tr>
                            <td ><table width="100%"  border="0" cellpadding="0" cellspacing="0" class="BoderBlack">
                              <tr>
                                <td  class="Heading5"><? 
                                
    if(isset($_REQUEST['cbmake']))
                                    {
                                        
    $sql1="select * from bike_make where makeid='$makeid'";
                                        
    $result1=mysql_query($sql1);
                                        
    $info1=mysql_fetch_array($result1);
            
                                        echo 
    $make=$info1['makename'];        
            
                                    }
                                else
                                    {
                                        echo 
    $name1;        
                                    }
                                    
    ?> Rides </td>
                              </tr>
                              <tr bgcolor="#f1f1f1">
                                <td bgcolor="#f1f1f1"><table width="100%"  border="0" cellpadding="0" cellspacing="0" ><? 
    if($_REQUEST['Submit']=="Go")
    {
        
    $count=1;
        
    $i=1;
         
    $sql="select bike_make,bike_model,count(*) from bike_details where bike_make='$makeid' GROUP BY bike_model";
        
    $result=mysql_query($sql);
        
    $num=mysql_num_rows($result);
        if(
    $num==0)
            {
                echo 
    "<tr><td class=Heading3 align=center bgcolor=#f1f1f1> There is No Records </td></tr>";
                
            }
            else
            {
        while(
    $info=mysql_fetch_array($result))
        {   
            
            
    $cnt=$info[2];
             
    $detid=$info['bike_make']; echo '<br>';
             
    $detmid=$info['bike_model'];
            
    $sql1="select * from bike_make where makeid='$detid'";
            
    $result1=mysql_query($sql1);
            while(
    $info1=mysql_fetch_array($result1))
            {
                
    $make=$info1['makename'];        
            }

            
    $sql1="select * from bike_model where modelid='$detmid'";
            
    $result1=mysql_query($sql1);
            while(
    $info1=mysql_fetch_array($result1))
            {
                
    $model=$info1['modelname'];        
            }

            
                if(
    $i==1
                {
                    echo 
    "<tr><td bgcolor=#f1f1f1><a href=search_result.php?cbmake=$detid&bikemodel=$detmid>$make $model($cnt)</a></td>"
                    
    $i++; 
                }
                else if(
    $i>&& $i<=5)
                { 
                    echo 
    "<td bgcolor=#f1f1f1><a href=search_result.php?cbmake=$detid&bikemodel=$detmid>$make $model($cnt)</a></td>"
                    
    $i++; 
                }
                else
                {     
                    echo 
    "<td bgcolor=#f1f1f1><a href=search_result.php?cbmake=$detid&bikemodel=$detmid>$make $model($cnt)</a></td></tr>"
                    
    $i=1
                }
                
    $cnt1=$count++;
            }

        }
    }
    else
    {
    $i=1;
         
    $sql="select bike_make,bike_model,count(*) from bike_details where bike_make='$make' GROUP BY bike_model";
        
    $result=mysql_query($sql);
        
    $num=mysql_num_rows($result);
        if(
    $num==0)
            {
                echo 
    "<tr><td class=Heading3 align=center> There is No Records </td></tr>";
                
            }
            else
            {
        while(
    $info=mysql_fetch_array($result))
        {
            
    $cnt=$info[2];
             
    $detid=$info['bike_make']; echo '<br>';
             
    $detmid=$info['bike_model'];
            
    $sql1="select * from bike_make where makeid='$detid'";
            
    $result1=mysql_query($sql1);
            while(
    $info1=mysql_fetch_array($result1))
            {
                
    $make=$info1['makename'];        
            }

            
    $sql1="select * from bike_model where modelid='$detmid'";
            
    $result1=mysql_query($sql1);
            while(
    $info1=mysql_fetch_array($result1))
            {
                
    $model=$info1['modelname'];        
            }

            
                
                if(
    $i==1
                {
                    echo 
    "<tr><td><a href=search_result.php?cbmake=$detid&bikemodel=$detmid>$make $model($cnt)</a></td>"
                    
    $i++; 
                }
                else if(
    $i>&& $i<=3)
                { 
                    echo 
    "<td><a href=search_result.php?cbmake=$detid&bikemodel=$detmid>$make $model($cnt)</a></td>"
                    
    $i++; 
                }
                else
                {     
                    echo 
    "<td><a href=search_result.php?cbmake=$detid&bikemodel=$detmid>$make $model($cnt)</a></td></tr>"
                    
    $i=1
                }
            }
        }
    }
    ?></table></td>
                              </tr>
                              <tr>
                                <td bgcolor="#f1f1f1">&nbsp;</td>
                              </tr>
                              <tr>
                                <td bgcolor="#f1f1f1">&nbsp;</td>
                              </tr>
                                
                            </table></td>
                          </tr>
                          <tr>
                            <td height="7"></td>
                            </tr>
                          <tr>
                            <td height="7"><table width="100%"  border="0" cellpadding="0" cellspacing="0" class="BoderBlack">
                              <tr>
                                <td class="Heading5">&nbsp;&nbsp;&nbsp;Top <? 
                                
    if(isset($_REQUEST['cbmake']))
                                    {
                                        
    $sql1="select * from bike_make where makeid='$makeid'";
                                        
    $result1=mysql_query($sql1);
                                        
    $info1=mysql_fetch_array($result1);
            
                                        echo 
    $make=$info1['makename'];        
            
                                    }
                                else
                                    {
                                        echo 
    $name1;        
                                    }
                                    
    ?> Rides </td>
                                <td width="10">&nbsp;</td>
                                <td class="Heading5">&nbsp;&nbsp;&nbsp;Newest <? 
                                
    if(isset($_REQUEST['cbmake']))
                                    {
                                        
    $sql1="select * from bike_make where makeid='$makeid'";
                                        
    $result1=mysql_query($sql1);
                                        
    $info1=mysql_fetch_array($result1);
            
                                        echo 
    $make=$info1['makename'];        
            
                                    }
                                else
                                    {
                                        echo 
    $name1;        
                                    }
                                    
    ?> Rides </td>
                              </tr>
                              <tr>
                                <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="34%" rowspan="2" valign="middle"><img src="images/biker_70.gif" width="125" height="104"></td>
                                    <td width="66%" class="TextTahama11BBlack">Member ID: <A href="/id/dannydahl9" class="LinkVerdana11NBlue">dannydahl9</A><BR>
                                      1997 Acura Integra </td>
                                  </tr>
                                  <tr>
                                    <td><table width="100%"  border="0" cellspacing="5" cellpadding="0">
                                      <tr>
                                        <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                        <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                        <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                        <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                      </tr>
                                      <tr>
                                        <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                        <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                        <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                        <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                      </tr>
                                    </table></td>
                                  </tr>
                                </table></td>
                                <td width="10">&nbsp;</td>
                                <td><table width="100%"  border="0" cellspacing="5" cellpadding="0">
                                  <tr>
                                    <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                    <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                    <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                    <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                  </tr>
                                  <tr>
                                    <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                    <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                    <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                    <td><a href="#"><img src="images/biker_60.gif" width="58" height="57" border="0"></a></td>
                                  </tr>
                                </table></td>
                              </tr>
                            </table></td>
                            </tr>
                          <tr><td height="7"></td></tr>
                          <tr>
                            <td><table width="100%"  border="0" cellpadding="0" cellspacing="0" class="BoderBlack">
                              <tr>
                                <td width="29%" colspan="4">&nbsp;</td>
                              </tr>
                              <tr>
                                <td colspan="4"><table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0" class="BorderBlue">
                                  <tr>
                                    <td bgcolor="#2D3B96" class="TextArial12NWht">Ads by Google </td>
                                  </tr>
                                  <tr>
                                    <td bgcolor="#FFFFFF" style="padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;border-bottom:solid 1px #2D3B96; "><a href="#" class="LinkArial10BoldUnBlue">Lorem ipsum Lorem Ipsum</a> <br>
                                            <span class="TextTahama11BBlack">Lorem ipsum dolar set amet. Lorem ipsum dolar set amet. Lorem ipsum dolar set amet.</span> <br>
                                            <a href="#" class="LinkTahoma8Grey">www.loremipsum.com</a></td>
                                  </tr>
                                  <tr>
                                    <td bgcolor="#FFFFFF" style="padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;border-bottom:solid 1px #2D3B96; "><a href="#" class="LinkArial10BoldUnBlue">Lorem ipsum Lorem Ipsum</a> <br>
                                        <span class="TextTahama11BBlack">Lorem ipsum dolar set amet. Lorem ipsum dolar set amet. Lorem ipsum dolar set amet.</span> <br>
                                        <a href="#" class="LinkTahoma8Grey">www.loremipsum.com</a></td>
                                  </tr>
                                  <tr>
                                    <td bgcolor="#FFFFFF" style="padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;border-bottom:solid 1px #2D3B96; "><a href="#" class="LinkArial10BoldUnBlue">Lorem ipsum Lorem Ipsum</a> <br>
                                        <span class="TextTahama11BBlack">Lorem ipsum dolar set amet. Lorem ipsum dolar set amet. Lorem ipsum dolar set amet.</span> <br>
                                        <a href="#" class="LinkTahoma8Grey">www.loremipsum.com</a></td>
                                  </tr>
                                  <tr>
                                    <td bgcolor="#FFFFFF" style="padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;border-bottom:solid 1px #2D3B96; "><a href="#" class="LinkArial10BoldUnBlue">Lorem ipsum Lorem Ipsum</a> <br>
                                        <span class="TextTahama11BBlack">Lorem ipsum dolar set amet. Lorem ipsum dolar set amet. Lorem ipsum dolar set amet.</span> <br>
                                        <a href="#" class="LinkTahoma8Grey">www.loremipsum.com</a></td>
                                  </tr>
                                </table></td>
                              </tr>
                              <tr>
                                <td colspan="4">&nbsp;</td>
                              </tr>
                            </table></td>
                          </tr>
                        </table></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
                <td width="10">&nbsp;</td>
                <td width="140" align="left" valign="top"><table width="140" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="130"><? include 'rightbanner.php'?></td>
                    <td width="10">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="130">&nbsp;</td>
                    <td width="10">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="130"><? include 'rightbanner.php'?></td>
                    <td width="10">&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="center" bgcolor="#931820" class="HeaderBg"><img src="images/footer_link.gif" width="585" height="30" border="0" align="absmiddle" usemap="#Map3"></td>
      </tr>
      <tr>
        <td height="30" align="center" valign="middle" bgcolor="#931820" class="TextArial11BoldGray">Copyrights 2006, All Rights Reserved</td>
      </tr>
    </table>
    <map name="Map2">
      <area shape="rect" coords="405,4,649,94" href="#">
      <area shape="rect" coords="653,67,761,91" href="#">
      <area shape="rect" coords="121,8,219,88" href="#">
    </map>
    <map name="Map3">
      <area shape="rect" coords="5,9,39,24" href="#">
      <area shape="rect" coords="51,9,89,23" href="#">
      <area shape="rect" coords="102,10,135,23" href="#">
      <area shape="rect" coords="148,11,222,23" href="#">
      <area shape="rect" coords="235,10,269,23" href="#">
      <area shape="rect" coords="284,10,344,23" href="#">
      <area shape="rect" coords="358,10,440,24" href="#">
      <area shape="rect" coords="454,10,504,23" href="#">
      <area shape="rect" coords="519,10,583,23" href="#">
    </map>
    </body>
    </form>
    </html>
    <?
    echo "<script>";
    echo 
    "document.frm.cbmake.value='".$_REQUEST['cbmake']."'";
    echo 
    "</script>";
    ?>
    Last edited by sweatje; Aug 4, 2006 at 06:21. Reason: use PHP tags

  2. #2
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •