Results 1 to 2 of 2

 

Thread: WANTED - Simple Feedback / Comments Script

  1. #1
    Affiliate

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Bristol
    Posts
    2,206
    Thanks
    52
    Thanked 36 Times in 27 Posts


    I have been looking for ages for a really simple feedback / review script.

    I want to enable readers to add their own reviews, and for me to be able to moderate them.

    I know you can get things like this on blogs like wordpress, but I want a simple say php script to add to some really simple html pages.

    can anyone suggest a script.
    Follow, My Affiliate Marketing Musing on . http://www.twitter.com/purple

  2. #2
    Member

    Status
    Offline
    Join Date
    Jan 2004
    Location
    UK
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok,

    This is a rough example and the easiest possible way without using tables etc etc (I think). Have a section in your code that has a form like:

    PHP Code:
      echo '<form action="review.php" method="post" enctype="multipart/form-data" border="0">
            <table class="input">
              <tr><td><textarea name="general" class="input" cols=65 rows=200 wrap="PHYSICAL" style="height:500;overflow:auto;">'
    ;
                       if (isset(
    $_POST['general'])) echo $_POST['general'];           
        echo          
    '</textarea></td>
              <tr><td align="center"><input class="input" type="submit" name="submit" value="Save Changes" /></td></tr>
              </table>
            </form>'


    Then when the form is submitted it opens a file and adds the text to it by running this:

    $file = array('general.txt');
    foreach ($file as $name => $value) {
    $TName = substr($value, 0, -4);
    $filename = "./messages/".$value;
    if (isset($_POST['submit'])) {
    // If the form has been submitted save the details to the file.
    if (is_writeable($filename)) {
    if (!$handle = fopen($filename,"w")) { echo "Cannot open file ($filename)"; exit; }
    if (fwrite($handle, $_POST[$TName]) === FALSE) { echo "Cannot write to the file ($filename)"; exit; }
    $_POST[$TName] = stripslashes($_POST[$TName]);
    fclose ($handle);
    } else { echo "The file is not writeable ($filename)"; exit; }
    } else {
    // Read the comments file and display it in the text area
    if (!$wineFile = @fopen(stripslashes($filename), "r")) {
    die("Can't open the file. Has it been moved/deleted?");
    } else {
    $_POST[$TName] = NULL;
    while ($line = fgetcsv($wineFile, 2048, '<<')) {
    $_POST[$TName] .= stripslashes($line[0]).'
    ';
    }
    }
    }
    }


    Let me know if that helps as I have other ideas.

    NM.
    Holiday Villa In<br>
    <font size=2>If it moves, kick it. If it doesn't move, kick it till it moves and hen kick it because it moved</font>



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 67 Datafeed website scripts
    By Leeky in forum Programming
    Replies: 0
    Last Post: 28-09-06, 06:56 PM
  2. readers review script wanted
    By purple in forum Programming
    Replies: 0
    Last Post: 24-05-06, 04:45 PM
  3. Replies: 1
    Last Post: 04-02-06, 11:15 PM
  4. Feedback wanted on new SMS scheme
    By TxtLocal in forum Affiliate Marketing Lounge
    Replies: 14
    Last Post: 26-09-05, 10:02 PM
  5. Add comments / review script
    By purple in forum Programming
    Replies: 1
    Last Post: 01-09-05, 11:14 AM

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2