Есть блок div с параметрами style="overflow:auto; width:600px; height:300px;.
текст в этот блок попадает из БД через php:
PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- $query = "SELECT * FROM * WHERE *
- ORDER BY date
- LIMIT 0,20";
- if(!$result) {
- }
- if($row['name'] == ($_SESSION['auth']['name'])){
- <img width="35px" height="35px" src="%s" class="photo_mes"><br/>
- <div style="margin-top:-5px;color:#aaa;font-size:8px;">%s</div></center></td>',$row['img_src'],$row['date']);
- if ($row['name2'] == 1){
- echo '<td class="messages" width="430px" style="background:#a3c3fe;">'.nl2br(htmlspecialchars($res));
- }else{
- }
- echo '</td></tr></table>';
- }else{
- echo '<table style="float:right;"><tr>';
- if ($row['name2'] == 1){
- echo '<td class="messages" width="430px" style="text-align: right;
- }else{
- echo '<td class="messages" width="430px" style="text-align: right;
- }
- <a href="#"><img width="35px" height="35px" src="%s" class="photo_mes"></a><br/>
- <div style="margin-top:-5px;color:#aaa;font-size:8px;">%s</div></center></td></tr></table>',$row['name'],$row['img_src'],$row['date']);
- }
- }