Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 2nd Nov 2012, 04:13 AM   #1
Active Warrior
 
Join Date: 2012
Posts: 89
Thanks: 21
Thanked 5 Times in 5 Posts
Default
display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

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.
JoshuaReen is offline  
Unread 2nd Nov 2012, 04:52 AM   #2
HyperActive Warrior
War Room Member
 
Join Date: 2012
Posts: 137
Thanks: 15
Thanked 26 Times in 25 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

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/
cgimaster is offline  
Unread 2nd Nov 2012, 06:35 AM   #3
Active Warrior
 
oliviacis's Avatar
 
Join Date: 2012
Location: Sunnyvale, California
Posts: 75
Thanks: 0
Thanked 2 Times in 2 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

Which CMS are you using?

oliviacis is offline  
Unread 2nd Nov 2012, 01:12 PM   #4
Social Apps Made Easy
War Room Member
 
FirstSocialApps's Avatar
 
Join Date: 2012
Location: Mooresville, NC
Posts: 913
Thanks: 231
Thanked 259 Times in 213 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

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()

FirstSocialApps is offline  
Unread 3rd Nov 2012, 02:44 AM   #5
Active Warrior
 
seowonder56's Avatar
 
Join Date: 2012
Posts: 38
Thanks: 0
Thanked 4 Times in 4 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

You can use ajax and innerhtml of the div tag to display content so that it can be viewed immediately after the posting
seowonder56 is offline  
Unread 5th Nov 2012, 12:39 AM   #6
Active Warrior
 
Join Date: 2012
Posts: 89
Thanks: 21
Thanked 5 Times in 5 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

Originally Posted by oliviacis View Post

Which CMS are you using?
What do you mean by CMS?
JoshuaReen is offline  
Unread 5th Nov 2012, 01:20 AM   #7
Hypothetical Paradox
War Room Member
 
eminc's Avatar
 
Join Date: 2011
Location: India
Posts: 82
Thanks: 12
Thanked 20 Times in 19 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

Originally Posted by JoshuaReen View Post

What do you mean by CMS?
CMS = Content Management System, like Joomla, Wordpress, Drupal, etc.

The best way to predict future is to create it ― Abraham Lincoln
eminc is offline  
Unread 5th Nov 2012, 02:44 AM   #8
Active Warrior
 
Join Date: 2012
Posts: 89
Thanks: 21
Thanked 5 Times in 5 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

Originally Posted by Mohit Jawanjal View Post

CMS = Content Management System, like Joomla, Wordpress, Drupal, etc.
I'm trying to create a custom comment system. I want to be a professional. I am student of MCS, and want to create my own applications, comment boxes etc.
JoshuaReen is offline  
Unread 5th Nov 2012, 05:20 AM   #9
Hypothetical Paradox
War Room Member
 
eminc's Avatar
 
Join Date: 2011
Location: India
Posts: 82
Thanks: 12
Thanked 20 Times in 19 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

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
eminc is offline  
Unread 6th Nov 2012, 01:26 AM   #10
Active Warrior
 
Join Date: 2012
Posts: 89
Thanks: 21
Thanked 5 Times in 5 Posts
Default
Re: display comment immediately after submitting the form.
Share on: 
fb share twitter share gplus share more share

Originally Posted by cgimaster View Post

AJAX+JQUERY or JAVASCRIPT to post and update the page dinamically

Looks like a fair sample of AJAX + JQuery for this.
How To Build A Real-Time Commenting System | Smashing Coding
Originally Posted by Mohit Jawanjal View Post

Follow this tutorial, contains basic stuff. This should give you a good start

Comment system with jQuery, Ajax and PHP.
Thanks to both of you and all of other members. I have now got the main idea and started work on it. Mohit's suggested link is the best one to learn creating a comment system as a beginner.
JoshuaReen is offline  
Closed Thread


Bookmarks

Tags
comment, display, form, immediately, submitting


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 01:42 AM.