Jump to content

Page breaks after result is shown - Please help


Nuv

Recommended Posts

Below is the part of my search.php. The form is shown properly however after clicking submit when it displays result the page breaks and sidebar comes below the result i.e

 

<p class="spec"><a href="#" class="rm"><?php echo $roname;?><br /><?php echo $roaddress;?>,<br /><?php echo $rocity;?>,<br /><?php echo $rostate;?><br />Zipcode - <?php echo $rozip;?><br />Telephone - <?php echo $rotele;?><br /></a> <a href="#" class="com"><span>11</span> Com</a></p>  

 

Image of it happening -

 

break.PNG

 

Part of search.php

 

   <div class="article">
          <h2><span>Add</span> Your Business Information</h2>
          <div class="clr"></div>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. <a href="#">Suspendisse bibendum. Cras id urna.</a> Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum odio, ac blandit ante orci ut diam. Cras fringilla magna. Phasellus suscipit, leo a pharetra condimentum, lorem tellus eleifend magna, eget fringilla velit magna id neque. Curabitur vel urna. In tristique orci porttitor ipsum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum. Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu posuere nunc justo tempus leo.</p>  
           
              <?php
               
              if($_SERVER['REQUEST_METHOD'] == "POST")
              {
               echo '<div class="post_content">'; 
               $name = trim(($_POST['name']));
               $address = trim(($_POST['address']));
               $city = trim(($_POST['city']));
               $state = trim(($_POST['state']));
               $zipcode - trim(($_POST['zipcode']));
                              
               $name = strip_tags($name); 
               $address = strip_tags($address);
               $city = strip_tags($city);
               $state = strip_tags($state);
               $zipcode = strip_tags($zipcode);
   
               $name = mysql_real_escape_string($name);
               $address = mysql_real_escape_string($address); 
               $city = mysql_real_escape_string($city); 
               $state = mysql_real_escape_string($state); 
               $zipcode = mysql_real_escape_string($zipcode); 
               $per_page = 5; 
               $page = 1;    
               if(isset($_GET['page']))
               {
               $page=$_GET['page'];
               }
               $start = ($page-1)*$per_page;
               
                $searchsql = "SELECT * FROM flourists WHERE ";

               $types = array();
                $types[] = !empty($name)?"`name` LIKE '%{$name}%'":'';
                $types[] = !empty($address)?"`address` LIKE '%{$address}%'":'';
                $types[] = !empty($city)?"`city` LIKE '%{$city}%'":'';
                $types[] = !empty($state)?"`state` LIKE '%{$state}%'":'';
                $types[] = !empty($zipcode)?"`pincode` LIKE '%{$zipcode}%'":'';     
                
                 $types = array_filter($types, "removeEmpty");
                 $typcount = count($types);
                 //print $typcount;
                 //print_r($types);
                  $andOr = ($typcount > 1)?'AND':'OR';
                  $searchsql .= implode(" {$andOr} ", $types) . " ORDER BY `name` LIMIT $start,$per_page";
                // print "$searchsql";
                $exe = mysql_query($searchsql); 
                //$result = mysql_fetch_array($exe);
                 //$counter = mysql_fetch_row($exe);
                          
             $counter =  mysql_num_rows($exe);
             
             if($counter > 0)
              {  //  echo'<div class="post_content">';
                   while($row = mysql_fetch_array($exe))
            {  
                  $rostate=$row['state'];
                  $roname=$row['name'];
                  $rocity=$row['city'];
                  $roaddress=$row['address'];
                  $rotele=$row['telephone'];
                  $rozip=$row['pincode'];
                   ?>
                
                                                              
            <p class="spec"><a href="#" class="rm"><?php echo $roname;?><br /><?php echo $roaddress;?>,<br /><?php echo $rocity;?>,<br /><?php echo $rostate;?><br />Zipcode - <?php echo $rozip;?><br />Telephone - <?php echo $rotele;?><br /></a> <a href="#" class="com"><span>11</span> Com</a></p>  
              <?php  }
             // echo'</div>';
              }
              else {  //echo '</div> ';
               }
             
              }
             else
             {   
             $sql = "SELECT * FROM state";
             $result = mysql_query($sql);
            // $statarray = mysql_fetch_array($result);
             $counter = mysql_fetch_row($result);   
           // echo $statarray[0];   
                
                          
?>         

           <p><strong>Please Use the following form to search</a> </strong></p>
           <form action="" method="post" id="sendemail">
            <ol>
              <li>
                <label for="name">Florist Name</label>
                <input id="name" name="name" class="text" />
              </li>
              <li>
                <label for="address">Address</label>
                <input id="address" name="address" class="text" />
              </li>
              <li>
                <label for="city">City</label>
                <input id="city" name="city" class="text" />
              </li>
              <li>
              <label for="state">State</label>
              <SELECT NAME="state">
              <OPTION value="">Select State</option>
              
              <?php while($arrayRow = mysql_fetch_assoc($result)) {
                     $strA = $arrayRow["id"];
                     $strB = $arrayRow["state"];
                     echo "<option value=\"$strB\">$strB</option>\n";
                      }?>
              </SELECT>
               
              </li>
               <li>
                <label for="zipcode">Pincode/Zipcode</label>
                <input id="zipcode" name="zipcode" class="text" />
              </li>
              <li>
                <input type="image" name="submit" id="imageField" src="images/submit.gif" class="send" />
                <div class="clr"></div>
              </li>
            </ol>
          </form>   <?php } ?>
        </div>

 

