Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,576 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,886 people online right now. Registration is fast and FREE... Join Now!




help about comment

 
Reply to this topicStart new topic

help about comment, comment!

krain
3 Oct, 2008 - 04:53 AM
Post #1

New D.I.C Head
*

Joined: 19 Jul, 2008
Posts: 27

a pleasant good evening to each and everyone.

can you help me to my problem about comment.
the comment that i post is gone when i post a comment again..
the comment that i post was replace when i post a comment again.
what should will i do. this is the code:


You're Comment<br> <?php echo htmlspecialchars($_POST["Comment"]); ?>.

<div align="center"><form action="action.php" method="post"><br>

<p><b>Comment: </b><br>
<p><input width="3000" length="1120" type="text" name="Comment" /></p><br>
<p><input type="submit" value="Post" /></p></p>
</form></div><br>

please help me...

i want to see all my comment.

User is offlineProfile CardPM
+Quote Post

pemcconnell
RE: Help About Comment
3 Oct, 2008 - 05:02 AM
Post #2

D.I.C Regular
Group Icon

Joined: 5 Aug, 2008
Posts: 396



Thanked: 37 times
Dream Kudos: 75
My Contributions
Try this:
CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

You're Comment<br /> <?php echo nl2br($_POST["comment_txt"]); ?>.

<div align="center"><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><br>

<p><b>Comment: </b><br>
<p><textarea name="comment_txt" id="comment_txt" rows="6" cols="18"></textarea></p><br>
<p><input type="submit" name="sub" id="sub" value="Post" /></p></p>
</form></div><br>

</body>
</html>


User is offlineProfile CardPM
+Quote Post

krain
RE: Help About Comment
3 Oct, 2008 - 05:13 AM
Post #3

New D.I.C Head
*

Joined: 19 Jul, 2008
Posts: 27

QUOTE(pemcconnell @ 3 Oct, 2008 - 06:02 AM) *

Try this:
CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

You're Comment<br /> <?php echo nl2br($_POST["comment_txt"]); ?>.

<div align="center"><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><br>

<p><b>Comment: </b><br>
<p><textarea name="comment_txt" id="comment_txt" rows="6" cols="18"></textarea></p><br>
<p><input type="submit" name="sub" id="sub" value="Post" /></p></p>
</form></div><br>

</body>
</html>






thanks..
your code is helpful,but i want is to see all my post form the first post to the last post..i mean all the post of visitor,i will see and i will reply.please..can you?
User is offlineProfile CardPM
+Quote Post

pemcconnell
RE: Help About Comment
3 Oct, 2008 - 05:17 AM
Post #4

D.I.C Regular
Group Icon

Joined: 5 Aug, 2008
Posts: 396



Thanked: 37 times
Dream Kudos: 75
My Contributions
ahh get ya now - you need to look at a database tutorial (You will need to integrate PHP with MySQL) There are loads of tutorials on D.I.C - have a look at them and then come back - I'll help you as much as I can buddy smile.gif

D.I.C beginners PHP and MySQL tutorial
User is offlineProfile CardPM
+Quote Post

pemcconnell
RE: Help About Comment
3 Oct, 2008 - 05:23 AM
Post #5

D.I.C Regular
Group Icon

Joined: 5 Aug, 2008
Posts: 396



Thanked: 37 times
Dream Kudos: 75
My Contributions
Quick step by step:

In your MySQL server create a table called 'comments', which has 2 fields: 'username' and 'comment'.

In PHP start with a connection, then you use an INSERT statement to insert the comment into your database, which 'saves' it.

You then use a SELECT statement to show the comments

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:11AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month