Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


how to create coment page in html or php ??? filter_list
Author
Message
how to create coment page in html or php ??? #1
example to my site http://seec0m.altervista.org/dls.htm


An example is given here on my website


but does not work


I can not post my comments

Reply

RE: how to create coment page in html or php ??? #2
wait if I get some time I will make one comment system for you.

Reply

RE: how to create coment page in html or php ??? #3
I suggest writing this in PHP since you could communicate with a database.

Reply

RE: how to create coment page in html or php ??? #4
main page (comment.php).
Code:
<!DOCTYPE html>
<head>
    <title>comment</title>
    </head>
<body>

<form method='POST' action='addcomment.php'>
<label for='name'>Name :</label><br/>
<input type='text' id='name' name='name'>
<br/><label for='comment'>Comment :</label><br/>
<textarea id='comment' name='comment'>
</textarea><br/>
<input type='submit' value='add'>
</form><br/><br/>
<?php

$host='localhost';
$user='root';
$pass='harddisk';
$db='comment';
$table='comment';



$connection=mysql_connect($host,$user,$pass) or die('err1');
$select_db=mysql_select_db($db) or die('err2');
$get_comments=mysql_query("SELECT * FROM $table") or die('err3');
echo '<fieldset>';
while($getcomment=mysql_fetch_row($get_comments))
{
echo '<dd>Name : '.$getcomment['1'].'<dd>';
echo '<dd>Comment : '.$getcomment['2'].'<dd>';
echo '<br/>';
}
echo '</fieldset>';
mysql_close($connection);
?>
</body>
    </html>

page which will add comment in database (addcomment.php)
Code:
<?php
$host='localhost';
$user='root';
$pass='harddisk';
$db='comment';
$table='comment';
$name=$_POST['name'];
$comment=$_POST['comment'];

$connection=mysql_connect($host,$user,$pass) or die('err1');
$select_db=mysql_select_db($db) or die('err2');

mysql_query("INSERT INTO $table (name,comment) VALUES ('$name','$comment')") or die(mysql_error());

mysql_close($connection);

header('location:comment.php');
?>

Reply

RE: how to create coment page in html or php ??? #5
(10-29-2012, 05:20 PM)h4r0015k Wrote: main page (comment.php).
Code:
<!DOCTYPE html>
<head>
    <title>comment</title>
    </head>
<body>

<form method='POST' action='addcomment.php'>
<label for='name'>Name :</label><br/>
<input type='text' id='name' name='name'>
<br/><label for='comment'>Comment :</label><br/>
<textarea id='comment' name='comment'>
</textarea><br/>
<input type='submit' value='add'>
</form><br/><br/>
<?php

$host='localhost';
$user='root';
$pass='harddisk';
$db='comment';
$table='comment';



$connection=mysql_connect($host,$user,$pass) or die('err1');
$select_db=mysql_select_db($db) or die('err2');
$get_comments=mysql_query("SELECT * FROM $table") or die('err3');
echo '<fieldset>';
while($getcomment=mysql_fetch_row($get_comments))
{
echo '<dd>Name : '.$getcomment['1'].'<dd>';
echo '<dd>Comment : '.$getcomment['2'].'<dd>';
echo '<br/>';
}
echo '</fieldset>';
mysql_close($connection);
?>
</body>
    </html>

page which will add comment in database (addcomment.php)
Code:
<?php
$host='localhost';
$user='root';
$pass='harddisk';
$db='comment';
$table='comment';
$name=$_POST['name'];
$comment=$_POST['comment'];

$connection=mysql_connect($host,$user,$pass) or die('err1');
$select_db=mysql_select_db($db) or die('err2');

mysql_query("INSERT INTO $table (name,comment) VALUES ('$name','$comment')") or die(mysql_error());

mysql_close($connection);

header('location:comment.php');
?>


thaks so much brooo

Reply

RE: how to create coment page in html or php ??? #6
what about to make like 10 comment appear on the page and some numbering at the bottom of that so that we can click on them to view more comments?

Reply

RE: how to create coment page in html or php ??? #7
The source my friend :p
Code:
<html>
<head>
<script language="javascript" type="text/javascript">
var maxAmount = 800;
function textCounter(textField, showCountField) {
    if (textField.value.length > maxAmount) {
        textField.value = textField.value.substring(0, maxAmount);
    } else {
        showCountField.value = maxAmount - textField.value.length;
    }
}
</script>
</head>
<body>
<form>
<textarea name="ta" rows="6" style="width:340px;" onKeyDown="textCounter(this.form.ta,this.form.countDisplay);" onKeyUp="textCounter(this.form.ta,this.form.countDisplay);"></textarea>
<br>
<input readonly type="text" name="countDisplay" size="3" maxlength="3" value="250"> Characters Remaining
</form>
</body>
</html>

Reply

RE: how to create coment page in html or php ??? #8
download here : www.seec0m.altervista.org/commentscript.zip

Reply

RE: how to create coment page in html or php ??? #9
download here : www.seec0m.altervista.org/commentscript.zip

Reply







Users browsing this thread: 1 Guest(s)