Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Pls, How can i allow visitors to post comments on my static site? Pls i need the code

    Pls,

    I need help, can anyone pls help me with the html code with which i can allow visitors to post comments on my site? pls

  • #2
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    @iball, thanks for finding time to reply a newbie like me. Pls and pls, i'm new to webdesign but i have a burning passion and that's why i joined this forum. The truth is that my intended site is a static one (don't mind me because i'm still a novice so i can't do dynamic ones at the moment) but i really wish for my intended visitors to enjoy the site, feel at home and also have a bit of interactivity on the site that's why i want to give them room to place comments. Pls help me out, i'm yet to figure out what the comments code look like. Thanks

  • #3
    Regular Coder
    Join Date
    Jun 2012
    Location
    Near Chicago, USA
    Posts
    123
    Thanks
    7
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by juniorpgm View Post
    @iball, thanks for finding time to reply a newbie like me. Pls and pls, i'm new to webdesign but i have a burning passion and that's why i joined this forum. The truth is that my intended site is a static one (don't mind me because i'm still a novice so i can't do dynamic ones at the moment) but i really wish for my intended visitors to enjoy the site, feel at home and also have a bit of interactivity on the site that's why i want to give them room to place comments. Pls help me out, i'm yet to figure out what the comments code look like. Thanks

    juniorpgm, when you add the ability to comment then it will no longer be a static site, but a dynamic one At least on the pages where the interactive comments are published.

    What the comments code looks like depends on what programming language is used to write it. A search at script download sites may reveal some that can be downloaded to study the code.

    How the comments are inserted into the web page would depend on the comment software. Instructions should accompany them.

    In essence, comment software:

    --------------------------
    Accepts comments and, depending on the software, replies to existing comments.

    Incorporates code to handle automated comment submission and perhaps also manually submitted comment spam.

    Stores comments in a database, perhaps MySQL.

    Displays current comments on a web page in a specified order and within a certain date/time range.
    --------------------------

    The above is a rather simplistic set of specifications. Yet, it is a place to start.

    Gotta say, though, it is a hefty project for someone with little coding experience. I recommend learning with smaller coding projects, first.

    Perhaps pre-written software would work OK for the present. If non-blog commenting software is not available, guestbook software might work. A search should reveal a number of script download sites.

    Here are two:

    http://php.resourceindex.com/Complete_Scripts/

    http://cgi.resourceindex.com/Programs_and_Scripts/Perl/

    Will

  • Users who have thanked Will Bontrager for this post:

    juniorpgm (06-09-2012)

  • #4
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    @willbontranger, thanks. Maybe i'll disturb u a little more. Can i use javascript to create a script that will allow comments? If yes, how?

  • #5
    New Coder
    Join Date
    Nov 2010
    Location
    Virginia,USA
    Posts
    36
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by juniorpgm View Post
    @willbontranger, thanks. Maybe i'll disturb u a little more. Can i use javascript to create a script that will allow comments? If yes, how?
    I have a simple suggestion,
    What your asking for here is hundreds of lines of code friend. I know it would not fit within the confines of the limits of this forum for the amount of code allowed in a post. But, while your learning how to write this maybe try out some of the free hosted comment programs out there like Discus. Its a simple couple lines of code added to your site and does not require a database as it is hosted by the company. It will have you up and rolling in a matter of minutes. Then you can swap it out for your own once it has been written.

  • #6
    New Coder
    Join Date
    Jun 2012
    Posts
    80
    Thanks
    0
    Thanked 18 Times in 18 Posts
    Hi juniorpgm,
    If you want an easy way, you could use some widget comment box like Facebook comment or Html comment box but if you want to do by yourself, you need a database and server side language.

  • #7
    Regular Coder
    Join Date
    Jun 2012
    Location
    Near Chicago, USA
    Posts
    123
    Thanks
    7
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by juniorpgm View Post
    @willbontranger, thanks. Maybe i'll disturb u a little more. Can i use javascript to create a script that will allow comments? If yes, how?
    JavaScript can be used to display comments.

    It may not be the best solution for many. However, JavaScript does have one advantage. Content displayed with JavaScript is less likely to be read by search engine spiders. Thus, off-topic comments are less likely to skew the actual topic of the web page in whatever algorithms are used to generate search results.

    However, JavaScript is not enough.

    As Richter indicated, a database and a server-side language is required.

    I recommend an SQL database for ease of data manipulation. I am most familiar with MySQL. But there are others. My preferred language for working with MySQL is PHP. There are other server-side languages, each with their advocates.

    Some info that may assist understanding:

    When a web page is delivered to a browser, the source code of the web page is first retrieved from a file on the server. Then, the source code is sent to the browser.

    For non-static pages (pages with source code that may be different for each page load), the source code is manipulated or perhaps wholly generated at the server before it is sent to the browser.

    A comments database would be on the server. The server-side software obtains the data required for the web page and inserts the data into the web page source code. Only then is the source code sent to the browser.

    Alternatively, the data from the database is inserted into the web page after the browser has received the web page source code from the server. In that case, JavaScript can be used to request the comments data from the server-side software.

    Either way, the server-side software and the database are required.

    Because JavaScript code is within the source code of the web page, JavaScript runs after the source code is received by the browser. JavaScript by itself can't do the entire job of commenting software because JavaScript runs within the web page in the browser, not on the server.

    The only connection to the server that JavaScript has is the same type of connection the browser has. The browser can not, and JavaScript can not, tell the server what to do. They can request data from server-side software, but not tell it what it must do. The server-side software responds to requests according to how it was programmed to respond.

    Both badwolf and Richter made excellent suggestions. Using remotely-hosted comment software may be an acceptable temporary solution until you can build you own system. Using other people's comment software has the additional advantage of becoming familiar with how they are programmed to behave. With that information, you can decide what you like and don't like and what you would improve.

    Using others' software might even be the stimulus for conceiving of an entirely new feature for your own comment software.

    I wish you the best. It is a sometimes confusing but often exciting road you are on. Learning programming and writing software commands to make computers dance is one of my pleasures in life. If your personal excitement encompasses those concepts, then you have much fun in your future.

    Will


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •