Closed Thread
Results 1 to 10 of 10

Thread: Comment Form

  1. #1
    e85andyou is offline x10Hosting Member e85andyou is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    49

    Comment Form

    I have been looking for a comment form that I would like to use on my site but I cant find anything that I like. I tried to program my own but found that PHP and MySQL are still a little over my head. I looked on all the sites I could find and could not find a code that looked good.

    If anyone is interested in creating one for me I will give 400 credits to the first to do so.

    Details:
    I would like a database with just name, comment and product id.
    I would like to place a different comment box for each product and just have to change a product number in the code.
    The display should just have the comments and a leave comment link to a popup window.
    I would also like some type of captcha or spam control since my other forms use to get spammed like crazy.
    If you have any questions please feel free to PM me.

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: Comment Form

    Take a look at the form on my page at http://scoochi2.freehostia.com/.
    Is that something similar to what you would like?

    The select box could be used for the product id (or a text entry box) for example. A captcha could be easily added and the comments either shown publically or privately to just you.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    e85andyou is offline x10Hosting Member e85andyou is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    49

    Re: Comment Form

    I want the product Id to be a hidden field and I want the comments to be publicly displayed

  4. #4
    souradipm is offline x10Hosting Member souradipm is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    45

    Re: Comment Form

    Hi,
    I have cooked up a small script you may edit as you wish. Remember to edit the variable $secret!

    It doesnt have capcha, but it would be easy to add. Just comment.php?act=create&secret=<secret_code> to create the table after you have made sure the database connection works.

    comment.php?act=display&getid=<product_id> = Display a list of comments for <product_id>

    comment.php?act=form&pid=<product_id> = Display a form for submitting to comments under the product id <product_id>

    comment.php?act=submit = called by the ?act=form to submit the data to the database, posting the details.

    Also has minimal protection - htmlspecialchars and the secret code for creating the table.

    Demo: http://www.fivepointsoft.co.cc/testing_area/comment.php
    Append the appropriate stuff to the end of the url to test it out. I will remove the demo after a few days.

    Link to txt version of script - so you can download it: http://www.fivepointsoft.co.cc/testing_area/comment.txt

    ~souradipm

  5. #5
    e85andyou is offline x10Hosting Member e85andyou is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    49

    Re: Comment Form

    The demo Does not work

  6. #6
    souradipm is offline x10Hosting Member souradipm is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    45

    Re: Comment Form

    Did you go to http://www.fivepointsoft.co.cc/testing_area/comment.php ?
    If so, it will not work, because you need to append stuff to the url. If you want, you can split the file across many different php files so you can include them where you want them.

    Try:
    http://www.fivepointsoft.co.cc/testi...act=form&pid=1 to submit a comment under the product id of 1, and then navigate to http://www.fivepointsoft.co.cc/testi...isplay&getid=1 to read the comments under the product id of 1.

    These are the two main things my script provides.

    Obviously the create function wont work because you don't know my secret code and it has already been created so the query will fail anyway.

    ~souradipm
    Last edited by souradipm; 10-29-2008 at 01:34 PM.

  7. #7
    itman647's Avatar
    itman647 is offline x10Hosting Member itman647 is an unknown quantity at this point
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    45

    Re: Comment Form

    you could make one using text files

    example

    build your html form using expression web or frontpage
    call the email box email, the name box name and comments box comments

    the form action attribute should be something like "post.php?viewmode=post" and the method should be "post"

    okay in post.php you should start off like this:

    <?php

    $login = $_GET['login'];

    // ENTER YOUR PASSWORD BELOW
    $pass = md5("mypasswordis12345);

    $viewmode = $_GET['viewmode'];

    // CHANGE THE PATH BELOW TO A 777 CHMOD'D FILE
    $comments = "locationofmycomments.comments.file"

    if($viewmode="post")
    {
    $file = fopen($comments,"a");
    $name = $_GET['name'];
    $email = $_GET['email'];
    $comments = $_GET['comments'];
    $line = $name."|".$email."|".$comments;
    fwrite($file,$line);
    fclose($file);
    }

    if($viewmode="view")
    {
    if (md5($login)==$pass)
    {echo "Access Granted";}
    else
    {echo "Access Denied"; die();}
    $data = file($comments);
    $count = count($data);

    $i = 0;

    foreach ($data as $line)
    {
    $linex = explode("|",$data[$i]);
    echo "Name: ".$linex[0]." Email: ".$linex[1]."<hr>Comments: ".$linex[2]."<hr><br>";
    $i++;
    }
    }

    thats a very simple php form but i cant be arsed atm because i have lots of problems with my own site, but if I have time i'll make a more secure and advanced php script.

    i've never learnt how to create a mysql database and prob never will do, because php code cannot be accessed really without the server password and username, all browsers output html and javascript only, you never see the php code outputted, yes its a text file with no password protection but they wont know the location of it on the server so they can't access it, and if its stored in lots of folders and the absolute url of the file is never exposed or echo'ed to the browser you wont have to worry. so thats why i like using text files, sure you have to be careful but if you know what you're doing you should be fine
    Last edited by itman647; 10-29-2008 at 01:41 PM. Reason: warnings

  8. #8
    e85andyou is offline x10Hosting Member e85andyou is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    49

    Re: Comment Form

    I had a slow day today so I spent it looking for comment program. I stumbled across one exactly what I was looking for after a few hours of searching.

    I thank you all for your help

    You may close this thread

  9. #9
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: Comment Form

    http://dickey.x10hosting.com/test/

    here's what I have now. Still working for the captcha though.
    Don't get me wrong as I believe if and when I help someone I also help myself whereby whatever someone learns I also learn.

    But I will also accept credits or reps if you really want to part with it.

  10. #10
    Jordan C's Avatar
    Jordan C is offline x10 Lieutenant Jordan C is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    New Zealand
    Posts
    425

    Re: Comment Form

    *Closed as requested*

    Sorry Dickey, he already found one.


    Like Mac? Need Mac help? Thinking of switching? Smart Mac is the place for you!
    Join Smart Mac!


Closed Thread

Similar Threads

  1. Call to function from action attribute of form tag
    By parkourmumbai in forum Programming Help
    Replies: 10
    Last Post: 10-14-2008, 06:47 AM
  2. Addon Domain PHP Form Error
    By rockee in forum Free Hosting
    Replies: 2
    Last Post: 04-02-2008, 06:53 PM
  3. Design a free form
    By gateway in forum Off Topic
    Replies: 1
    Last Post: 10-19-2007, 05:49 PM
  4. My php Form tutorial
    By WinGate in forum Tutorials
    Replies: 0
    Last Post: 08-20-2007, 08:14 PM
  5. A simple Visual Basic Login Form
    By Zenax in forum Tutorials
    Replies: 0
    Last Post: 03-13-2007, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers