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

  • Home
  • SEARCH
  • 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 9041023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:08:11+00:00 2026-06-16T10:08:11+00:00

I have a php file with a DIV which has mysql table content. I

  • 0

I have a php file with a DIV which has mysql table content. I also have other links and info on this page.

I want only the div content to have a scrollbar, I have used overflow=scroll; but the scrollbar is not working for DIV.

Need help !

Here is my code:

<html>
<head>
<title></title>
<style type="text/css">
<!--
body {
    background-color: #D7F0FF;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}

.sty12 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: normal;
    background-color: #FFFFFF;
    }

.sty1 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
}

.style1 {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 24px;
    color: #FFFFFF;
    font-weight: bold;
}

#wrapper { MARGIN: 0px auto; VERTICAL-ALIGN: middle; TEXT-ALIGN: left }

.style3 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #333333;
    }

.style5 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
    color: #ffffff;
}

.style7 {
    color: #026465;
    font-size: 9px;
}

.toprow {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
    background-color: #CCCCCC;
    }

-->
</style>

<script type="text/javascript">
function postData(someValueToEvalute)
                    {
                        switch(someValueToEvalute){

                            case "1":{
                                    document.forms[0].action = 'invoiceprint2.php'
                                    break;
                                }
                            case "2":{
                                    document.forms[0].action = 'invoiceprint3.php'
                                    break;
                                }
                            default: { alert('fail');}

                        }
                        document.forms[0].submit();
                    }
</script>
</head>
<body>
<table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#026465">
  <tr>
    <td><div align="center"><span class="style1"> PACE LTD <br></span>
<center class="style5">INVOICE PRINTING</center>
<br><br>
<br>

</td>
  </tr>
</table>

<!--------------VALIDATIONS ------------------->

<br>
<br>

<form name="form1" method="post" action="" target="_blank">
<table width='40%' height='39'  border='0' cellpadding='2' cellspacing='0'>
<tr>
<td width=10>&nbsp;</td>
<td class='sty1'><div align='left'>Please select Invoice No. to PRINT: <br>
<br>
You can choose more than one invoice number from the options, by holding CTRL key on your keyboard and select the numbers.</div></td>
<td>
<?php

$dbservertype='mysql';
$servername='localhost';
$dbusername='itec';
$dbpassword='!@#';
$dbname='vga';

////////////////////////////////////////
////// DONOT EDIT BELOW  /////////
///////////////////////////////////////
connecttodb($servername,$dbname,$dbusername,$dbpassword);
function connecttodb($servername,$dbname,$dbuser,$dbpassword)
{
global $link;
$link=mysql_connect ("$servername","$dbuser","$dbpassword");
if(!$link){die("Could not connect to MySQL");}
mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error());
}
//////// End of connecting to database ////////



    $result = mysql_query("SELECT Invno FROM INVHDR ORDER BY Invno DESC");
    echo "<select multiple='multiple' size='20' name='invnos[]'>";
    while($nt=mysql_fetch_assoc($result))
    {//Array or records stored in $nt
    echo "<option value=$nt[Invno]>$nt[Invno]</option>";
    /* Option values are added by looping through the array */
    }
    echo "</select>";// Closing of list box

echo "</td>";

?>
</tr>
</table><br>

<div id="Layer1" style="position:absolute; left:465px; top:115px; width:600px; height:600px; overflow:scroll; z-index:1; background-color: #D7F0FF; layer-background-color: #FFFFFF;"> 
<?php
    echo "<table width='540' border='1' cellspacing='0' cellpadding='5' align='left'>";
    echo "<tr>";
    echo "<td width='75' align='center' class='toprow'>Inv Date</td>";
    echo "<td width='75' align='center' class='toprow'>Inv No.</td>";
    echo "<td width='315' align='center' class='toprow'>Customer Name</td>";
    echo "<td width='75' align='center' class='toprow'>Amount</td>";
    echo "</tr>";
$recs=mysql_query("SELECT * FROM INVHDR ORDER BY Invno DESC");
while ($r2=mysql_fetch_assoc($recs))
{
        $invno=$r2['Invno'];    

        $invdat3=$r2['Invdate'];    
        $invdat2=date("Y-m-d", strtotime($invdat3));
        //$invdat2->format('Y-m-d');    
        $date_array = explode( "-", $invdat2 );
        $invdat = sprintf( '%02d/%02d/%4d', $date_array[2], $date_array[1], $date_array[0] );

        $acode=$r2['Ac_code'];
        $amt=$r2['Amount'];

            //--selecting customer name-----------------------------------
            $cus=mysql_query("SELECT Ac_desc FROM ACMAST WHERE Ac_code='$acode'");
            $cus2=mysql_fetch_assoc($cus);
            $acdesc=$cus2['Ac_desc'];

            echo "<tr>";

            echo "<td width='75' align='center' class='sty12'>$invdat</td>";
            echo "<td width='75' align='center' class='sty12'>$invno</td>";
            echo "<td width='315' align='center' class='sty12'>$acdesc</td>";
            echo "<td width='75' align='center' class='sty12'>$amt</td>";

            echo "</tr>";           

    }

    echo "</table><br></div>";
?>

<table width='500' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width=10>&nbsp;</td>

<td align='center'>
<input name="PRINT" type="button" value="PRINT Invoice to Laser Printer!"     onClick='postData("1");' /> &nbsp;&nbsp;&nbsp;  
<input name="PRINT2" type="button" value="PRINT Invoice to Dotmatrix Printer !" onClick='postData("2");'/>

</form>
<br><br><br><br>
<a href='frameinvoice.php' target='_parent'><input name='Add' type='button' value='Add'></a>  &nbsp;&nbsp;  &nbsp;&nbsp; <a href='invoice-edit.php' target='_parent'><input name='Edit' type='button' value='Edit !'></a> &nbsp;&nbsp; <a href='invoice-cancel.php' target='_parent'><input name='Edit' type='button' value='Cancel !'></a> &nbsp;&nbsp; <a href='index.htm' target='_parent'><input name='Close' type='button' value='CLOSE !'></a><br>
</td>

</tr>   
</table>

</body>
</html> 
  • 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-16T10:08:12+00:00Added an answer on June 16, 2026 at 10:08 am

    hey mate your code is working fine . you dont have enough data so scroll is not working add more data to see scrolling effect or reduce the height of div as below.

    <div id="Layer1" style="position:absolute; left:465px; top:115px; width:600px; height:100px; overflow:scroll; z-index:1; background-color: #D7F0FF; layer-background-color: #FFFFFF;"> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP file which has the following text: <div class=small_italic>This is what
I have a PHP page which has a div, the div has a PHP
I have a tiny php file which has only a div and a countdown
I have a test php file which has 50 buttons in a table (just
I have a php page. This has multiple images which looks like tabs. With
I have a PHP file which will return something like <div id=title>Add Us On
I have a PHP File with something like this: <script type=text/javascript> var page =
I have a php file which has one form and 2 submit buttons, onclick
I have a php file that returns a div and a javascript. I want
i have problem.. for(a=1;a<10;a++){ $(.div).append(<div id=+a+></div>) $.ajax({ url: file.php, data: a=+a, type: POST, async:

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.