| | #1 |
| Active Warrior Join Date: 2012
Posts: 89
Thanks: 21
Thanked 5 Times in 5 Posts
|
Hello! I know all the HTML and PHP script to create a comment box, and I know well how the comments, username and email address can be inserted in the mysql database. But, I want to be able to immediately display the comment posted by the user on the same page. Just like I have posted this topic and after clicking "Submit New Thread" it is inserted into the database and now immediately displayed here. Please help me how can I write the script to do so. |
| |
| | #2 |
| HyperActive Warrior War Room Member Join Date: 2012
Posts: 137
Thanks: 15
Thanked 26 Times in 25 Posts
|
AJAX+JQUERY or JAVASCRIPT to post and update the page dinamically Looks like a fair sample of AJAX + JQuery for this. http://coding.smashingmagazine.com/2...enting-system/ |
| |
| | #3 |
| Active Warrior Join Date: 2012 Location: Sunnyvale, California
Posts: 75
Thanks: 0
Thanked 2 Times in 2 Posts
|
Which CMS are you using?
|
| | |
| |
| | #4 |
| Social Apps Made Easy War Room Member Join Date: 2012 Location: Mooresville, NC
Posts: 913
Thanks: 231
Thanked 259 Times in 213 Posts
|
If your form sends to a php script that updates the database then just have the php script send back to the page that reads the database and displays. The new comment would be there. If you dont want a refresh use JQUERY $.POST() |
| | |
| |
| | #5 |
| Active Warrior Join Date: 2012
Posts: 38
Thanks: 0
Thanked 4 Times in 4 Posts
|
You can use ajax and innerhtml of the div tag to display content so that it can be viewed immediately after the posting
|
| |
| | #6 |
| Active Warrior Join Date: 2012
Posts: 89
Thanks: 21
Thanked 5 Times in 5 Posts
| |
| |
| | #7 |
| Hypothetical Paradox War Room Member Join Date: 2011 Location: India
Posts: 82
Thanks: 12
Thanked 20 Times in 19 Posts
| |
|
The best way to predict future is to create it ― Abraham Lincoln
| |
| |
| | #8 |
| Active Warrior Join Date: 2012
Posts: 89
Thanks: 21
Thanked 5 Times in 5 Posts
| |
| |
| | #9 |
| Hypothetical Paradox War Room Member Join Date: 2011 Location: India
Posts: 82
Thanks: 12
Thanked 20 Times in 19 Posts
|
Follow this tutorial, contains basic stuff. This should give you a good start ![]() Comment system with jQuery, Ajax and PHP. |
|
The best way to predict future is to create it ― Abraham Lincoln
| |
| |
| | #10 | ||
| Active Warrior Join Date: 2012
Posts: 89
Thanks: 21
Thanked 5 Times in 5 Posts
|
| ||
| |
|
| Bookmarks |
| Tags |
| comment, display, form, immediately, submitting |
| |