Page 1 of 1
simple comment box ??
Posted: Fri Jun 26, 2009 7:58 am
by nits4u
i want to add a simple comment box on each page with some basic text editing features(optional) which first asks for the name of person so that any visitor can post their comment. And also i don't want to save the comments in Db. they shows immediately after posting (like mostly in blogs).
Thank You.
Re: simple comment box ??
Posted: Fri Jun 26, 2009 9:01 am
by jazz090
well most blogs use a DB and by most i mean all of them
Re: simple comment box ??
Posted: Fri Jun 26, 2009 9:08 am
by juma929
Hello,
There is an alternative by writing to text file, but your getting yourself into more hassle than its worth. If your going to allow your users to store information, store it properly, use a database.
Thanks.
Re: simple comment box ??
Posted: Fri Jun 26, 2009 12:40 pm
by nits4u
ohk.........
thanks alot for ur concern....
now can u provide d code for that ?
actually i also want basic word editing functions in it (if possible !!!)
thank you again
Re: simple comment box ??
Posted: Fri Jun 26, 2009 9:58 pm
by a94060
another alternative would be to allow people to post html. You could then remove certain harmful takes, or do the reverse and allow only certain tags. Also,use a database, you could make a table for each page(not worth it) ,or just put a certain tag on each entry(page name?) so that you can recall them easily
Re: simple comment box ??
Posted: Sat Jun 27, 2009 9:58 am
by McInfo
Let's go back to the beginning. Do you have an HTML form with an input for the author's name, a textarea for the comment, and a submit button?
Edit: This post was recovered from search engine cache.
Re: simple comment box ??
Posted: Sat Jun 27, 2009 10:34 am
by nits4u
ya...
"name"= id of author's name
"msg"= id text area
"comment"= form id
Re: simple comment box ??
Posted: Sat Jun 27, 2009 10:37 am
by a94060
would you be able to post the code to allow us to get an idea of what you would like to do?
nits4u wrote:they shows immediately after posting (like mostly in blogs).
This can be accomplished with AJAX
Re: simple comment box ??
Posted: Sat Jun 27, 2009 10:41 am
by nits4u
@ a94060
bro. actually presently its not on my pc.
but i just want a simple comment box on a page(like blogs) and if possible the box also have some basic text editing features.
so that every visitor can post his/her views .
Re: simple comment box ??
Posted: Sat Jun 27, 2009 10:45 am
by a94060
Alrighty, this can be accomplished by using a form on the page you want to comment on. This can then post to a script to add the comment to a database. You can then use AJAX to call the page again,allowing the new comment to show up.
As for the AJAX code, i dont know

, I am just trying to give you a plan. Hopefully someone more intelligible can write that for you.
Re: simple comment box ??
Posted: Sat Jun 27, 2009 10:56 am
by nits4u
lol..
the same prob is with me...
i wrote the code that enter data in Db. but aftr that ???
i dont know....
Vaise thanks......

Re: simple comment box ??
Posted: Sat Jun 27, 2009 11:08 am
by McInfo
Even without AJAX, the comment will appear after the user clicks the submit button.
- A client goes to index.php and sees a form.
- The client enters data in the form and clicks a submit button, which sends a POST request to index.php.
- The server processes the POST data and stores a new record in a database.
- The server loads records from the database. The recently added comment is among the retrieved records.
- The server formats the comments as HTML and sends this formatted HTML in a reply to the client.
- The client sees the list of comments on index.php, including the new comment.
Edit: This post was recovered from search engine cache.
Re: simple comment box ??
Posted: Sat Jun 27, 2009 1:13 pm
by a94060
ahh,that is true. I forgot that the page does automatically get refreshed after hitting the submit button.