trying to make my comments box scrollable using overflow:scroll. at first I thought it wasn't working cause I was using max-height over just height but even with a fixed height the scroll bar does not appear and the comments push their 400px boundary.
Here is the code of the comments box.
<?php
$act = $_POST['act'];
if($act == "post") {
$name = $_POST['name'];
$message = $_POST ['message'];
@$fp = fopen("comments/comments.php", 'a');
if (!$fp) {
//The file could not be opened
echo "There was an error! Please try again later!";
exit;
} else {
//The file was successfully opened, lets write the comment to it.
$outputstring =
"<article class='comment'>
<br>
<p><span class='label'>Name:</span> " .$name. "</p>
<br>
<p><span class='label'>Comment:</span>" .$message. "</p>
<br>
<hr/ >
</article>";
//Write to the file
fwrite($fp, $outputstring, strlen($outputstring));
//We are finished writing, close the file for security / memory management purposes
fclose($fp);
//Post the success message
echo "Your post was successfully entered. Click <a href='index.php'>here</a> to continue.";
}
} else {
//We are not trying to post a comment, show the form.
?>
//THIS HERE IS THE COMMENTS SECTION DIV
<div class="commentSection">
<h3>comments:</h3>
<hr/>
<?php include("comments/comments.php"); ?>
</div>
//THIS HERE IS THE COMMENTS SECTION DIV
<br><br>
<h3>Post a comment:</h3>
<form action="index.php" method="post">
<label>Name:<label>
<input type="text" name="name" value=""></input>
<br/>
<label>Comment:</label>
<textarea name="message"></textarea>
<input type="hidden" name="act" value="post"></input>
<br/>
<input type="submit" name="submit" value="Submit"></input>
</form>
<?php
}
?>
and here is the css style for it.
.commentSection{
height:400px;
overflow:scroll;
}
anyone got any ideas to why it won't do it? is it because im populating the div with php or something?
thanks in advance.