CSS if anyone needs it

@charset "utf-8";
body {
margin:0;
padding:0;
width:100%;
color:#585757;
font:normal 12px/1.5em "Liberation sans", Arial, Helvetica, sans-serif;
background:#fff url(../images/header_bg.jpg) repeat-x center 172px;
}
html, .main {
padding:0;
margin:0;
}
.main {
background:url(../images/hbg_bg.jpg) no-repeat center 162px;
}
.clr {
clear:both;
padding:0;
margin:0;
width:100%;
font-size:0;
line-height:0;
}
h2 {
margin:8px 0;
padding:8px 0;
font-size:26px;
font-weight:normal;
line-height:1.2em;
color:#494848;
text-transform:none;
}
p {
margin:8px 0;
padding:0 0 8px 0;
}
a {
color:#e57371;
text-decoration:underline;
}
.header, .content, .menu_nav, .fbg, .footer, form, ol, ol li, ul, .content .mainbar, .content .sidebar {
margin:0;
padding:0;
}
.header {
}
.header_resize {
margin:0 auto;
padding:0;
width:960px;
}
.logo {
padding:0;
float:none;
float:left;
width:auto;
height:172px;
}
h1 {
margin:0;
padding:54px 0 0 20px;
font-size:40px;
font-weight:normal;
line-height:1.2em;
text-transform:none;
letter-spacing:2px;
}
h1 a, h1 a:hover {
color:#ef7d7b;
text-decoration:none;
}
h1 span {
color:#b093e5;
}
h1 small {
display:block;
font-size:13px;
line-height:1.2em;
letter-spacing:normal;
text-transform:none;
color:#cececc;
}
.slider {
margin:0;
padding:0 10px 20px;
background:no-repeat center top;
}
.rss {
padding:18px 20px 0 0;
float:right;
width:auto;
}
.rss p {
margin:0;
padding:0;
float:right;
width:auto;
color:#fff;
font-size:13px;
line-height:1.5em;
font-weight:bold;
}
.rss a {
color:#fff;
text-decoration:none;
}
.rss a:hover {
text-decoration:underline;
}
.rss img {
margin:-3px 0 -3px 6px;
border:none;
}
.menu_nav {
margin:0;
padding:56px 0 0;
height:48px;
float:right;
}
.menu_nav ul {
list-style:none;
padding:0 0 0 2px;
height:48px;
float:left;
border:1px solid #ececec;
}
.menu_nav ul li {
margin:0;
padding:0 2px 0 0;
float:left;
background:no-repeat right center;
}
.menu_nav ul li a {
display:block;
margin:0;
padding:18px 20px;
font-size:15px;
line-height:20px;
font-weight:normal;
color:#929292;
text-decoration:none;
text-transform:none;
text-align:center;
}
.menu_nav ul li.active a, .menu_nav ul li a:hover {
text-decoration:none;
color:#e77573;
}
.content {
padding:0;
}
.content_resize {
margin:0 auto;
padding:24px 0 40px;
width:960px;
}
.content .mainbar {
margin:0;
padding:0;
float:right;
width:680px;
}
.content .mainbar h2 {
margin-bottom:0;
}
.content .mainbar div.img {
padding:12px 0;
float:left;
}
.content .mainbar img {
}
.content .mainbar img.fl {
margin:0;
border:1px solid #e6e6e6;
}
.content .mainbar .article {
margin:0 0 8px;
padding:0 20px 16px;
background:no-repeat 20px top;
}
.content .mainbar .post_content {
float:right;
width:460px;
}
.content .mainbar .post_content strong {
color:#585757;
}
.content .sidebar {
padding:0;
float:left;
width:260px;
}
.content .sidebar .gadget {
margin:0 0 12px;
padding:0 20px 24px;
background:no-repeat 20px top;
}
.content .sidebar h2 {
}
ul.sb_menu, ul.ex_menu {
margin:0;
padding:0;
list-style:none;
color:#959595;
}
ul.sb_menu li, ul.ex_menu li {
margin:0;
}
ul.sb_menu li, ul.ex_menu li {
padding:8px 0;
width:220px;
background:repeat-x left bottom;
}
ul.sb_menu li a {
color:#585757;
text-decoration:none;
margin-left:0;
padding:4px 8px 4px 0;
background:no-repeat left center;
}
ul.ex_menu li a {
font-weight:bold;
color:#585757;
text-decoration:none;
background:no-repeat left center;
}
ul.sb_menu li a:hover, ul.ex_menu li a:hover {
color:#e57371;
text-decoration:none;
background:no-repeat left center;
}
p.spec {
margin:0 0 16px;
padding:0;
float:left;
width:auto;
border:1px solid #e57371;
}
p.infopost {
margin:0;
padding:6px 0;
text-transform:none;
color:#959595;
}
p.infopost a {
padding:0 2px;
text-decoration:none;
font-weight:normal;
color:#e57371;
}
p.infopost a:hover {
text-decoration:underline;
}
p.infopost span.date {
}
.article a.com {
display:block;
float:left;
margin:0;
padding:6px 16px;
font-size:24px;
font-weight:normal;
text-decoration:none;
text-align:center;
color:#fff;
background:#e57371;
}
.article a.com:hover {
text-decoration:none;
}
.article a.com span {
}
.post_content a.rm {
display:block;
float:left;
padding:10px 16px;
font-size:16px;
line-height:25px;
font-weight:normal;
text-transform:none;
color:#e57371;
text-decoration:none;
text-align:center;
}

