design help

does anyone know how to add a comment box to a webpage where people can submit their own comments about something

PHP or Wordpress would be some fine solutions to your problem but due to the nature of the question i’d stick with word press if I were you.

i have the site done in html on dreamweaver i just want to add a comment box to one of the pages

The comment box would be just a form with a textarea in it.

<form method='post' action='YOUR URL HERE'>
<label for='comment_box'>Comments:</label><textarea name='comment_box' id='comment_box'></textarea>
<input type='submit' value='Submit' />
</form>

If you are asking for the code for how to store people’s responses, you will need to do some server-side scripting. No matter what type of webserver you have w3schools as a great resource. You will probably want to check out the tutorials on HTTP POST and (assuming your webserver runs PHP) PHP. If you are using PHP, the PHP website is another great place for info.

Once you have POST’ed the data from your form, you will need a place on your server to store the comments. The more crude method would be to use filesystem functions and save the comments to a .txt on your server. The better way would be to use MySQL, a database system. MySQL allows for much better data organization than a dump into a file.

So, putting together a list of what needs to happen:

  1. Create a form for the user to input data
  2. Create a server-side script to get the data from the user
  3. Store the data either in a .txt file or in a database

Also I might suggest to reduce spam by using a captcha. We had hundreds of spam problems before.
http://www.captcha.net/

As shown here, you can set the action of an html form to be “mailto: [email protected]ess” and it will submit the results over email (note: it all this does is open a new email message for the user with your data fields filled in, then the user has to actually click send. Try it on the page linked above).

As noted above, the only way to store comments from users is to store send them somehow to a server (it obviously makes no sense to try to store them on the client).

–HTML forms interacting with a CGI/PHP/etc script is the usual method, but I could think up some rather obscure ones
–perhaps using an XMLHttpRequest in javascript as a mock socket connection to some computer you have set up
–or just embed a java applet to get the most flexibility: you might even be able to find a SMTP client written in java that could send the email result to you like above, but do it all transparently, without the user seeing a new message open up and then have to click send, etc.
–Something similar is probably available in Flash/Actionscript as well, but I don’t have experience there.

Of course the last three options aren’t “pure” html or even dhtml, which seemed to be the point of your question, however it does keep all the functionality on the client side so you don’t need server side scripting on your particular webhost, but it’s really difficult to find a webhost now that doesn’t support server side.

Hope one of those options works for you

–Ryan

P.S.: Check the control panel of your webhost, many of them have a library of commonly used, prebuilt CGI scripts such as bulletin board, comment box, email-to script, etc that they will give you simple instructions on how to call from your page. If your particular host has these, that would be by far the simplest way to go.

thx that helped