/    Sign up×
Community /Pin to ProfileBookmark

What I want to do is have a photo or something on my site, and then below it have a place where you can leave comments. Just a simple text field with a submit button below it and when you click submit the page reloads andyour comment is left above the form and below the photo. I have dreamweaver mx but I cant figure it out.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@ZiplineJul 18.2005 — Do you have a MySQL database available with your hosting account? If so then you would use that to store the comments. The rest is relatively easy and I am sure we can help you through it. If you don't have the database then it gets slightly more complicated because you’ll have to store the information in a text file or write directly to an HTML file and save it.
Copy linkTweet thisAlerts:
@Jeff-Wood_netauthorJul 18.2005 — yes i have MySQL
Copy linkTweet thisAlerts:
@ZiplineJul 18.2005 — Well then you’re in good shape. What you will need to do is create a simple form, which users can use to input the comment. The data will then be inserted into the database. The comments can then be extracted and displayed how and where desired. Are you pages extensions .PHP already? If not you may want to consider updating your site.

What type of site are the comments for? You mentioned images. Could you provide some additional information?
Copy linkTweet thisAlerts:
@Jeff-Wood_netauthorJul 19.2005 — well like i take photos and make videos and i want the person to be able to view whatever it is, then below it have a form where they post comments on it.
Copy linkTweet thisAlerts:
@tripwaterJul 19.2005 — I would create 2 tables in MYSQL for example

create table Images(

ID int unsigned not null auto_increment primary key,

ImageName char(50)

);

create table Comments(

ID int unsigned not null auto_increment primary key,

Comments text,

ImageID int unsigned

);

Add all of your image names to the image table and the autoinc field will give you an image ID which you can use to link to the Comments table

Then everytime someone posts a comment for a pic, insert it into the comments table with the ImageID to keep them grouped.

This is a basic quick general idea of what you could do. So when someone pulls up a pic or video you can query for all of the Comments for that ImageID and loop through them displaying them under the pic/video.
×

Success!

Help @Jeff-Wood_net spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...