.state_content a.rm{
display:block;
float:left;
padding:10px 70px;
font-size:13px;
line-height:20px;
font-weight:normal;
text-transform:none;
color:#e57371;
text-decoration:none;
text-align:center;
}

.content p.pages {
margin:0;
padding:24px 20px;
font-size:11px;
line-height:16px;
color:#959595;
text-align:left;
}
.content p.pages span, .content p.pages a {
display:block;
float:left;
margin:0 2px 0 0;
padding:6px 0;
width:28px;
text-decoration:none;
text-align:center;
}
.content p.pages span, .content p.pages a:hover {
color:#fff;
background:#e67a78;
border:1px solid #e67a78;
}
.content p.pages a {
color:#959595;
border:none;
border:1px solid #8b8b8b;
}
.content p.pages small {
font-size:12px;
float:right;
}
.content .mainbar .comment {
margin:0;
padding:16px 0 0 0;
}
.content .mainbar .comment img.userpic {
border:1px solid #dedede;
margin:10px 16px 0 0;
padding:0;
float:left;
}
.fbg {
}
.fbg_resize {
margin:0 auto;
width:920px;
padding:16px 20px;
color:#fff;
background:#b0b0b0;
}
.fbg h2 {
margin-bottom:24px;
padding-bottom:8px;
color:#fff;
}
.fbg img.gal {
margin:0 8px 8px 0;
padding:0;
border:4px solid #fff;
}
.fbg .col {
margin:0;
float:left;
}
.fbg .c1 {
padding:0 16px 0 0;
width:280px;
}
.fbg .c2 {
padding:0 36px 0 16px;
width:280px;
}
.fbg .c3 {
padding:0 0 0 16px;
width:274px;
}
.fbg .fbg_ul {
margin:0;
padding:0;
list-style:none;
}
.fbg .fbg_ul li {
margin:0;
padding:0;
list-style:none;
}
.fbg .fbg_ul li a {
display:block;
margin:0;
padding:2px 0 2px 12px;
color:#fff;
text-decoration:none;
background:url(../images/li.gif) no-repeat left center;
}
.fbg .fbg_ul li a:hover {
color:#fff;
text-decoration:underline;
font-weight:bold;
}
.fbg p.contact_info {
line-height:1.8em;
}
.fbg p.contact_info a {
color:#fff;
text-decoration:underline;
font-weight:bold;
}
.fbg p.contact_info span {
display:block;
float:left;
width:74px;
font-weight:bold;
}
ol {
list-style:none;
}
ol li {
display:block;
clear:both;
}
ol li label {
display:block;
margin:0;
padding:16px 0 0 0;
}
ol li input.text {
width:480px;
border:1px solid #c0c0c0;
margin:0;
padding:5px 2px;
height:16px;
background-color:#fff;
}
ol li textarea {
width:480px;
border:1px solid #c0c0c0;
margin:0;
padding:2px;
background-color:#fff;
}
ol li .send {
margin:16px 0 0 0;
}
.searchform {
padding:12px 0 24px 20px;
float:left;
}
#formsearch {
margin:0;
padding:0;
width:auto;
height:30px;
}
#formsearch span {
display:block;
margin:0;
padding:0;
float:left;
background:url(../images/search_bg.gif) no-repeat left top;
}
#formsearch input.editbox_search {
margin:0;
padding:8px 10px;
float:left;
width:168px;
font-size:12px;
line-height:16px;
color:#a9a9a9;
background:none;
outline:none;
border:none;
}
#formsearch input.button_search {
margin:0;
padding:0;
border:none;
float:left;
}
.footer {
}
.footer_resize {
margin:0 auto;
padding:0;
width:920px;
line-height:1.5em;
color:#585757;
}
.footer_resize p {
margin:32px 0;
padding:0;
line-height:normal;
white-space:nowrap;
text-indent:inherit;
}
.footer_resize a {
color:#e57371;
font-weight:normal;
margin:0;
padding:0;
border:none;
text-decoration:underline;
background-color:transparent;
}
.footer_resize a:hover {
color:#e57371;
background-color:transparent;
text-decoration:none;
}
.footer_resize .lf {
float:left;
}
.footer_resize .rf {
float:right;
}
a {
outline:none;
}

 

Can someone please point me in the right direction to rectify this problem.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.