FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

How can I get a comment box on my website?

 


ato784
I want to have a comment box so that people can talk about what ever. i already have a chat box so i do not need one.

does anyone know where i can get one like this (smilies are not nessicary but would be nice Very Happy )




Thanks in advance for any help
eznet
Are you using a CMS or have you created the webpage from scratch? If you are using a CMS, most of those support comments out of the box - if you are not using a CMS, perhaps this is something you should look into. Other than that, if you are asking how to write a comment box system from scratch, I think that is beyond the scope of an answer that you will get here as it requires knowledge on how to develop web applications (html, javascript, php/python, mySql, etc,.)... You may be able to find a Flash based comment box that suits your needs, as I have seen them on mySpace accounts, though I know of none off the top of my head - hit google with "Flash Comment Box" and start digging Smile

-Matt
ato784
I have built the page from scratch and I do not know much about javascript, php/python, mySql, etc., but i do now know what to search for thanks!
ato784
i still can not find anything Sad any more tips?
milk
You need PHP.

Here's something extremely simple I wrote and you can use.

PHP (comment.php)
Code:

<?
$cmt = $_POST['cmt'];
$name = $_POST['name'];

$file = "comments.htm";
$content = file_get_contents($file);

$fh = fopen($file, w) or die();
  fwrite($fh, $content . '<div style="text-align:left;background:#ccc;">' . $name . '</div>' . '<div style="text-align:left;background:#eee;padding-left:10px;">' . $cmt . '</div><div style="height:10px;">&nbsp;</div>');
fclose($fh);

echo '<meta http-equiv="refresh" content="0;url=http://google.com/">';
?>


HTML (index.htm)
Code:

<style>body{background:#ccc;}</style>
<div align="center" style="color:#000;font-size:10pt;font-family:sans-serif;width:300pt;">
  <form method="post" action="comment.php">
    <table cellpadding="1" cellspacing="1" style="width:100%;font-size:10pt;">
      <tr>
        <td style="width:20%;">Name:</td>
        <td style="width:80%;"><input type="text" name="name" style="border:0;width:100%;"></td>
      </tr>
      <tr>
        <td colspan="2"><textarea class="main" style="height:100px;width:100%;border:0;font-family:sans-serif;" name="cmt"></textarea></td>
      <tr>
        <td colspan="2"><input style="border:0;width:100%;background:#fff;color:#000;" type="submit" value="Submit"></td>
      </tr>
    </table>
  </form>
</div>

<iframe align="center" style="color:#000;font-size:10pt;font-family:sans-serif;width:300pt;margin:0;border:0;" src="comments.htm"></iframe>


comments.htm must be chmodded 777
jmlworld
Or if you have PHP/MySQL enabled, for example if your site is hosted under FRIHOST, you can head to http://wordpress.org download a fresh copy of it, upload it to your site, create a database, install it and then google some cool WordPress themes, activate them... Everything will work dramatically. WordPress has built-in commenting system and you can even add a contact page by using a plugin.

There are other systems you can use too. But I think WordPress is the easiest.
eznet
jmlworld wrote:
Or if you have PHP/MySQL enabled, for example if your site is hosted under FRIHOST, you can head to http://wordpress.org download a fresh copy of it, upload it to your site, create a database, install it and then google some cool WordPress themes, activate them... Everything will work dramatically. WordPress has built-in commenting system and you can even add a contact page by using a plugin.

There are other systems you can use too. But I think WordPress is the easiest.


I agree on using WordPress or another CMS. WordPress is indeed easy to set up and configure on Frihost. I personally think that taking a CMS and modifying a theme to look like your "from scratch" webpage will be the optimal solution vs learning PHP, SQL and how to tie it together with HTML into the commend box - basically, why try to reinvent the wheel when the existing one already works perfectly fine. I mean, sure, if you can create a truly novel and superior wheel, then by all means do, but I am guessing that is not what you are going for since you are still learning...
DjMilez
I think milks will do good.


I would try to write one, but I'm trying to get my points back up.
Mexican_Ed
Lol, Who isn't. Razz

And yeah, you could either get a script (Usually come with Ad's 8\) Or write your own, and for that, You'd need to learn PHP And maybe some MySQL. ^^
ato784
WOW! I didn't think that i would get so many responses. Thanks. I am going to try to use the code that milk made, but i am a little confused about what you meant at the end.

"comments.htm must be chmodded 777"

thanks for the help again.


Last edited by ato784 on Sat Nov 29, 2008 6:31 am; edited 1 time in total
ato784
I tried word press, but it seems to be more work than milks code
Marcuzzo
Meebo offers a widget to allow im on your site.
no programming skills required

I used that when I started out a few years ago

hope this helps
ato784
Thanks for the suggestion Marcuzzo, however I already have a chat box on my website (as i said in my first post).
flatliner
ato784 wrote:
WOW! I didn't think that i would get so many responses. Thanks. I am going to try to use the code that milk made, but i am a little confused about what you meant at the end.

"comments.htm must be chmodded 777"

thanks for the help again.


It means the file comments.htm must be writable, in that it mustt have the permissions to be writable.
otherwise the comments cannot be written to the file. 777 is the code for writable permissions.
You can easily change the permissions on files through driectadmin or cpanel, which ever is on your server.
Is it frihost your site is on?


Last edited by flatliner on Sun Dec 28, 2008 3:03 pm; edited 1 time in total
pashmina
i just went through an article which helps to add comment feature on your site.
well i am running out of time to give you the exact link, but the site was nettuts.com

check it out your self./
Related topics

myspace code problems
my site
Script for comments
www.scottphotographics.com
Total FriHost Help

Python automation [SOLVED]
Look...just write something and get paid...how hard is that?
Looking for comments/suggestions
Looking for somebody to script me a MySpace page Frih$ 100+
A frihost website search box on the homepage @ FriHost.com

Hosting Mini-Soccer Website
What are Keywords & why we shld add to our website?
How To : Improve Your PHP Programming
How To : Secure Your PHP Website
C++ TUTORIAL : INTRODUCTION TO C++
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.