Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8680225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:11:38+00:00 2026-06-12T21:11:38+00:00

I am creating a search form for a packaging database and I have used

  • 0

I am creating a search form for a packaging database and I have used CSS to style the HTML form that calls to the PHP page. I want to be able to style all the results from the PHP page using the same kind of CSS that styles the search form, as the PHP continues to echo the results as separate elements I want all of them to be displayed in separate little boxes. Is it as simple as I think it is e.g. just surrounding the PHP with tags? As I am trying that currently but it doesn’t seem to work.

   <body>

        <?php
            $con = mysql_connect ("localhost", "root", "");
                   mysql_select_db ("delyn_db", $con);

            if (!$con)
                { 
                    die ("Could not connect: " . mysql_error());
                }

            $descrip = mysql_real_escape_string($_POST['descrip']); 
            $depth   = mysql_real_escape_string($_POST['depth']);

            $varWidth = mysql_real_escape_string($_POST['traywidth']);
            $varHeight= mysql_real_escape_string($_POST['trayheight']);
            $varRange = mysql_real_escape_string($_POST['trayrange']);
            $varType  = mysql_real_escape_string($_POST['traytype']);
            $varShape = mysql_real_escape_string($_POST['trayshape']);
            $varImage = mysql_real_escape_string($_POST['imagename']);

            if (isset($varHeight) && !empty($varHeight)) {
                    $low  = ($varHeight."00");
                    $high = ($varHeight."99");
                } else {
                    $low  = ("000");
                    $high = ("999");
                }

            if (isset($varWidth) && !empty($varWidth)) {
                    $min  = ($varWidth."00");
                    $max = ($varWidth."99");
                } else {
                    $min  = ("000");
                    $max = ("999");
                }   


            $sql = "SELECT * FROM delyn WHERE 
                        description LIKE '%".$descrip."%'  
                    AND trayrange   LIKE '%".$varRange."%' 
                    AND traytype    LIKE '%".$varType."%' 
                    AND trayshape   LIKE '%".$varShape."%'
                    AND traywidth   BETWEEN '".$min."'  AND '".$max."' 
                    AND trayheight  BETWEEN '".$low."' AND '".$high."' ";

    ?>

    while ($row = mysql_fetch_array($r_query)) 
                    { 
                        echo '<p class="results">';
                        echo '<br /><img src="   '. $row['imagename'] . '" width="120" length="50">';
                        echo '<br /><strong> Tool Code: </strong>  '. $row['toolcode'];
                        echo '<br /><strong> Description: </strong> '. $row['description']; 
                        echo '<br /><strong> Tray range: </strong> '. $row['trayrange']; 
                        echo '<br /><strong> Tray type:  </strong> '. $row['traytype'];
                        echo '<br /><strong> Tray size:  </strong> '. $row['traysize']; 
                        echo '<br /><strong> Tray shape: </strong> '. $row['trayshape'] . '<br />' . '<br />' . '</p>';;  
                    }
                if (mysql_num_rows($r_query) <= 0){
                    echo 'No results match your search, please try again';
               }

        ?>  
  </body>  

CSS (For the HTML form, I want the same attributes for the Form div tag to work for the results):

  @charset "UTF-8";

/* CSS Document */

 body {

}

.results {
width: 190px;
padding: 10px;
background: #E8CF24;
overflow:auto;
display:block;

font-family: Verdana, Geneva, sans-serif; 
font-size: 11px;

border: 1px solid #cccccc;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;

-moz-box-shadow: 2px 2px 2px #cccccc;
-webkit-box-shadow: 2px 2px 2px #cccccc;
box-shadow: 2px 2px 2px #cccccc;
}

Now EDITED.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:11:39+00:00Added an answer on June 12, 2026 at 9:11 pm

    Instead of using breaks use paragraph tags.

    <p><?php echo  $row['imagename']; ?></p>
    

    For example. Then you can assign classes to the paragraph tags.

    So if you want to assign a class for each part just have:

    <p class="image_name_class"><?php echo  $row['imagename']; ?></p>
    <p class="tool_code_class"><?php echo  $row['toolcode']; ?></p>
    

    Or in a form:

    <label class="control-label" for="input01">Tool Code</label>
    <input class="input" ID="tool_code" runat="server"><?php echo  $row['toolcode']; ?></input >
    

    Though where you have .input in that CSS you can just have input rather than .input that way you don’t have to assign a class to your inputs it will be automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a multi-form search box that searches a Meat packaging database. The
I am creating a multi-form search box that searches a Meat packaging database. The
I'm creating a search page, the page has a form that is being submitted
I'm creating a form that allows the user to search a database for different
I'm creating this form with checkboxes that I want to populate from a database.
I'm creating a form with a single search field and I want that field
I'm creating eBay style search panes that allow users to narrow their results set
Scenario: I am creating an advanced search form for an access database. They already
I'm creating a search form for my application. In it user selects fields that
I am creating a search form that uses multiple forms to get matching results

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.